2006-03-09 Martin Baulig <martin@ximian.com>
[mono.git] / mcs / gmcs / ChangeLog
1 2006-03-09  Martin Baulig  <martin@ximian.com>
2
3         * ecore.cs (FieldExpr.AddressOf): Don't emit the instance if the
4         `prepared' flag is set.
5
6         * generic.cs (LiftedBinaryOperator): Don't allow `||' or `&&' anymore.
7         (LiftedBinaryOperator, LiftedUnaryMutator): Fix a few nullable
8         issues; see gtest-254.cs.
9
10 2006-03-07  Martin Baulig  <martin@ximian.com>
11
12         * generic.cs (TypeManager.InferType): Allow infering
13         `IEnumerable<T>' with an array of T; see gtest-251.cs.
14
15 2006-03-06  Martin Baulig  <martin@ximian.com>
16
17         * generic.cs
18         (TypeManager.InferType): Fix gtest-250.cs.
19
20         * typemanager.cs
21         (TypeManager.IsSubclassOf): Also check the base class.
22
23         * expression.cs
24         (Invocation.IsAncestralType): Use TypeManager.IsSubclassOf();
25         fixes gtest-249.cs.
26
27 2006-03-01  Raja R Harinath  <rharinath@novell.com>
28
29         Fix #77679.
30         * expression.cs (ParameterReference.DoResolveBase): Change return
31         type to bool.
32         (ParameterReference.DoResolve, ParameterReference.DoResolveLValue):
33         Update.
34
35         Fix #77628.
36         * ecore.cs (PropertyExpr.InstanceResolve): Fix CS1540 check.
37
38         Fix #77642.
39         * typemanager.cs (GetFullNameSignature): Don't nullref on
40         protected accessors.
41
42 2006-02-16  Martin Baulig  <martin@ximian.com>
43
44         * generic.cs
45         (TypeManager.GetGenericFieldDefinition): New public method; use it
46         instead of the `FieldInfo.Mono_GetGenericFieldDefinition()' icall.
47
48 2006-02-14  Martin Baulig  <martin@ximian.com>
49
50         * *.cs: Use `Type.IsGenericType' instead of `Type.IsGenericInstance'.
51
52 2006-02-14  Martin Baulig  <martin@ximian.com>
53
54         * generic.cs
55         (TypeManager.DropGenericMethodArguments): New public method; don't
56         use GetGenericMethodDefinition() on something which is not a
57         generic method.
58
59 2006-02-14  Martin Baulig  <martin@ximian.com>
60
61         * generic.cs
62         (ConstraintChecker.CheckConstraints): If a type parameter has the
63         `struct' constraint, the type must be a non-nullable valuetype.
64
65 2006-02-10  Martin Baulig  <martin@ximian.com>
66
67         * typemanager.cs
68         (TypeManager.IsOverride): Make this work for instantiated methods
69         in a generic class; fixes #77509.
70         (TypeManager.ExpandInterfaces): Use TypeManager.GetInterfaces()
71         rather than calling it directly; fixes #77488.  
72
73 2006-02-08  Martin Baulig  <martin@ximian.com>
74
75         * generic.cs (ConstraintChecker.CheckConstraints): Move the error
76         reporting into CheckConstraint() so we can use the correctly
77         instantiated type.
78
79 2006-02-08  Martin Baulig  <martin@ximian.com>
80
81         * expression.cs (BaseAccess): Add support for generic methods.
82
83         * ecore.cs (MethodGroupExpr.ResolveGeneric): Propagate `IsBase' to
84         the new MethodGroupExpr.
85
86 2006-02-07  Martin Baulig  <martin@ximian.com>
87
88         * generic.cs (ConstraintChecker.CheckConstraints): Interfaces are
89         also reference types; fixes #77483.
90
91 2006-02-07  Martin Baulig  <martin@ximian.com>
92
93         * generic.cs
94         (TypeManager.IsGenericMethod): We now return whether something is
95         an instantiated generic method (and not a generic method def).
96         (TypeManager.IsGenericMethodDefinition): New public method.
97
98         * typemanager.cs
99         (TypeManager.CSharpSignature): Only include type arguments for
100         "real" generic methods, not for any instantiated method.
101         (TypeManager.GetMethodName): Likewise, but also allow generic
102         method definitions here.
103
104 2006-02-06  Miguel de Icaza  <miguel@novell.com>
105
106         * codegen.cs (EmitScopeInitFromBlock): check here the
107         capture_context, there is no need to make two calls to the
108         EmitContext. 
109
110         * anonymous.cs: Add some debugging messages that might help me
111         track other instances of this problem in the future (the
112         regression of test 467).
113
114         * cs-parser.jay: track the variable block, as we need to initalize
115         any captured variables declared in this block for the "catch"
116         portion of the "Try" statement.
117
118         * statement.cs (Try.Emit): If the "Catch" has a VarBlock, emit any
119         scope initialization for captured variables. 
120
121         Also, move the emit for the variables after the block location has
122         been marked.
123
124 2006-02-06  Marek Safar  <marek.safar@seznam.cz>
125
126        * ecore.cs (PropertyExpr.FindAccessors): Just made flags const.
127         
128 2006-02-06  Martin Baulig  <martin@ximian.com>
129
130         * class.cs (TypeContainer.DefineType): If we're a struct, pass
131         `TypeManager.value_type' as parent type to
132         ModuleBuilder.DefineType().  Fixes #77358.      
133
134 2006-02-02  Miguel de Icaza  <miguel@novell.com>
135
136         * anonymous.cs (CaptureContext.EmitInitScope): I was wrong in the
137         commit yesterday, the initialization for the roots is necessary.
138         What is not necessary is the scope activation.
139
140 2006-02-02  Raja R Harinath  <rharinath@novell.com>
141
142         * ecore.cs (PropertyExpr.DoResolveLValue): Add CS0206 check.
143         * expression.cs (IndexerAccess.DoResolveLValue): Add CS1612 and
144         CS0206 checks.
145         (Argument.Resolve): Remove CS0206 checks.
146
147 2006-02-01  Miguel de Icaza  <miguel@novell.com>
148
149         * anonymous.cs (CaptureContext.EmitInitScope): Do not emit the
150         scopes for all the roots, the scopes will now be emitted when the
151         Blocks are entered. [This change was wrong, fixed on 2006-02-02]
152
153         (CaptureContext.EmitScopeInitFromBlock): Simply emit the ScopeInfo
154         code.  This reduces a lot of existing cruft.
155         
156         * statement.cs (Block.Emit): Call EmitScopeInitFromBlock here, so
157         that the ScopeInfo is generated as we enter the scope, not at the
158         time of use, which is what we used to do before.
159
160         * codegen.cs (EmitScopeInitFromBlock): New routine, this is called
161         every time a Block is about to be emitted if we have a
162         CaptureContext. 
163
164 2006-02-01  Raja R Harinath  <rharinath@novell.com>
165
166         * codegen.cs (AssemblyClass.Emit): Emit RuntimeCompatibility
167         attribute for mscorlib too.
168
169         * typemanager.cs (NoTypes, NoTypeExprs): Remove.
170         (Reset): Update.
171         * *.cs: Use Type.EmptyTypes instead of TypeManager.NoTypes.
172
173         * typemanager.cs (cons_param_array_attribute): Make private.
174         (Reset): Set it to null.
175         (InitCoreHelpers): Don't initialize it.
176         (ConsParamArrayAttribute): New.  Initialize it as needed.
177         * parameter.cs (ParamsParameter.ApplyAttribute): Update to change.
178
179 2006-01-31  Miguel de Icaza  <miguel@novell.com>
180
181         * expression.cs: There might be errors reported during the
182         selection of applicable methods.  If there are errors, do not
183         continue execution as it will lead the compiler to crash.
184
185 2006-01-30  Miguel de Icaza  <miguel@novell.com>
186
187         * expression.cs: Member access is not allowed on anonymous
188         methods.  Fixes #77402.
189
190 2006-01-30  Raja R Harinath  <rharinath@novell.com>
191
192         Fix #77401
193         * cs-parser.jay (VariableDeclaration): Don't set
194         current_array_type to null.
195         (field_declaration, event_declaration, declaration_statement):
196         Set it to null here.
197
198 2006-01-29  Raja R Harinath  <harinath@gmail.com>
199
200         Fix part of #77397
201         * generic.cs (TypeManager.IsEqual): Handle pass-by-ref types.
202
203 2006-01-28  Raja R Harinath  <harinath@gmail.com>
204
205         * typemanager.cs (GenericParameterPosition): New.
206         * doc.cs: Use it.
207
208 2006-01-28  Atsushi Enomoto  <atsushi@ximian.com>
209
210         * doc.cs : To process "include" elements, first we should create
211           another list than XmlNodeList, because it could result in node
212           removal, which could result in that the XmlNodeList gives up
213           yielding next node.
214
215 2006-01-25  Miguel de Icaza  <miguel@novell.com>
216
217         * expression.cs: Introduce an error report that we were not
218         catching before.   Gonzalo ran into it.
219
220 2006-01-23  Miguel de Icaza  <miguel@novell.com>
221
222         A fix for bug: #76957
223         
224         * iterators.cs (MoveNextMethod.CreateMethodHost): call
225         ComputeMethodHost before creating the method, this is a new
226         requirement. 
227
228         * anonymous.cs (AnonymousContainer): Now we track all the scopes
229         that this method references (RegisterScope).  The actual scope
230         where the method is hosted is computed with the ComputeMethodHost
231         before we create the method.
232
233         Moved the Deepest routine here.
234
235         (AnonymousContainer.ComputeMethodHost): New routine used to
236         compute the proper ScopeInfo that will host the anonymous method.
237
238         (ScopeInfo): Deal with multiple roots.  The problem was that we
239         did not have a unique root where all ScopeInfos could be hanged
240         from.   Remove `topmost' ScopeInfo, and instead keep an arraylist
241         of roots.  
242
243         Remove AdjustMethodScope which is now computed at the end.  Remove
244         LinkScope which did a partial link, instead link all ScopeInfos
245         before code generation from the new "LinkScopes" routine. 
246
247         Simplify all the Add* routines as they no longer need to maintain
248         the tree, they just need to record that they are using variables
249         from a ScopeInfo.
250
251         (IsAncestor, GetAncestorScopes, GetParentScope, LinkScope): New
252         routines to produce the forest of ScopeInfo trees.
253
254         * class.cs (TypeContainer.AppendMethod): This is just like
255         AddMethod, but ensures that an interface implementation method
256         (IEnumerable.XXX) is not inserted at the beginning of the queue of
257         methods, but at the end.
258
259         We use this functionality to ensure that the generated MoveNext
260         method in the iterator class is resolved/emitted before the
261         enumerator methods created.   
262
263         This is required because the MoveNext method computes the right
264         ScopeInfo for the method.  And the other methods will eventually
265         need to resolve and fetch information computed from the anonymous
266         method. 
267
268         
269 2006-01-23  Raja R Harinath  <rharinath@novell.com>
270
271         Improve implementation of section 14.4.2.2 (Better function member).
272         * expression.cs (Invocation.MoreSpecific): Compare all type
273         arguments before deciding if one type is more specific than
274         another.  Handle array types too.  Return the more specific type.
275         (Invocation.BetterFunction): Add more tie-breaking rules from
276         section 14.4.2.2.  Perform "more specific" check after
277         other tie-breaking rules.  Compare all parameter types before
278         choosing the "more specific" method.
279
280 2006-01-21  Raja R Harinath  <harinath@gmail.com>
281             Carlos Alberto Cortez  <calberto.cortez@gmail.com>
282
283         Fix rest of #76995.
284         * namespace.cs (NamespaceEntry.UsingExternalAliases): Don't add to
285         the 'aliases' hash.
286         (NamespaceEntry.LookupAlias): Lookup 'extern_aliases' hash too.
287         (NamespaceEntry.VerifyUsing): Resolve external aliases too.
288
289 2006-01-18  Martin Baulig  <martin@ximian.com>
290
291         * class.cs (TypeContainer.AddToMemberContainer): Use
292         `symbol.MemberName.MethodName' instead of just `symbol.Name';
293         fixes #77124.
294
295 2006-01-18  Martin Baulig  <martin@ximian.com>
296
297         Fix #76417: a generic class may now have methods which may unify
298         for some type parameter substitutions.
299
300         * class.cs (Method.IsDuplicateImplementation): Don't report CS0408
301         for methods which may unify anymore.
302
303         * expression.cs (Invocation.MoreSpecific): New private static
304         method; checks whether one method is more specific than another
305         according to 14.4.2.2 of the spec.
306         (Invocation.BetterFunction): Implement the tie-breaking rules from
307         14.4.2.2 of the spec: if two methods unify for some type parameter
308         substitution, we need to pick the more specific one.
309
310 2006-01-18  Raja R Harinath  <rharinath@novell.com>
311
312         Fix #76656, cs0231-2.cs.
313         * cs-parser.jay (formal_parameter_list): Make error case catch
314         more issues.
315         (parenthesized_expression_0): Add CS1026 check.
316         (invocation_expression): Remove unused { $$ = lexer.Location }.
317
318 2006-01-17  Raja R Harinath  <rharinath@novell.com>
319
320         Fix #76824.
321         * cs-parser.jay (statement_expression): Don't list out the
322         individual statement-expressions.  Convert syntax error into
323         CS0201 check.
324
325 2006-01-16  Raja R Harinath  <rharinath@novell.com>
326
327         Fix #76874.
328         * ecore.cs (MemberAccess.CheckIntermediateModification): Remove.
329         (UnboxCast.DoResolveLValue): New.  Move CS0445 check from
330         CheckIntermediateModification.
331         (FieldExpr.DoResolve): Add new two-argument version that
332         allows us to resolve the InstanceExpression as an lvalue.
333         The one-argument variant is now just a wrapper.
334         (FieldExpr.DoResolveLValue): Use two-argument DoResolve.
335         Resolve the lhs as an lvalue if the it has a value type.
336         (FieldExpr.AssignToReadonly): Move CS1648 and CS1650 checks
337         from Assign.DoResolve.
338         (PropertyExpr.InstanceResolve): Allow InstanceExpression to be
339         resolved as an lvalue.
340         (PropertyExpr.DoResolve): Update.
341         (PropertyExpr.DoResolveLValue): Resolve the lhs as an lvalue if it
342         has a value type.  Move CS1612 check here from
343         CheckIntermediateModification.
344         * assign.cs (Assign.DoResolve): Remove CS1648 and CS1650 checks.
345         * expression.cs (EmptyExpression.OutAccess): New.  Used as the
346         'right_side' of a ResolveLValue on an 'out' argument.
347         (EmptyExpression.LValueMemberAccess): New.  Used as the
348         'right_side' of a propagated ResolveLValue on a value type.
349         (LocalVariableReference.DoResolveBase): Recognize
350         EmptyExpression.OutAccess and EmptyExpression.LValueMemberAccess.
351         Add CS1654 check.
352         (Argument.Resolve): Use EmptyExpression.OutAccess rather than
353         EmptyExpression.Null.
354
355 2006-01-16  Atsushi Enomoto  <atsushi@ximian.com>
356
357         * typemanager.cs : added IsGenericParameter(). In gmcs it returns
358           Type.IsGenericParameter(). Fixed bug #77183.
359         * doc.cs : it is now identical to doc.cs in mcs.
360
361 2006-01-16  Martin Baulig  <martin@ximian.com>
362
363         * generic.cs (ConstraintChecker.CheckConstraint): Fix #77167.
364
365 2006-01-16  Martin Baulig  <martin@ximian.com>
366
367         * typemanager.cs (TypeManager.CSharpSignature): Make this work for
368         ctors; fixes #77250.
369
370 2006-01-12  Miguel de Icaza  <miguel@novell.com>
371
372         This fixes the problem where we used ldfld instead of ldflda to
373         load the "THIS" pointer on captured parameters, when THIS is a
374         value type.  See bug #77205.
375         
376         * iterators.cs (CapturedThisReference.Emit): Pass false to
377         EmitThis (we do not need the address).
378
379         * codegen.cs (EmitThis): it needs to know whether we need the
380         address of `this' or not.  This is used by value types.  
381
382         * expression.cs (This.AddressOf): Pass true to the EmitThis call,
383         every other call passes false.
384
385 2006-01-12  Raja R Harinath  <rharinath@novell.com>
386
387         Fix #77221.
388         * typemanager.cs (TryGetBaseDefinition): Rename from the mis-named
389         GetOverride.
390         * expression.cs (Invocation.OverloadResolve): Update.
391         (Invocation.DoResolve): Avoid double resolution of invocation.
392
393 2006-01-11  Raja R Harinath  <rharinath@novell.com>
394
395         Fix #77180.
396         * expression.cs (Unary.Emit): When in /checked+ mode, don't emit
397         unary negation of floating point types as 0-expr; negation cannot
398         overflow in floating point types.
399
400         Fix #77204.
401         * expression.cs (MemberAccess.DoResolve): Disallow the use of '.'
402         on operands of 'void' type.
403
404         Fix #77200.
405         * cfold.cs (BinaryFold): Implement folding of BinaryOr, BinaryAnd
406         and ExclusiveOr for boolean constants too.
407
408 2006-01-12  Ben Maurer  <bmaurer@andrew.cmu.edu>
409
410         * expression.cs: Fix Console.WriteLine ((this = x).foo);
411
412 2006-01-12  Miguel de Icaza  <miguel@novell.com>
413
414         * cs-tokenizer.cs (Position): New class used to save and restore
415         the position state in the tokenizer.  Before this patch the save
416         and restore was not complete enough so the line and columns would
417         start to drift and the debugger and stack traces will get the
418         wrong data.
419
420 2006-01-10  Martin Baulig  <martin@ximian.com>
421
422         * generic.cs
423         (TypeParameter.InflateConstraints): New public method.
424
425         * iterators.cs (Iterator.DefineNestedTypes): Also inflate the
426         constraints; fixes #77042.
427
428 2006-01-10  Martin Baulig  <martin@ximian.com>
429
430         * anonymous.cs (ScopeInfo.EmitScopeType): Use the `CurrentType'
431         instead of the `TypeBuilder' for this "<>THIS" variable; fixes
432         #77061. 
433
434 2006-01-09  Raja R Harinath  <rharinath@novell.com>
435
436         Fix #75636.
437         * expression.cs (Invocation.OverloadResolve): Replace reflected
438         override methods with their base virtual methods, rather than
439         skipping over them.
440         * typemanager.cs (TypeManager.GetOverride): New.
441
442 2005-12-21  Miguel de Icaza  <miguel@novell.com>
443
444         * driver.cs: Report the case of no source files and no -out:
445         argument provided.
446
447 2005-12-20  Raja R Harinath  <rharinath@novell.com>
448
449         Fix #77035.
450         * expression.cs (ComposedCast.GetSignatureForError): Define.
451
452 2006-01-05  Jb Evain  <jbevain@gmail.com>
453
454         * class.cs (Property.Define, Indexer.Define): do not tag the
455         properties as SpecialName | RTSpecialName.
456
457 2006-01-04  Miguel de Icaza  <miguel@novell.com>
458
459         * class.cs (MethodCore.IsDuplicateImplementation): This method was
460         doing a low-level comparission of parameter types.  It was lacking
461         a check for __argslist. 
462
463 2005-12-30  Miguel de Icaza  <miguel@novell.com>
464
465         * expression.cs (ParameterReference.DoResolveBase): Allow
466         reference parameters if they are local to this block. 
467
468         This allows the ref and out parameters of a delegate to be used in
469         an anonymous method, for example:
470
471         delegate void set (out int x);
472
473         set s = delegate (out int x){
474                 x = 0;
475         };
476
477         This is used by functionality introduced late in the C# language.
478         
479         * anonymous.cs (AnonymousMethod.Compatible): Allow anonymous
480         method that take ref and out parameters. 
481
482         Fixes #77119 which was a late change in the spec.
483
484 2005-12-23  Miguel de Icaza  <miguel@novell.com>
485
486         * anonymous.cs (ScopeInfo.LinkScope): Do not link the scope to its
487         parent if its the same scope.  Fixes #77060.
488
489 2005-12-22  Marek Safar  <marek.safar@seznam.cz>
490
491         * expression.cs (ComposedCast.DoResolveAsTypeStep): Fixed wrong merge.
492
493 2005-12-21  Carlos Alberto Cortez <calberto.cortez@gmail.com>
494
495         * codegen.cs (AssemblyClass.CheckInternalsVisibleAttribute): Generate
496         errors 1726 for strong named assemblies with InternalsVisibleToAttribute 
497         that doesn't contain the full public key. This is a update of the
498         friend assemblies in .Net 2.0 release.
499         
500 2005-12-18 Carlos Alberto Cortez <calberto.cortez@gmail.com>
501
502         Fix #76995
503
504         * namespace.cs (NamespaceEntry): Add extern_aliases as a
505         ListDictionary, to contain the ExternAliasEntry entries (in
506         addition to the NamespaceEntry.aliases hashtable). This field is
507         shared between the original entry and its doppelganger (bodyless 
508         copy of it).
509         (NamespaceEntry.UsingExternalAlias): Add the extern alias entry to
510         extern_aliases field.
511         (NamespaceEntry.Lookup): Move the IsImplicit check after the
512         lookup in extern_aliases.
513
514 2005-12-16  Raja R Harinath  <rharinath@novell.com>
515
516         Fix #77006.
517         * class.cs (TypeContainer.Mark_HasEquals): New.
518         (TypeContainer.Mark_HasGetHashCode): New.
519         (ClassPart): Override them.
520         (MethodCore.CheckBase): Use them instead of referring to Parent.Methods.
521
522         * generic.cs (GenericMethod.DefineMembers): Update to changes.
523         (TypeParameter.TypeParameter): Change type of 'parent' argument to
524         DeclSpace.
525
526         Fix #77008.
527         * enum.cs (EnumMember.EnumMember): Pass the parent_enum as the
528         'parent' argument to the base constructor.
529
530         Remove all mention of TypeContainer from decl.cs.
531         * decl.cs (MemberCore.Parent): Change into a DeclSpace.
532         (MemberCore.MemberCore): Change type of 'parent' argument to DeclSpace.
533         (DeclSpace.DeclSpace): Likewise.
534         (DeclSpace.DefineMembers): Remove unused argument.
535         * cs-parser.jay (pop_current_class): Update to changes.  Simplify
536         debugging check -- we don't care if the debug code throws an
537         InvalidCastException instead of an InternalErrorException.
538         * class.cs (TypeContainer.DefineMembers): Update to changes.
539         (TypeContainer.DoDefineMembers): Likewise.
540         (TypeContainer.GetMethods): Likewise.
541         (PropertyMember.Define): Likewise.
542         (MemberBase.Parent): New property that forwards to
543         MemberCore.Parent, but ensures that we get a TypeContainer.
544         * rootcontext.cs (RootContext.PopulateCoreType): Update to changes.
545         (RootContext.PopulateTypes): Likewise.  Remove special case code
546         for !RootContext.StdLib: DefineMembers is idempotent.
547
548 2005-12-13  Marek Safar  <marek.safar@seznam.cz>
549
550         * class.cs (Method.ApplyAttributeBuilder): Test out modifier properly.
551
552 2005-12-11  Atsushi Enomoto  <atsushi@ximian.com>
553
554         * doc.cs : The search for referenced namespace was insufficient to
555           get global one as it used to do. Fixed bug #76965.
556
557 2005-12-10  Atsushi Enomoto  <atsushi@ximian.com>
558
559         * doc.cs : check name in cref in the last phase that whether it is
560           namespace or not.
561
562 2005-12-09  Atsushi Enomoto  <atsushi@ximian.com>
563
564         * cs-tokenizer.cs : reverted the latest change: it somehow broke
565           Mono.C5.
566
567 2005-12-09  Atsushi Enomoto  <atsushi@ximian.com>
568
569         * doc.cs : so it turned out that we cannot skip override check for 
570           interface members. Fixed bug #76954.
571
572 2005-12-09  Atsushi Enomoto  <atsushi@ximian.com>
573
574         * cs-tokenizer.cs : fixed bug #75984:
575           - #warning and #error should not be handled when the source line
576             is disabled.
577           - #line is not checked strictly when the source line is disabled.
578           - #define and #undef is on the other hand checked strictly at any
579             state.
580
581 2005-12-08  Atsushi Enomoto  <atsushi@ximian.com>
582
583         * cs-tokenizer.cs : missing Location (actually, filename) in one of
584           CS1027 report.
585
586 2005-12-15  Raja R Harinath  <rharinath@novell.com>
587
588         * generic.cs (TypeManager.IsGeneric): Remove unused method.
589
590         * typemanager.cs (TypeManager.GetFullName): Rewrite to handle
591         nested types.
592
593 2005-12-14  Martin Baulig  <martin@ximian.com>
594
595         * typemanager.cs (TypeManager.GetFullName): Make this public;
596         `Type.Fullname' now never returns null.
597
598         * class.cs (Method.Define): Use TypeManager.GetFullName() for
599         explicit interface implementations; we're now using the same
600         naming convention than csc does.
601
602 2005-12-14  Miguel de Icaza  <miguel@novell.com>
603
604         * convert.cs (ExplicitConversionCore): Check the return value from
605         ExplicitConversionCore which can return null on failure.  Fixes #76914
606
607 2005-12-09  Raja R Harinath  <rharinath@novell.com>
608
609         * anonymous.cs (AnonymousMethod.Compatible): Use IsGenericType
610         instead of IsGenericInstance.
611         * generic.cs (TypeManager.IsEqual): Likewise.  Delete redundant
612         code that's now covered by the more general test.
613         * typemanager.cs (TypeManager.IsPrivateAccessible): Likewise.
614
615         * generic.cs (DropGenericTypeArguments): New.  Captures the common
616         pattern: if (t.IsGenericInstance) t = t.GetGenericTypeDefinition ();
617         * attribute.cs, class.cs, decl.cs, ecore.cs: Use it.
618         * generic.cs, report.cs, typemanager.cs: Likewise.
619
620 2005-12-08  Martin Baulig  <martin@ximian.com>
621
622         * generic.cs (TypeArguments.Resolve): Added CS1547 check.
623
624         * typemanager.cs (TypeManager.CSharpSignature): Include type
625         arguments in the signature of a generic method.
626
627 2005-12-07  Martin Baulig  <martin@ximian.com>
628
629         Add support for custom attributes on type parameters.
630
631         * cs-parser.jay (type_arguments): Added `opt_attributes'.
632
633         * generic.cs (TypeParameterName): New public class; we use this
634         instead of a `string' to store the name of a type parameter, so we
635         can also have `Attributes'.
636         (TypeArguments.GetDeclarations): Return a `TypeParameterName[]'
637         array instead of a `string[]' array.
638         (TypeParameter.ctor): We now also take an `Attributes' argument.
639         (TypeParameter.EmitAttributes): New public method; emit our
640         `OptAttributes' here.
641         (GenericMethod.EmitAttributes): New public method; emit the custom
642         attributes on all our type parameters.
643
644         * class.cs (TypeContainer.EmitType): Call EmitAttributes() on all
645         our type parameters.
646         (MethodData.Define): If we're a generic method, call
647         EmitAttributes() on it.
648
649 2005-12-07  Martin Baulig  <martin@ximian.com>
650
651         * generic.cs
652         (ConstraintChecker): New public abstract class; move the
653         constraint checking here from `ConstructedType' and also do
654         constraint checking for generic methods here.
655
656         * expression.cs (Invocation.OverloadResolve): Use
657         ConstraintChecker.CheckConstraints() if we resolved to a generic
658         method.  Fix #76806.
659
660 2005-12-05  Marek Safar  <marek.safar@seznam.cz>
661
662         * attribute.cs (GlobalAttribute.ctor): Pass NamespaceEntry only.
663
664         * class.cs (EmitFieldInitializers): Simplified and fixed to work with
665         event initializers.
666         (FieldBase.EmitInitializer): Moved from TypeContainer and simplified.
667         (FieldBase.Initializer): Initializer is now optional.
668         (EventField.Define): Only event field can have initializer.
669
670         * codegen.cs (EmitContext): DeclSpace is not readonly (small hack).
671
672         * const.cs (Const): Reuse initializer.
673
674         * cs-parser.jay: Updated after FieldBase changes.
675         Added current_array_type to simplify array initializers.
676
677         * ecore.cs (NullCast.IsDefaultValue): Implemented.
678
679         * expression.cs, iterators.cs: Updated.
680
681         * namespace.cs (NamespaceEntry): Made UsingFound private.
682
683 2005-12-05  Marek Safar  <marek.safar@seznam.cz>
684
685         * parameterCollection.cs: Obsolete, removed.
686         * parser.cs: Obsolete, removed.
687
688 2005-12-05  Marek Safar  <marek.safar@seznam.cz>
689
690         Fix #76849.
691         * class.cs (Constructor.Emit): Set obsolete checking for whole context.
692
693         * enum.cs (Enum.Define): Set obsolete context here.
694
695 2005-12-05  Atsushi Enomoto  <atsushi@ximian.com>
696
697         * doc.cs :
698           - FindDocumentedMember() now expects 1) paramList as null
699             when "we don't have to check the number of parameters" and
700             2) Type.EmptyTypes when "there is no arguments".
701           - Introduced FoundMember struct to hold the exact type which was
702             used to find the documented member (the above change broke
703             test-xml-044; it might be better just to use DeclaringType than
704             what MS does, like this change does, but it depends on usage.)
705
706 2005-12-05  Atsushi Enomoto  <atsushi@ximian.com>
707
708         * doc.cs : documented member might be from DeclaringType for nested
709           types. Fixed bug #76782.
710
711 2005-12-03  Ben Maurer  <bmaurer@ximian.com>
712
713         * anonymous.cs: Have the param code handle leaving copies on the
714         stack etc. Allows anonymous params to take part in the assignment
715         code (++, +=, etc). Fixes bug #76550
716
717         * expression.cs: Handle the prepare_for_load/leave_copy by passing
718         it down to the anon code.
719
720         * iterators.cs: Use dummy var here
721
722         * codegen.cs: Handle new vars
723
724 2005-12-01  Marek Safar  <marek.safar@seznam.cz>
725
726         Fix #76849.
727         * class.cs (MethodData.Define): Set proper Obsolete context.
728
729         * ecore.cs (FieldExpr.ResolveMemberAccess): Don't check [Obsolete] in
730         obsolete context.
731         (FieldExpr.DoResolve): Ditto.
732
733 2005-12-01  Marek Safar  <marek.safar@seznam.cz>
734
735         Fix #76849.
736         * class.cs (MethodCore.DoDefineParameters): Test [Obsolete] only when
737         parent is not obsolete.
738
739 2005-12-01  Atsushi Enomoto  <atsushi@ximian.com>
740
741         * doc.cs : (FindDocumentedMember) find parameterless members first
742           and get CS0419 in the early stage. Fixed first case of bug #76727.
743
744 2005-11-30  Marek Safar  <marek.safar@seznam.cz>
745
746         Fix #76859.
747         * ecore.cs (Expression.ResolveAsConstant): Report constant error only when
748         no error was reported.
749
750         *expression.cs (Binary.DoResolve): left can be null.
751
752 2005-12-06  Raja R Harinath  <rharinath@novell.com>
753
754         * class.cs (MethodCore.CheckGenericOverride): Delete unused
755         abstract method and all overrides.
756         * support.cs (ParameterData.GenericConstraints): Delete.
757         (ReflectionParameters.type_params): Delete.
758         (ReflectionParameters.ReflectionParameters): Make private.
759         (ReflectionParameters.GetConstaints): New factory method.
760         * generic.cs (TypeParameterDefineType): Use it.
761         (TypeManager.GetTypeParameterConstraints): Likewise.
762
763 2005-11-22  Marek Safar  <marek.safar@seznam.cz>
764
765         Fix #76783.
766         * class.cs (MethodData.Emit): Parameters should be labeled first.
767
768 2005-11-21  Marek Safar  <marek.safar@seznam.cz>
769
770         Fix #76761.
771         * parameter.cs (Parameter.ApplyAttributeBuilder): Fixed `ref' detection.
772
773 2005-11-18  Marek Safar  <marek.safar@seznam.cz>
774
775         * attribute.cs (AreParametersCompliant): Moved to Parameter.
776
777         * class.cs (MethodCore): Parameter clean up.
778         (IMethodData): Added ParameterInfo.
779         (MethodData): Parameter clean up.
780         (Indexer.Define): Parameter clean up.
781
782         * anonymous.cs,
783         * codegen.cs,
784         * cs-parser.jay,
785         * decl.cs,
786         * doc.cs,
787         * ecore.cs,
788         * flowanalysis.cs,
789         * iterators.cs,
790         * pending.cs,
791         * statement.cs,
792         * typemanager.cs: Parameter clean up.
793
794         * delegate.cs (Define): Get rid of duplicated code.
795
796         * expression.cs (ParameterReference): Removed useless parameters
797         and simplified.
798         (Invocation): Ditto.
799
800         * parameter.cs (ParamsParameter): New class, params specialization.
801         (ArglistParameter): Attemp to separate arglist.
802         (Parameter): Refactored to be reusable and faster.
803         (Parameter.Modifier): Made understandable.
804         (Parameters): Changed to be used as a class for `this' assembly
805         parameters. Refactored to use new specialized classes.
806
807         * support.cs (ParameterData): Added Types property.
808         (InternalParameters): Deleted.
809
810 2005-11-16  Atsushi Enomoto  <atsushi@ximian.com>
811
812         * doc.cs : the previous patch does not actually fix the bug.
813           PropertyInfo override check is now implemented and really fixed it.
814         * expression.cs : Invocation.IsAncestralType() is used from doc.cs.
815
816 2005-11-16  Atsushi Enomoto  <atsushi@ximian.com>
817
818         * doc.cs : apply "override filter" also to properties.
819           Fixed bug #76730.
820
821 2005-11-16  Atsushi Enomoto  <atsushi@ximian.com>
822
823         * doc.cs : renamed FindMembers() to FindMethodBase(). For interfaces,
824           no need to check overrides. For classes, omit those results from 
825           interfaces since they must exist in the class. Fixed bug #76726.
826
827 2005-11-15  Atsushi Enomoto  <atsushi@ximian.com>
828
829         * typemanager.cs : (GetFullNameSignature) differentiate indexers
830           with different parameters. Fixed the second problem in #76685.
831
832 2005-11-15  Atsushi Enomoto  <atsushi@ximian.com>
833
834         * doc.cs : (FindDocumentedMember) pass invocation_type as well (to
835           get expected 'protected' access in CheckValidFamilyAccess()).
836           Fixed bug #76692.
837
838 2005-11-15  Atsushi Enomoto  <atsushi@ximian.com>
839
840         * doc.cs : (GenerateTypeDocComment) Fields could be FixedField.
841           Fixed bug #76705.  CS1569 was incorrectly commented out.
842
843 2005-11-23  Martin Baulig  <martin@ximian.com>
844
845         * generic.cs (Constraints.Define): Removed.
846         (TypeParameter.DefineConstraints): Removed.
847         (TypeParameter.DefineType): Call SetGenericParameterAttributes()
848         on the GenericTypeParameterBuilder here.
849
850 2005-11-23  Martin Baulig  <martin@ximian.com>
851
852         * typemanager.cs (TypeManager.GetProperty): Make this public.
853
854         * generic.cs (Nullable.NullableInfo.ctor): Use
855         TypeManager.GetProperty() rather than using reflection directly.
856
857 2005-11-17  Martin Baulig  <martin@ximian.com>
858
859         * expression.cs (Indexers.GetIndexersForType): Added support for
860         generic parameters; fixes #76587.
861
862 2005-11-17  Martin Baulig  <martin@ximian.com>
863
864         * anonymous.cs
865         (CaptureContext.EmitMethodHostInstance): Use `Ldarg_0' if we
866         inherit the scope from our parent.  Fixes #76653.
867
868 2005-11-15  Martin Baulig  <martin@ximian.com>
869
870         * anonymous.cs (ScopeInfo.ScopeType): New public field; use this
871         instead of `ScopeTypeBuilder' to refer to the "current" type.
872         (AnonymousMethod.CreateScopeType): Correctly create the helper
873         class if we're inside a generic type definition.
874
875 2005-11-14  Atsushi Enomoto  <atsushi@ximian.com>
876
877         * doc.cs : use Invocation.IsOverride() to do real override check.
878         * expression.cs : made Invocation.IsOverride() internal.
879
880 2005-11-14  Atsushi Enomoto  <atsushi@ximian.com>
881
882         * doc.cs : use TypeManager.FindMembers() instead of (possible)
883           TypeBuilder.FindMembers() and filter overriden base members out.
884           Fixed bug #76990.
885
886 2005-11-13  Atsushi Enomoto  <atsushi@ximian.com>
887
888         * doc.cs : ref/out parameters are represented as '@' (instead of
889           '&' in type FullName). Fixed bug #76630 (additionally crefs).
890
891 2005-11-13  Atsushi Enomoto  <atsushi@ximian.com>
892
893         * doc.cs : when there was no '.' in cref to methods in doc comment,
894           then parameters were missing in the output. Fixed bug #76691.
895
896 2005-11-13  Atsushi Enomoto  <atsushi@ximian.com>
897
898         * driver.cs : don't output docs when there is an error.
899           Fixed bug #76693.
900
901 2005-11-13  Atsushi Enomoto  <atsushi@ximian.com>
902
903         * doc.cs :
904           Now it should detect indexers. Fixed primary concern in bug #76685.
905           Fixed CS0419 message to not show the identical member signature in
906           the message.
907
908 2005-11-13  Atsushi Enomoto  <atsushi@ximian.com>
909
910         * doc.cs : (FindDocumentedMember) use TypeManager.MemberLookup()
911           instead of Type.FindMembers() since it does not handle events.
912           Fixed bug #71604.
913
914 2005-11-12  Gert Driesen  <drieseng@users.sourceforge.net>
915
916         * codegen.cs: Fixed typo (speficied -> specified).
917
918 2005-11-11  Marek Safar  <marek.safar@seznam.cz>
919
920         Fix #76369.
921         * doc.cs (FindDocumentedTypeNonArray): Don't resolve again.
922
923 2005-11-11  Marek Safar  <marek.safar@seznam.cz>
924
925         * attribute.cs: Changed error message.
926
927         * cs-tokenizer.cs: One more check.
928
929 2005-11-10  Marek Safar  <marek.safar@seznam.cz>
930
931         * statement.cs (Block.Resolve): Ignore empty statement.
932
933 2005-11-10  Marek Safar  <marek.safar@seznam.cz>
934
935         * report.cs: Made error/warning methods more strict to avoid
936         their misuse.
937
938         * anonymous.cs, attribute.cs, class.cs, codegen.cs, constant.cs,
939         convert.cs, cs-parser.jay, cs-tokenizer.cs, decl.cs, delegate.cs,
940         doc.cs, driver.cs, ecore.cs, expression.cs, location.cs,
941         namespace.cs, parameter.cs, statement.cs, typemanager.cs: Updated.
942
943 2005-11-11  Carlos Alberto Cortez <calberto.cortez@gmail.com>
944
945         * codegen.cs (AssemblyClass.CheckInternalsVisibleAttribute): 
946         Use the more explicit AssemblyName.FullName instead of 
947         AssemblyName.Name to report errors.
948         
949 2005-11-11  Marek Safar  <marek.safar@seznam.cz>
950
951         * attribute.cs, class.cs, cs-tokenizer.cs, parameter.cs: Sync
952         with mcs.
953
954 2005-11-10  Marek Safar  <marek.safar@seznam.cz>
955
956         * class.cs,
957         * convert.cs,
958         * cs-parser.jay,
959         * decl.cs,
960         * enum.cs,
961         * expression.cs,
962         * generic.cs,
963         * pending.cs,
964         * report.cs: Fixed error reporting and typos.
965
966         * generic.cs (TypeParameter.GetSignatureForError): New method.
967         (ConstructedType.GetSignatureForError): Instead of DeclarationName.
968
969         * typemanager.cs (GetFullName): Refactored.
970
971 2005-11-08  Marek Safar  <marek.safar@seznam.cz>
972
973         * attribute.cs (Attribute.GetCoClassAttributeValue): New method.
974         (AttributeTester.GetCoClassAttribute): Get CoClassAttribute.
975
976         * class.cs (TypeContainer.IsComImport): New property.
977         (Constructor.Define): Create proper ctor for ComImport types.
978
979         * expression.cs (New.CheckComImport): Fixed.
980
981 2005-11-07  Miguel de Icaza  <miguel@novell.com>
982
983         * anonymous.cs (CaptureContext.AddParameterToContext): The fact
984         that a parameter has been captured does not mean that we do not
985         have to do the rest of the processing.  This fixes the second part
986         of #76592.  If there was another anonymous method capturing
987         values in the past, the Scope would never be set for the second
988         method that captured the same parameter.
989
990         (CaptureContext.EmitAssignParameter): When `leave_copy' is passed,
991         properly manipulate the stack.   Second part of fix for #76592.
992
993         * expression.cs (New): Add support for invoking "new" on
994         interfaces that have been flagged with the ComImport attribute and
995         the CoClass.  Fixes #76637 
996
997         * statement.cs (Try.DoEmit): When a variable is captured, do not
998         try to emit the vi.LocalBuilder variable as it has been captured.
999         Create a temporary variable and store the results on the
1000         FieldBuilder.  Fixes #76642
1001
1002 2005-11-07  Marek Safar  <marek.safar@seznam.cz>
1003
1004         * class.cs (CheckPairedOperators): Made compilable with csc 2.0.
1005
1006         * ecore.cs (InstanceResolve): Fixed CS1540 detection.
1007
1008         * expression.cs (Binary.DoResolve): Added && optimalization.
1009     
1010         * typemanager.cs (AddUserType): Removed useless argument.
1011
1012 2005-11-04  Marek Safar  <marek.safar@seznam.cz>
1013
1014         * statement.cs (Block.variables): Uses ListDictionary.
1015
1016 2005-11-03  Marek Safar  <marek.safar@seznam.cz>
1017
1018         Fix #75969.
1019         * class.cs (PartialContainer.EmitType): Customized to emit
1020         security attributes.
1021         (ClassPart.ApplyAttributeBuilder): Transform security attribute
1022         for partial classes.
1023
1024 2005-11-03  Marek Safar  <marek.safar@seznam.cz>
1025
1026         Fix #76599.
1027         * expression.cs (ElementAccess.DoResolveLValue): Fixed buffer
1028         access has to be fixed.
1029         
1030         * typemanager.cs (IsUnmanagedType): Wrong common field type.
1031
1032 2005-11-01  Marek Safar  <marek.safar@seznam.cz>
1033
1034         Fix #76590.
1035         * ecore.cs (NullCast.Reduce): Implemented.
1036
1037         * expression.cs (ArrayCreation.CheckIndices): Correcly check
1038         constant type.
1039         
1040         * statement.cs (SwitchLabel.ResolveAndReduce): Catch null
1041         properly.
1042         (Foreach.Resolve): Catch null properly.
1043
1044 2005-10-29  Marek Safar  <marek.safar@seznam.cz>
1045  
1046         * cs-tokenizer.cs: Warning text fix.
1047
1048         * driver.cs: AllWarningNumbers exposed on public interface.
1049
1050         * report.cs (): Reviewed warning numbers.
1051         (IsValidWarning): Use binary search.
1052
1053 2005-10-29  Marek Safar  <marek.safar@seznam.cz>
1054  
1055         * driver.cs: Implemeted resource visibility.
1056         (Resources): New class for code sharing between /res: and
1057         /linkres:
1058  
1059 2005-11-07  Marek Safar  <marek.safar@seznam.cz>
1060
1061         decl.cs (CurrentTypeParameters): Fixed to be public.
1062
1063 2005-11-07  Marek Safar  <marek.safar@seznam.cz>
1064
1065         generic.cs, rootcontext.cs: Removed NewConstraintAttribute.
1066
1067 2005-11-07  Marek Safar  <marek.safar@seznam.cz>
1068
1069         gmcs.exe.sources: Use CryptoConvert.cs from corlib.
1070
1071 2005-11-05  Kornél Pál  <kornelpal@hotmail.com>
1072
1073         * gmcs.exe.config: Updated runtime version to v2.0.50727 (2.0 RTM).
1074
1075 2005-11-04  Carlos Alberto Cortez <calberto.cortez@gmail.com>
1076
1077         Add friend assembly access support.
1078         * typemanager.cs: assembly_internals_vis_attrs
1079         cache for friend assembly access. 
1080         (TypeManager.IsFriendAssembly): New method for
1081         checking friend assembly access.
1082         (TypeManager.Error_FriendAccessNameNotMatching): New
1083         helper method.
1084         (TypeManager.CompareKeyTokens): Likewise.
1085         (TypeManager.Filter): Handle friend accessible
1086         members.
1087
1088         * namespace.cs (RootNamespace.GetTypeInAssembly): Return
1089         friend accessible types.
1090
1091         * ecore.cs (Expression.IsAccessorAccessible): Handle
1092         friend accessible properties.
1093
1094         * decl.cs (DeclSpace.CheckAccessLevel): Handle friend
1095         accessible types.
1096         
1097 2005-10-28  Marek Safar  <marek.safar@seznam.cz>
1098
1099         Fix #76568.
1100         * cfold.cs (ConstantFold.BinaryFold): Implemented null cast
1101         folding.
1102         
1103         * convert (Convert.ImplicitReferenceConversion): NullCast holds
1104         contants only.
1105         
1106         * ecore.cs (NullCast): Child is contant only.
1107         
1108         * literal.cs (NullLiteral.Reduce): null can be converted to any
1109         reference type.
1110
1111 2005-10-28  Kornél Pál  <kornelpal@hotmail.com>
1112
1113         * driver.cs: Use Encoding.Default as default code page instead
1114           of ISO-28591.
1115
1116 2005-10-27  Raja R Harinath  <rharinath@novell.com>
1117
1118         Fix #76085.
1119         * expression.cs (Invocation.Error_InvalidArguments): Handle
1120         __arglist parameters.
1121         (Invocation.VerifyArgumentsCompat): Likewise.
1122         * support.cs (ReflectionParameters.GetSignatureForError): Print
1123         __arglist parameters.
1124         (InternalParamters.GetSignatureForError): Likewise.
1125         * parameter.cs (Parameters.GetSignatureForError): Likewise.
1126
1127 2005-10-26  Marek Safar  <marek.safar@seznam.cz>
1128
1129         * attribute.cs (GetPropertyValue): Made public.
1130
1131         * codegen.cs (AssemblyClass): ResolveClsCompliance renamed to
1132         Resolve.
1133         Add new property WrapNonExceptionThrows to handle 2.0 assembly
1134         attribute.
1135         (AssemblyClass.Emit): Emit RuntimeCompatibilityAttribute when it
1136         is not defined.
1137         
1138         * driver.cs: Reflect method name change.
1139         
1140         * statement.cs (Try.Resolve): Warn when try has both general
1141         exception handlers.
1142         
1143         * typemanager.cs: runtime_compatibility_attr_type new predefined
1144         type.
1145
1146 2005-10-26  Raja R Harinath  <harinath@gmail.com>
1147
1148         Fix #76419.
1149         * pending.cs (InterfaceMethod): Allow tm.args [i] to be null --
1150         treat it as an empty parameter list.
1151
1152 2005-10-26  Raja R Harinath  <rharinath@novell.com>
1153
1154         Fix #76271.     
1155         * ecore.cs (SimpleName.DoSimpleNameResolve): Make fall-back 
1156         ResolveAsTypeStep silent.
1157         * statement.cs (Block.AddConstant): Mark block as used.
1158         (Block.ResolveMeta): Avoid piling on error messages
1159         if a constant initializer resolution fails.
1160
1161 2005-10-25  Raja R Harinath  <rharinath@novell.com>
1162
1163         * namespace.cs (RootNamespace.VerifyUsingForAll, Namespace.VerifyUsing):
1164         Remove.
1165         (NamespaceEntry.VerifyAllUsing): New.
1166         (NamespaceEntry.AliasEntry.Resolve): New.  Handles common error
1167         behaviour.  Delegates actual resolution of alias to ...
1168         (NamespaceEntry.DoResolve): ... this.  Renamed from Resolve.
1169         (NamespaceEntry.LocalAliasEntry, NamespaceEntry.ExternAliasEntry):
1170         Update.
1171         * driver.cs (Driver.MainDriver): Update.
1172         
1173         * namespace.cs (NamespaceEntry.DefineNamespace): Remove.
1174         (NamespaceEntry.SymbolFileID): Make into a on-demand computed
1175         property.
1176         (Namespace.DefineNamespaces, RootNamespace.DefineNamespacesForAll):
1177         Remove.
1178         * symbolwriter.cs (SymbolWriter.Initialize): Don't call
1179         RootNamespace.DefineNamespacesForAll.
1180
1181 2005-10-24  Raja R Harinath  <harinath@gmail.com>
1182
1183         * typemanager.cs (assemblies, external_aliases, modules)
1184         (AddAssembly, AddExternAlias, AddModule GetAssemblies, Modules)
1185         (ComputeNamespaces, GetRootNamespace): Remove extra staging
1186         overhead.  Move resposibility ...
1187         * namespace.cs (GlobalRootNamespace): ... here.  Update to changes.
1188         * driver.cs, attribute.cs, codegen.cs: Update to changes.
1189
1190 2005-10-23  Raja R Harinath  <harinath@gmail.com>
1191
1192         * namespace.cs (RootNamespace.all_namespaces): Renamed from
1193         cached_namespaces.  Improve usage.
1194         (RootNamespace.Reset, RootNamespace.RegisterNamespace)
1195         (RootNamespace.VerifyUsingForAll, RootNamespace.DefineNamespacesForAll):
1196         Move from GlobalRootNamespace and simplify.
1197         (RootNamespace.Global): Make instance variable.
1198         (RootNamespace.RootNamespace): Add "alias name" parameter.
1199         (GlobalRootNamespace): Simplify drastically.
1200         (Namespace.Lookup): Don't use GetNamespace.
1201         * typemanager.cs (GetRootNamespace): Rename from
1202         ComputeNamespaceForAlias.
1203         (NamespaceClash): Use Global.IsNamespace instead of GetNamespace.
1204
1205 2005-10-23  Marek Safar  <marek.safar@seznam.cz>
1206
1207         * anonymous.cs (AnonymousContainer): Don't crash when container
1208         doesn't exist.
1209
1210 2005-10-23  Marek Safar  <marek.safar@seznam.cz>
1211
1212         * expression.cs (Binary.DoResolve): Warn when comparing same
1213         values.
1214
1215 2005-10-23  Marek Safar  <marek.safar@seznam.cz>
1216
1217         Fix #76486.
1218         * expression.cs (Binary.DoResolve): It looks like there are no
1219         convetsion rules in enum context.
1220
1221 2005-10-19  Carlos Alberto Cortez <calberto.cortez@gmail.com>
1222
1223         Add support for extern alias qualifiers.
1224         * typemanager.cs: Move some LookupTypeReflection code
1225         to namespace.cs, to have cleaner code. Added some methods
1226         to help us keep track of the extern aliased references.
1227         * driver.cs: Add suport for extern alias assemblies on command
1228         line and check for their warnings/errors. Also keep track of the
1229         extern aliased assemblies.
1230         * namespace.cs: Move the global functionality of Namespace
1231         to GlobalRootNamespace/RootNamespace. Now the global namespace
1232         is GlobalRootNamespace.Globa. Also the code moved from 
1233         typemanager.cs lives in GlobalRootNames.cs/RootNamespace.cs. 
1234         Finally added LocalAliasEntry (AliasEntry before) and
1235         ExternAliasEntry, to handle alias statements.
1236         * cs-parser.jay: Add support in the grammar for extern alias
1237         statement.
1238         * doc.cs, delegate.cs, expression.cs ecore.cs, symbolwriter.cs: 
1239         Update callings to Namespace (now in GlobalRootNamespace).
1240
1241 2005-10-25  Martin Baulig  <martin@ximian.com>
1242
1243         * convert.cs (ImplicitTypeParameterConversion): Make base
1244         interfaces actually work; fixes #76557.
1245
1246 2005-10-25  Martin Baulig  <martin@ximian.com>
1247
1248         * generic.cs
1249         (GenericMethod.Define): Call TypeParameter.DefineConstraints() on
1250         all the type parameters; fixes #76551.
1251
1252 2005-10-25  Martin Baulig  <martin@ximian.com>
1253
1254         Fix #76472.
1255
1256         * generic.cs
1257         (GenericMethod.ctor): Added `Expression return_type' and
1258         `Parameters parameters' arguments.
1259         (GenericMethod.DefineType): Call ResolveAsTypeTerminal() on the
1260         parameter and return types to check their constraints if they're
1261         generic types.
1262
1263         * codegen.cs (EmitContext.ResolvingGenericMethod): New public
1264         boolean field.
1265
1266         * ecore.cs (Expression.ResolveAsTypeTerminal): Don't check the
1267         constraints of a generic type if `ec.ResolvingGenericMethod'.
1268
1269         * class.cs (MethodCore.DoDefineParameters): Set
1270         `ec.ResolvingGenericMethod' if we're a generic method.
1271         (MemberBase.MemberType): Likewise.
1272
1273 2005-10-25  Carlos Alberto Cortez <calberto.cortez@gmail.com>
1274
1275         * typemanager.cs (TypeManager): Added 
1276         TypeManager.internals_visible_attr_type to cache
1277         S.R.CompilerServices.InternalsVisibleToAttribute.
1278
1279         * codegen.cs (AssemblyClass): Added checks for 
1280         InternalsVisibleToAttribute in new method 
1281         CheckInternalsVisibleAttribute () and also cache the
1282         AssemblyName in AssemblyClass.Name.
1283         
1284 2005-10-24  Martin Baulig  <martin@ximian.com>
1285
1286         * typemanager.cs
1287         (TypeManager.ExpandInterfaces): Added overloaded version which
1288         just takes a `Type[]' array.
1289
1290         * generic.cs
1291         (Constraints.Resolve): Don't expand the interfaces here; ie. we
1292         just use the interfaces which were explicitly specified and not
1293         the interfaces they inherit.  Fixes #76482.
1294         (TypeParameter.FindMembers): Expand the interfaces here.
1295
1296 2005-10-21  Martin Baulig  <martin@ximian.com>
1297
1298         * generic.cs
1299         (Constraints.Resolve): Also resolve the actual types here.
1300         (Constraints.ResolveTypes): Just check the constraints here.
1301         Fixes #76363; see gtest-218.cs.
1302
1303 2005-10-21  Martin Baulig  <martin@ximian.com>
1304
1305         * convert.cs
1306         (Convert.ImplicitTypeParameterConversion): Use a `ClassCast'
1307         instead of a `BoxedCast'; fixes gtest-217.cs.
1308
1309 2005-10-20  Atsushi Enomoto  <atsushi@ximian.com>
1310
1311         * generic.cs : (ConstructedType.CheckConstraints) warn CS0310 when
1312           1) "new()" is specified as generic parameter constraint and 2) the
1313           type is TypeBuilder and 3) the type is abstract even if it has a
1314           default .ctor(). Now errors/gcs0310-3.cs is correctly rejected.
1315
1316 2005-10-20  Martin Baulig  <martin@ximian.com>
1317
1318         * generic.cs
1319         (GenericConstraints.TypeParameter): New public property.
1320         (TypeParameter.ctor): Also take a `DeclSpace' argument.
1321         (TypeParameter.DeclSpace): New public property.
1322         (TypeParameter.DefineType): Inflate the constraints if our
1323         `DeclSpace' is an `Iterator'.   
1324
1325 2005-10-19  Atsushi Enomoto  <atsushi@ximian.com>
1326
1327         * class.cs, decl.cs : (MemberCache.FindMemberToOverride) added 
1328           GenericMethod argument to compare methods' generic type arguments.
1329           Fixed bug #76382.
1330
1331 2005-10-19  Martin Baulig  <martin@ximian.com>
1332
1333         * class.cs (TypeContainer.DefineType): Only use ResolveAsTypeStep(),
1334         not ResolveType() when resolving the base type, so we're not
1335         checking the constraints here.
1336         (TypeContainer.ResolveType): Call ResolveType() on our base_type
1337         if we have any.
1338
1339 2005-10-19  Martin Baulig  <martin@ximian.com>
1340
1341         * generic.cs (ConstructedType.CheckConstraints): Committing
1342         untested fix for #76441.
1343
1344 2005-10-18  Raja R Harinath  <rharinath@novell.com>
1345
1346         Fix #76371.
1347         * class.cs (TypeContainer.DefineType): Move updating of
1348         topological sort earlier in the code.
1349         * decl.cs (DeclSpace.ResolveBaseTypeExpr): Don't use TypeBuilder.
1350
1351 2005-10-18  Marek Safar  <marek.safar@seznam.cz>
1352
1353         Fix #76273.
1354         * cfold.cs (BinaryFold): Reduce constant in enum conversion.
1355         
1356         * constant.cs (Constant.TryReduce): Moved from Cast class.
1357         (Reduce): Made little bit more OO and fixed missing conversions.
1358         
1359         * ecore.cs (Reduce): Implemented.
1360         (Binary.EnumLiftUp): New method to upgrade values to enum values.
1361         
1362         * literal.cs (Reduce): Implemented.
1363         
1364         * class.cs: Reverted Miguel's wrong commit.
1365
1366 2005-10-14  Miguel de Icaza  <miguel@novell.com>
1367
1368         * ecore.cs (GetMemberType): Report the correct mapping for the MemberCore
1369
1370 2005-10-14  Atsushi Enomoto  <atsushi@ximian.com>
1371
1372         * cs-parser.jay, expression.cs : CS0214 was missing error location
1373           for constants. Fixed bug #76404.
1374
1375 2005-10-10  Raja R Harinath  <rharinath@novell.com>
1376
1377         * ecore.cs (PropertyExpr.Emit): Use Invocation.EmitCall to emit
1378         InstanceExpression.
1379         (PropertyExpr.EmitCall): Likewise.
1380         * expression.cs (Invocation.EmitArguments): Handle case where
1381         arguments == null.
1382         (Invocation.EmitCall): Avoid allocating temporary variable if
1383         there are no arguments.
1384
1385 2005-10-11  Marek Safar  <marek.safar@seznam.cz>
1386
1387         Fix #76370.
1388         * convert.cs (ExplicitConversionCore): Fixed object->enum
1389         conversion.
1390
1391 2005-10-07  Raja R Harinath  <rharinath@novell.com>
1392
1393         Fix #76323.
1394         * convert.cs (ImplicitConversionStandard): Move conversion of
1395         void* to arbitrary pointer types ...
1396         (ExplicitConversionStandard): .. here.
1397         * ecore.cs (Expression.Error_ValueCannotBeConverted): Fix CS0266
1398         error to always print typenames.
1399
1400 2005-10-07  Raja R Harinath  <rharinath@novell.com>
1401
1402         * convert.cs (GetConversionOperator): Rename from
1403         GetConversionOperators.  Move operator selection code from ...
1404         (UserDefinedConversion): ... here.
1405
1406 2005-10-06  Marek Safar  <marek.safar@seznam.cz>
1407
1408         * convert.cs (ExplicitConversionCore): Removed duplicate enum
1409         conversion.
1410
1411 2005-10-05  Marek Safar  <marek.safar@seznam.cz>
1412
1413         * assign.cs (Assign.DoResolve): Error method changed.
1414
1415         * cfold.cs (DoConstantNumericPromotions): Error method changed.
1416         
1417         * const.cs (ResolveValue): Reset in_transit immediately.
1418         
1419         * constant.cs: Error method changed.
1420         
1421         * convert.cs: Removed useless location parameter.
1422         (ExplicitNumericConversion): Don't do double enum check.
1423         (ExplicitConversionCore): Renamed from ExplicitConversion.
1424         (ExplicitUnsafe): Extracted from ExplicitConversion.
1425         (ExplicitConversion): Uses for error reporting.
1426         
1427         * ecore.cs (Error_ValueCannotBeConverted): More logic for more
1428         error messages.
1429         (ResolveBoolean): Uses common error method.
1430         (CastToDecimal): Get rid of ec.
1431         (CastFromDecimal): Optimized.
1432         (ConvCast): Get rid of ec.
1433         
1434         * enum.cs (ResolveValue): Reset in_transit immediately.
1435         (Emit): Return after first error.
1436         
1437         * expression.cs: Convert changes.
1438         
1439         * literal.cs: Error method changed.
1440         
1441         * statement.cs: Error method changed.
1442
1443 2005-10-06  Raja R Harinath  <rharinath@novell.com>
1444
1445         Fix gtest-131.cs and gtest-211.cs.
1446         * generic.cs (Nullable.LiftedBinaryOperator.EmitEquality):
1447         Only emit code for a label if it is used.  Unreachable code can
1448         violate ECMA evaluation stack invariants.
1449
1450 2005-09-27  Marek Safar  <marek.safar@seznam.cz>
1451
1452         * anonymous.cs: Implemented ExprClassName.
1453         
1454         * assign.cs (Assign.DoResolve): Don't chrash when type is not
1455         delegate.
1456         
1457         * attribute.cs (ResolveArguments): Enabled MethodImplOptions
1458         check.
1459         
1460         * class.cs (StaticClass.DefineContainerMembers): Report protected
1461         members as error.
1462         
1463         * codegen.cs: if(ed) PRODUCTION.
1464         
1465         * convert.cs (Error_CannotImplicitConversion): Better error
1466         distinction.
1467         
1468         * cs-parser.jay: More error checks.
1469         
1470         * cs-tokenizer.cs (consume_identifier): Fixed Miguel's revert.
1471         
1472         * driver.cs (CSCParseOption): Enabled wrong option check.
1473         
1474         * ecore.cs (Expression.ExprClassName): Turned to property.
1475         (MemberExpr.CheckIntermediateModification): For checking boxed
1476         value types     modification.
1477         
1478         * statement.cs (Fixed.Resolve): Expression type must be
1479         convertible to fixed type.
1480         (CollectionForeach.GetEnumeratorFilter,TryType):
1481         Small refactoring for easier error checking.
1482
1483 2005-09-26  Marek Safar  <marek.safar@seznam.cz>
1484
1485         * attribute.cs (Attribute.Resolve): Check Obsolete attribute for
1486         attributes.
1487         
1488         * class.cs (GeneratedBaseInitializer): New class for customization
1489         compiler generated initializers.
1490         (MemberBase.DoDefine): Check Obsolete attribute here.
1491         (FieldMember.DoDefine): Ditto.
1492         
1493         * const.cs (ExternalConstant.CreateDecimal): Builder for decimal
1494         constants.
1495         
1496         * decl.cs (MemberCore.EmitContext): Returns valid current ec.
1497         (MemberCore.GetObsoleteAttribute): Removed argument.
1498         (MemberCore.CheckObsoleteness): Obsolete attributes are hierarchic.
1499         (MemberCore.CheckObsoleteType): New helper.
1500         
1501         * delegate.cs,
1502         * enum.cs,
1503         * statement.cs: Updates after MemberCore changes.
1504         
1505         * ecore.cs (TypeExpr.ResolveType): Check type obsoleteness here.
1506         (FieldExpr.ResolveMemberAccess): Fixed decimal constants checks.
1507         
1508         * expression.cs (ComposedCast.DoResolveAsTypeStep): Don't check
1509         obsolete attribute for compiler construct.
1510         (As.DoResolve): Cache result.
1511         
1512         * iterators.cs (Define_Constructor): Use GeneratedBaseInitializer.
1513
1514 2005-10-01  Miguel de Icaza  <miguel@novell.com>
1515
1516         * expression.cs (Probe): instead of having a "Type probe_type"
1517         keep the extra information as a TypeExpr probe_type_expr since the
1518         "As" operator needs to perform some type checks.
1519
1520         * (As.DoResolve): If the type is a type parameter, ensure that it
1521         is constrained by a class.
1522
1523 2005-09-22  Miguel de Icaza  <miguel@novell.com>
1524
1525         * statement.cs (Lock): Use the TemporaryVariable class instead of
1526         manually using local variables as those do not work when variables
1527         are captured.
1528
1529         * ecore.cs: Moved the TemporaryVariable class from being a nested
1530         class inside Foreach to be a public class that can be employed in
1531         other places. 
1532
1533 2005-09-19  Marek Safar  <marek.safar@seznam.cz>
1534
1535         * cs-parser.jay: interface_accessors replaced by
1536         accessor_declarations.
1537
1538         * ecore.cs, literal.cs, statement.cs: NullLiteral holds null
1539         location.
1540         
1541         * statement.cs (GotoCase.Resolve): Convert null constant to
1542         null case.
1543         (SwitchLabel.ResolveAndReduce): Ditto.
1544         (SwitchLabel.NullStringCase): Custom null stamp.
1545         (Switch.SimpleSwitchEmit): Fix from NullLiteral to NullStringCase.
1546         
1547         typemanager.cs (CSharpSignature): Don't skip first argument
1548         for full names.
1549
1550 2005-09-16  Marek Safar  <marek.safar@seznam.cz>
1551
1552         * cfold.cs, constant.cs, convert.cs, ecore.cs,
1553         expression.cs, iterators.cs, literal.cs: Store constants and
1554         literals location.
1555         
1556         * class.cs (MemberBase.ShortName): Pass location.
1557         
1558         * cs-parser.jay: Some location fixes.
1559         
1560         * ecore.cs (Expression.Location): Made virtual.
1561
1562 2005-09-27  Marek Safar  <marek.safar@seznam.cz>
1563
1564         Fix #72930.
1565         * const.cs (Const.ResolveValue): Check for assigning non-null
1566         value to reference type.
1567
1568 2005-09-26  Raja R Harinath  <rharinath@novell.com>
1569
1570         Fix #76133.
1571         * expression.cs (This.VerifyFixed): In a value type T, the type of
1572         'this' is T&, iow, 'this' is either an out or ref parameter.  In a
1573         value type R, 'this' is treated as a value parameter.
1574
1575 2005-09-05  Miguel de Icaza  <miguel@novell.com>
1576
1577         * expression.cs (Cast.TryReduce): Only reduce to an EnumConstant
1578         if the underlying types are the same, otherwise we need to produce
1579         code that will do the proper cast.
1580
1581         This was exposed by Marek's constant rewrite which produced
1582         invalid code for the call site:
1583
1584         enum X : long { a }
1585         void Method (X v) {}
1586
1587         Method ((X) 5)
1588
1589         This fixes test-49.cs
1590
1591 2005-09-05  Atsushi Enomoto  <atsushi@ximian.com>
1592
1593         * attribute.cs : (Attribute.IsValidArgumentType): array of string/
1594           Type/Object should be allowed as well. Fixed bug #75968.
1595
1596 2005-09-05  Atsushi Enomoto  <atsushi@ximian.com>
1597
1598         * expression.cs : (Binary.DoResolve): when one is enum constant and
1599           another is constant 0, then return enum one *as enum type*.
1600           Fixed bug 74846.
1601
1602 2005-10-04  Martin Baulig  <martin@ximian.com>
1603
1604         * ecore.cs (PropertyExpr.ResolveAccessors): Cosmetic fix; make the
1605         `SetMemberIsUsed()' work for generics, too.
1606
1607 2005-10-04  Martin Baulig  <martin@ximian.com>
1608
1609         * expression.cs (DelegateInvocation.EmitStatement): Make this work
1610         for corlib.  Fixes #75691.
1611
1612 2005-09-28  Marek Safar  <marek.safar@seznam.cz>
1613
1614         Fix #76255.
1615         * driver.cs: Fix compilation files with full root path.
1616
1617 2005-09-25  Miguel de Icaza  <miguel@novell.com>
1618
1619         * report.cs (SymbolRelatedToPreviousError): Format the output so
1620         it does not use an open parenthesis that is never closed. 
1621
1622         * driver.cs: Follow coding guidelines
1623
1624 2005-09-18  Miguel de Icaza  <miguel@novell.com>
1625
1626         * driver.cs: Set InEmacs based on the environment variable EMACS. 
1627
1628         * location.cs (InEmacs): in this mode, do not report column
1629         location as it confuses Emacs.
1630
1631 2005-10-03  Raja R Harinath  <rharinath@novell.com>
1632
1633         * support.cs (SeekableStreamReader.Position): Don't error out when
1634         the requested position is just beyond the end of the current
1635         buffered data.
1636
1637 2005-09-28  Raja R Harinath  <rharinath@novell.com>
1638
1639         * support.cs (SeekableStreamReader): Simplify drastically.  Don't
1640         try to keep in sync with the byte count of the underlying Stream.
1641         However, this limits us to a window size of 2048 characters: i.e.,
1642         the maximum lookahead of our lexer/parser can be 2048 characters.
1643
1644 2005-09-22  Martin Baulig  <martin@ximian.com>
1645
1646         * driver.cs: Removed a debugging FIXME.
1647
1648 2005-09-21  Raja R Harinath  <rharinath@novell.com>
1649
1650         * cs-parser.jay (type_arguments): Add CS1644 check.
1651         * decl.cs (DeclSpace.AddToContainer): Restore CS0694 check.
1652
1653 2005-09-15  Raja R Harinath  <rharinath@novell.com>
1654
1655         * Makefile (PROGRAM): Make profile specific.
1656         (gmcs.exe) [PROFILE=net_2_0]: Add utility rule to copy gmcs.exe to
1657         the current directory.
1658
1659         Fix test-455.cs.
1660         * expression.cs (Invocation.EmitCall): Remove optimization on
1661         this_call since it doesn't handle 'this' being a value type.
1662
1663 2005-09-05  Geoff Norton  <gnorton@customerdna.com>
1664
1665         * driver.cs: Ensure file handles are closed after parsing
1666
1667 2005-09-05  Miguel de Icaza  <miguel@novell.com>
1668
1669         * expression.cs (Cast.TryReduce): Only reduce to an EnumConstant
1670         if the underlying types are the same, otherwise we need to produce
1671         code that will do the proper cast.
1672
1673         This was exposed by Marek's constant rewrite which produced
1674         invalid code for the call site:
1675
1676         enum X : long { a }
1677         void Method (X v) {}
1678
1679         Method ((X) 5)
1680
1681         This fixes test-49.cs
1682
1683 2005-09-05  Martin Baulig  <martin@ximian.com>
1684
1685         * expression.cs (As.DoResolve): Use `probe_type.IsValueType'
1686         instead of `TypeManager.IsValueType (probe_type)'; fixes #75668.
1687
1688         * cs-parser.jay (delegate_declaration): Small fix for #75852.
1689
1690 2005-09-05  Atsushi Enomoto  <atsushi@ximian.com>
1691
1692         * typemanager.cs: (IsUnmanagedType) : generic parameter is not allowed
1693           to be a pointer type due to the spec 25.2, so check if declaring
1694           type is generic type definition. Fixed bug #75772.
1695
1696 2005-09-05  Atsushi Enomoto  <atsushi@ximian.com>
1697
1698         Fixed bug #75957.
1699         * generic.cs : (TypeManager.IsEqual(Type,Type)): it should work when
1700           both types are not defined by methods.
1701         * expression.cs : (Invocation.IsApplicable): it should work when
1702           the argument type is equal to the parameter type, not only when
1703           ImplicitConversionExists() returns true.
1704
1705 2005-09-02  Raja R Harinath  <rharinath@novell.com>
1706
1707         * attribute.cs (GetMarshal): Work even if "DefineCustom" is
1708         internal.
1709
1710         Fix #75941.
1711         * ecore.cs (SimpleNameResolve.DoSimpleNameResolve): Disable
1712         flow-branching for LocalVariableReferences in case we were invoked
1713         from a MemberAccess.
1714         * expression.cs (LocalVariableReference.VerifyAssigned): New.
1715         Carved out of ...
1716         (LocalVariableReference.DoResolveBase): ... this.
1717         (MemberAccess.Resolve): Do the check that was disabled during
1718         SimpleNameResolve.
1719
1720 2005-09-01  Atsushi Enomoto  <atsushi@ximian.com>
1721
1722         * class.cs :
1723           (PartialContainer.Create): check abstract/sealed/static strictly
1724           but abstract/sealed can exist only at one side. Fixed bug #75883.
1725
1726 2005-09-01  Kornél Pál  <kornelpal@hotmail.com>
1727
1728         Fix #75945.
1729         * attribute.cs (Attribute.GetMarshal): If ArraySubType is not
1730         specified, don't default to UnmanagedType.I4.
1731
1732 2005-09-01  Atsushi Enomoto  <atsushi@ximian.com>
1733
1734         * expression.cs : conditional operator should check possibly
1735           incorrect assign expression. Fixed bug #75946.
1736
1737 2005-08-30  Raja R Harinath  <rharinath@novell.com>
1738
1739         Fix #75934.
1740         * anonymous.cs (ScopeInfo.MakeFieldName): New helper.
1741         (ScopeInfo.EmitScopeType): Use it to construct field names from
1742         names of captured locals.
1743
1744         Fix #75929.
1745         * ecore.cs (BoxedCast.BoxedCast) [1-argument variant]: Remove.
1746         * convert.cs (ImplicitReferenceConversion, TryImplicitIntConversion):
1747         Pass 'target_type' to BoxedCast.  Don't default to 'object'.
1748         (ExplicitConversion): Remove enum cases already handled by
1749         implicit conversion.  Move implicit conversion check to the beginning.
1750         * delegate.cs (DelegateCreation.ResolveMethodGroupExpr): Update.
1751         * expression.cs (ArrayCreation.EmitDynamicInitializers):
1752         Don't treat System.Enum as a struct.
1753
1754 2005-08-30  Jb Evain  <jbevain@gmail.com>
1755
1756         * attribute.cs: handles as expression in parameters.
1757
1758 2005-08-30  Raja R Harinath  <rharinath@novell.com>
1759
1760         Fix #75802.
1761         * class.cs (TypeContainer.VerifyClsName): Don't use a
1762         PartialContainer when verifying CLS compliance.
1763         (AbstractPropertyEventMethod): Set Parent here, ...
1764         (PropertyMethod): ... not here.
1765
1766 2005-08-30  Atsushi Enomoto  <atsushi@ximian.com>
1767
1768         * attribute.cs : escaped attribute name should not be allowed to be
1769           resolved (e.g. @class as classAttribute). Fixed bug #75930.
1770
1771 2005-08-29  Raja R Harinath  <rharinath@novell.com>
1772
1773         Fix #75927.
1774         * convert.cs (ImplicitStandardConversionExists): Allow zero also
1775         when converting a long constant to unsigned long.
1776         * expression.cs (Invocation.OverloadResolve): Add sanity check to
1777         detect where IsApplicable and VerifyArgumentsCompat disagree.
1778
1779 2005-08-29  Raja R Harinath  <rharinath@novell.com>
1780         and Carlos Alberto Cortez  <carlos@unixmexico.org>
1781
1782         Fix #75848.
1783         * class.cs (TypeContainer.CanElideInitializer): New helper.
1784         (TypeContainer.EmitFieldInitializers): Use it to determine if we
1785         can safely emitting the initializer of a field.
1786
1787 2005-08-25  Atsushi Enomoto  <atsushi@ximian.com>
1788
1789         * statement.cs : (Continue.Resolve()) Unlike break, continue is not
1790           allowed inside a switch (without loop). Fixed bug #75433.
1791
1792 2005-08-26  Kornél Pál  <kornelpal@hotmail.com>
1793
1794         * AssemblyInfo.cs: Using Consts.MonoVersion instead of MonoVersion.cs.
1795         * mcs.exe.sources: Using Consts.MonoVersion instead of MonoVersion.cs.
1796
1797 2005-08-25  Atsushi Enomoto  <atsushi@ximian.com>
1798
1799         * driver.cs : kinda reverting the default encoding changes (not exact 
1800           revert since I noticed that "codepage:reset" might not work fine).
1801
1802 2005-08-25  Atsushi Enomoto  <atsushi@ximian.com>
1803
1804         * class.cs : (AbstractPropertyEventMethod) SetupName() now takes
1805           Location. Now getter and setter store location correctly.
1806           (errors/cs0111-12.cs now reports the expected location.)
1807
1808 2005-08-25  Atsushi Enomoto  <atsushi@ximian.com>
1809
1810         * driver.cs : Use default encoding on the environment.
1811           Removed (now that) extra parameter for SeekableStreamReader.
1812         * support.cs : (SeekableStreamReader) third .ctor() argument for
1813           StreamReader is not required (always true). preamble size could
1814           be acquired in simpler and safe way.
1815
1816 2005-08-24  Atsushi Enomoto  <atsushi@ximian.com>
1817
1818         * cs-parser.jay: report CS0642 at warning level 3
1819           and report CS0642 for an if else statement also
1820           fixes bug #74745. Patch by John Luke (and a bit
1821           modified by me).
1822           Removed extra CS0642 warning check for "while",
1823           "for" and "fixed".
1824         * statement.cs: In Block.Resolve(), CS0642 check
1825           is reimplemented to check a sequence of an empty
1826           statement and a block.
1827
1828           Both fix bug #66777.
1829
1830 2005-08-24  Marek Safar  <marek.safar@seznam.cz>
1831
1832         * attribute.cs (GetMethodObsoleteAttribute): Disabled obsolete properties
1833         detection until I fix it.
1834         
1835         * cs-tokenizer.cs: Changed error message.
1836         
1837         * cs-parser.jay: Fixed 2 error locations.
1838         
1839         * ecore.cs (Error_TypeDoesNotContainDefinition): Share error message.
1840         (PropertyExpr.Error_PropertyNotFound): First attempt to detect non C#
1841         properties.
1842         
1843         * enum.cs (GetSignatureForError): Fixed.
1844         
1845         * expression.cs (Invocation.IsSpecialMethodInvocation): Improved special
1846         method detection.
1847         
1848         * class.cs,
1849         * typemanager.cs (RegisterProperty): Removed.
1850         
1851         * statement.cs (CheckInvariantMeaningInBlock): Changed error message.
1852
1853 2005-08-24  Raja R Harinath  <rharinath@novell.com>
1854
1855         Fix #75874.
1856         * expression.cs (ArrayAccess.EmitLoadOpcode): Emit ldelem.i for pointers.
1857         (ArrayAccess.GetStoreOpcode): Return stelem.i for pointers.
1858
1859 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
1860
1861         * expression.cs : tiny fix is required for not warning positive ulong.
1862           See test-441.cs.
1863
1864 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
1865
1866         * expression.cs : add CS0652 check for constant and integral
1867           expression. Fixed bug #53974.
1868
1869 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
1870
1871         * expression.cs : in DoNumericPromotions(), check if there is implicit
1872           conversion overload for string (to check CS0034). Fixed bug #52492.
1873
1874 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
1875
1876         * cs-tokenizer.cs : Check newline in char constant. Fixed bug #75245.
1877
1878 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
1879
1880         * ecore.cs : report location when it is *not* Null.
1881
1882 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
1883
1884         * codegen.cs,
1885           ecore.cs,
1886           flowanalysis.cs,
1887           expression.cs:
1888           Added OmitStructFlowAnalysis to EmitContext to handle CS0165 check
1889           correctly. Fixed bug #75721.
1890
1891 2005-08-23  Raja R Harinath  <rharinath@novell.com>
1892
1893         * support.cs (SeekableStreamReader.Position): Avoid an expensive
1894         loop that performs 'min (pos, char_count)'.
1895
1896         Fix #75862.
1897         * expression.cs (Unary.ResolveOperator): Don't discard implicit
1898         converted value in Operator.OnesComplement.
1899
1900 2005-08-22  Ben Maurer  <bmaurer@ximian.com>
1901
1902         * anonymous.cs: If the anon method is pulled into a helper class,
1903         it needs to be `internal' not `private'. Fixes runtime behavior on
1904         msft. bug #75704
1905
1906 2005-08-17  Marek Safar  <marek.safar@seznam.cz>
1907
1908         Fix #75803
1909         * decl.cs (DeclSpace.VerifyClsCompliance): Skip when collision object
1910         is a partial class.
1911
1912 2005-08-16  Marek Safar  <marek.safar@seznam.cz>
1913
1914         The big constants rewrite
1915         Fix #75746, #75685 and more
1916         As a side effect saved 1MB for MWF ;-)
1917         
1918         * attribute.cs (GetAttributeArgumentExpression): Use ToType, GetTypedValue.
1919         (GetMarshal, GetMethodImplOptions, GetLayoutKindValue): Values are not
1920         enum based for corlib compilation.
1921         
1922         * cfold.cs (BinaryFold): Convert operand for enum additions. Fixed enum
1923         subtractions.
1924         
1925         * class.cs (FixedField.Define): Use ResolveAsConstant.
1926         
1927         * const.cs (IConstant): Interface constants and enums.
1928         (Const.ResolveValue): New method for constant resolvning.
1929         (ExternalConstant): Constants from imported assemblies.
1930         
1931         * constant.cs (Constant.GetTypedValue): Used to get constant with forced
1932         conversion; like enums.
1933         (Constant.ToType): Converts this constant to different type.
1934         (Constant.Increment): Adds 1.
1935         
1936         * convert.cs (ImplicitConversionRequired): Simplified.
1937         
1938         * cs-parser.jay: Create EnumMember directly.
1939         
1940         * decl.cs (MemberCore.CheckObsoleteness): Checks for ObsoleteAttribute presence.
1941         
1942         * doc.cs (GenerateEnumDocComment): Removed.
1943         
1944         * ecore.cs (Expression.ResolveAsConstant): New constant specific method.
1945         (ConvertIntLiteral): Removed.
1946         (FieldExpr.ResolveMemberAccess): Refactored to remove constant specific if(s).
1947         
1948         * enum.cs (EnumMember): Implement IConstant.
1949         (Enum.IsValidEnumConstant): Removed.
1950         (Enum.GetNextDefaultValue): Removed.
1951         (Enum.FindMembers): Updated.
1952         (Enum.GenerateDocComment): Iterate enum members.
1953         
1954         * expression.cs (Cast.TryReduce): Handle enums correctly.
1955         (New.Constantify): Made public.
1956         (MemberAccess.DoResolve): Removed contant specific if(s).
1957         
1958         * literal.cs (NullLiteral): Implement new abstract methods.
1959         
1960         * statement.cs (GotoCase.Resolve): Use new constant methods.
1961         (SwitchLabel.ResolveAndReduce): Use new constant methods.
1962         
1963         * typemanager.cs (LookupEnum): Removed.
1964         (IsEnumType): Fixed to work with corlib.
1965         (RegisterConstant): Removed.
1966         (LookupConstant): Removed.
1967         (GetConstant): Changed to work with IConstant.
1968
1969 2005-08-04  Atsushi Enomoto  <atsushi@ximian.com>
1970
1971         * location.cs : Fixed overflown (>255) column number.
1972
1973 2005-08-03  Raja R Harinath  <rharinath@novell.com>
1974
1975         First cut of the qualified-alias-member feature.
1976         * cs-tokenizer.cs (Tokenizer.is_punct): Recognize the double-colon
1977         token.
1978         * cs-parser.jay (DOUBLE_COLON): New token.
1979         (namespace_or_type_name): Add rule for recognizing
1980         qualified-alias-members.
1981         (primary_expression): Likewise.
1982         (element_access): Allow QualifiedAliasMember as a possible
1983         type-bearing expression.
1984         (local_variable_type, local_variable_pointer_type): Likewise.
1985         * namespace.cs (NamespaceEntry.LookupAlias): New.  Looks up
1986         aliases in the current and enclosing namespace declarations.
1987         (NamespaceEntry.UsingAlias): Add CS0440 warning.
1988         * decl.cs (MemberName.is_double_colon): New.
1989         (MemberName.MemberName): Add new constructor for alias-member.
1990         (MemberName.GetTypeExpression): Generate QualifiedAliasMember too.
1991         * expression.cs (QualifiedAliasMember): New expression type.
1992
1993 2005-08-02  Atsushi Enomoto  <atsushi@ximian.com>
1994
1995         * location.cs : it borked when no argument was specified.
1996
1997 2005-08-02  Atsushi Enomoto  <atsushi@ximian.com>
1998
1999         * location.cs : tiny ToString() format fix.
2000
2001 2005-08-02  Atsushi Enomoto  <atsushi@ximian.com>
2002
2003         * statement.cs : oops, it was missing.
2004
2005 2005-08-02  Atsushi Enomoto  <atsushi@ximian.com>
2006
2007         A set of fixes for precise line/column location.
2008
2009         * location.cs :
2010           "token" field now holds a file/line "delta", a line number offset 
2011           from the segment, and a column number. See also:
2012           http://lists.ximian.com/pipermail/mono-devel-list/2004-
2013           December/009508.html
2014           Removed static IsNull. Use instance IsNull property instead.
2015         * cs-tokenizer.cs :
2016           For some tokens it stores Location. For Identifier it stores
2017           LocatedToken which is a pair of string name and location.
2018           Column numbers are adjusted only at getChar().
2019         * report.cs :
2020           Use Location.ToString() for reporting (it now contains column).
2021         * cs-parser.jay :
2022           Largely modified to use LocatedToken instead of
2023           string (IDENTIFIER), and to acquire Location from some tokens.
2024         * namespace.cs, decl.cs, ecore.cs, class.cs, delegate.cs,
2025           iterators.cs, const.cs, anonymous.cs, tree.cs, enum.cs,
2026           codegen.cs :
2027           Now MemberName holds Location. DeclSpace.ctor() receives Location
2028           as a parameter. Removed extra parameters to all derived classes.
2029           Replaced Location.IsNull() with instance property.
2030         * assign.cs, expression.cs :
2031           Added .ctor() overload that omits Location.
2032         * attribute.cs :
2033           Added "nameEscaped" flag that indicates the identifier was escaped
2034           in the source file. This fixes bug #57047.
2035
2036 2005-09-02  Martin Baulig  <martin@ximian.com>
2037
2038         * class.cs: Make CS3005 a warning, not an error.
2039
2040 2005-08-02  Marek Safar  <marek.safar@seznam.cz>
2041
2042         * attribute.cs (AttributeTester.GetImportedIgnoreCaseClsType):
2043         New method, looking for lo-case imported cls type.
2044
2045         * decl.cs (DeclSpace.VerifyClsCompliance): Check CS3005 for types
2046         here.
2047
2048         * driver.cs: Removed VerifyTopLevelNameClsCompliance usage.
2049
2050         * enum (Enum.VerifyClsCompliance): Hardcode non-compliant types.
2051
2052         * typemanager.cs (TypeManager.AllClsTopLevelTypes): Renamed from
2053         all_imported_types.
2054         (TypeManager.LoadAllImportedTypes): Lo-case imported types.
2055
2056         Optimized to save 3.5 MB for SWF compilation.
2057
2058 2005-08-01  Marek Safar  <marek.safar@seznam.cz>
2059
2060         * class.cs (AddToTypeContainer): Use inheritance insted of if(s).
2061         (PartialContainer.Create): Moved logic AddToContainer.
2062         (PartialContainer.MarkForDuplicationCheck): Shares name.
2063         
2064         * decl.cs (DeclSpace.AddToContainer): Check name collisions at one
2065         place.
2066         
2067         * namespace.cs (Namespace.AddDeclSpace): Lazy declspaces
2068         initialization.
2069         (Namespace.GetSignatureForError): New method.
2070         
2071         * tree.cs (Tree.RecordDecl): Moved to AddToContainer.
2072         (RootTypes.AddToTypeContainer): se inheritance insted of if(s).
2073
2074 2005-08-01  Raja R Harinath  <rharinath@novell.com>
2075
2076         Fix #75669.
2077         * ecore.cs (Expression.MemberLookupFailed): Use queried_type for
2078         member lookup rather than qualifier_type, since qualifier_type can
2079         be null.
2080
2081 2005-08-01  Marek Safar  <marek.safar@seznam.cz>
2082
2083         * enum.cs (Enum.VerifyClsName): Fixed to allow not CLSCompliant
2084         enum member.
2085
2086 2005-07-31  Miguel de Icaza  <miguel@novell.com>
2087
2088         * statement.cs: Copy the local exception into the exception
2089         captured local.  Fixes 75674
2090
2091 2005-07-31  Raja R Harinath  <harinath@gmail.com>
2092
2093         Fix #75658.
2094         * expression.cs (Invocation.OverloadResolve): Don't report error
2095         CS1501 if error CS1502 has been reported.
2096         (New.DoResolve): Delegate CS1501 reporting to
2097         Invocation.OverloadResolve.
2098
2099         Fix #75656.
2100         * statement.cs (Block.CheckInvariantMeaningInBlock): Verify
2101         invariant-meaning-in-block property in an enclosing block if
2102         necessary.
2103
2104 2005-07-29  Marek Safar  <marek.safar@seznam.cz>
2105
2106         * statement.cs (SwitchLabel.ResolveAndReduce): Refactored.
2107         (SwitchLabel.Erorr_AlreadyOccurs): Share error message.
2108         (Switch.CheckSwitch): Just save 50kb for SWF.
2109
2110 2005-07-27  Martin Baulig  <martin@ximian.com>
2111
2112         * anonymous.cs (CaptureContext.AddField): Added
2113         `AnonymousContainer am' argument; compute its toplevel scope if
2114         it's not already computed.  Fixes #75649.
2115
2116 2005-07-26  Raja R Harinath  <rharinath@novell.com>
2117
2118         Fix #75628.
2119         * class.cs (Constructor.Emit): Reset block to null if the block
2120         resolve fails.
2121
2122 2005-07-25  Marek Safar  <marek.safar@seznam.cz>
2123
2124         * class.cs (TypeContainer.VerifyMembers): Be compatible in warning 169.
2125
2126 2005-07-25  Marek Safar  <marek.safar@seznam.cz>
2127
2128         * class.cs (MethodData.Define): Check whether accessor implementing
2129         interface is public.
2130
2131         * driver.cs (Driver.parse): Try to be smart and check for `MZ' header.
2132
2133 2005-07-22  Marek Safar  <marek.safar@seznam.cz>
2134
2135         Fix #57245
2136         * namespace.cs (LookupType): Moved same type check to...
2137         
2138         * typemanager.cs (LookupTypeReflection): Don't allow to import more types
2139         with the same name.
2140
2141 2005-07-21  Raja R Harinath  <rharinath@novell.com>
2142
2143         * namespace.cs (NamespaceLookupType): Avoid a string allocation when we
2144         already found a typebuilder.
2145         * class.cs (MethodCore.IsDuplicateImplementation): Compare
2146         MemberNames, not strings.
2147
2148         * const.cs (Error_ExpressionMustBeConst): 
2149         Rename from Error_EpressionMustBeConst.
2150         * const.cs, class.cs, statement.cd: Update.
2151
2152 2005-07-21  Marek Safar  <marek.safar@seznam.cz>
2153
2154         Fix #65573
2155
2156         * const.cs (Const.LookupConstantValue): Report missing contant expression
2157         everytime.
2158         (Error_EpressionMustBeConstant): Only one error method.
2159
2160         * class.cs, statement.c: Updated.
2161
2162 2005-07-20  Raja R Harinath  <rharinath@novell.com>
2163
2164         * statement.cs (Block.Flags): Add back HasVarargs.
2165         (Block.flags): Make protected.
2166         (ToplevelBlock.HasVarargs): Convert to a property that updates flags.
2167
2168         * typemanager.cs (types, typecontainers, user_types): Remove.
2169         (UserTypes, TypeContainers): Likewise.
2170         (HandleDuplicate, AddDelegateType, AddEnumType): Likewise.
2171         (CleanUp, Reset): Update.
2172         (AddUserType): Combine variants.  Now, only updates builder_to_declspace.
2173         (GetNestedType): Use Type.GetNestedType.
2174         (CoreLookupType): Take two arguments, the namespace and the
2175         basename of the type.  Update to use the Namespace.Lookup
2176         mechanism.
2177         (InitEnumUnderlyingTypes, InitCoreTypes): Update.
2178         (RealMemberLookup): Use IsNestedChildOf instead of playing with
2179         string concatenation and substring matches.
2180         * class.cs, enum.cs, delegate.cs: Update to changes.
2181
2182 2005-07-20  Marek Safar  <marek.safar@seznam.cz>
2183
2184         * constant.cs (Constant.Error_ConstantValueCannotBeConverted): Moved from
2185         Expression and made virtual.
2186
2187         * convert.cs (ImplicitReferenceConversionExists): Skip for value types.
2188         (ImplicitStandardConversionExists): Fixed `byte' typo ?
2189
2190         * ecore.cs (Expression.Error_ConstantValueCannotBeConverted): Moved.
2191
2192         * literal.cs (NullLiteral.Error_ConstantValueCannotBeConverted): Customize
2193         error message.
2194
2195         * convert.cs, ecore.cs, enum.cs: Reflect Error_ConstantValueCannotBeConverted
2196         change.
2197
2198 2005-07-18  Marek Safar  <marek.safar@seznam.cz>
2199
2200         Fix #57707
2201         * codegen.cs (AssemblyClass.ApplyAttributeBuilder): Check whether
2202         AssemblyCultureAttribute is not used on executable.
2203
2204         * rootcontext.cs,
2205         * typemanager.cs: Add System.Reflection.AssemblyCultureAttribute.
2206
2207 2005-07-16  Raja R Harinath  <rharinath@novell.com>
2208
2209         Fix #60638.
2210         * expression.cs (Binary.Warning_UnintendeReferenceComparison):
2211         New.  Reports CS0252/CS0253.
2212         Mostly taken from preliminary patch by Duncak Mak.
2213         (Binary.DoResolveOperator): Store results of operator lookup.
2214         Use them to detect if we need to warn about unintended reference
2215         comparisons.
2216
2217 2005-07-15  Raja R Harinath  <rharinath@novell.com>
2218
2219         Fix #72969.
2220         * namespace.cs (Namespace.Lookup): Add back location parameter.
2221         (Namespace.LookupType): Add CS0436 report.  Add location parameter.
2222         * delegate.cs, ecore.cs, expression.cs: Update to changes.
2223
2224         * codegen.cs (EmitContext.DeclSpace): Make readonly.
2225         * namespace.cs (Namespace.Lookup): Carve out type lookup into ...
2226         (Namespace.LookupType): ... this.
2227         (NamespaceEntry.GetUsingTable): Allocate only one zero-sized array
2228         of namespaces.
2229         * typemanager.cs (LookupTypeReflection): Remove buggy code that
2230         purported to handle pointers.
2231         (char_ptr_type, void_ptr_type): Use GetPointerType rather than
2232         CoreLookupType.
2233
2234 2005-07-15  Marek Safar  <marek.safar@seznam.cz>
2235
2236         * expression.cs (MemberAccess.ResolveNamespaceOrType): Don't report nested
2237         type as namespace.
2238
2239 2005-07-15  Raja R Harinath  <rharinath@novell.com>
2240
2241         * namespace.cs (Namespace.Lookup): Drop location parameter.
2242         (NamespaceEntry.LookupAlias): Remove.  Merge into ...
2243         (NamespaceEntry.Lookup): ... this.
2244         (NamespaceEntry.Error_AmbiguousTypeReference):
2245         Move here from DeclSpace.
2246         (NamespaceEntry.LookupNamespaceOrType): Move support for dotted
2247         names ...
2248         * ecore.cs (TypeLookupExpression.DoResolveAsTypeStep): ... here.
2249         * decl.cs (DeclSpace.ErrorAmbiguousTypeReference):
2250         Move to NamespaceEntry.
2251         * delegate.cs, expression.cs: Update to changes.
2252
2253 2005-08-31  Martin Baulig  <martin@ximian.com>
2254
2255         Committing a patch from Atsushi Enomoto for #75850.
2256
2257         * statement.cs (Foreach.CollectionForeach.GetEnumeratorFilter):
2258         Prefer a generic enumerator over a non-generic one.
2259
2260 2005-08-26  Kornél Pál  <kornelpal@hotmail.com>
2261
2262         * AssemblyInfo.cs: Using Consts.MonoVersion instead of MonoVersion.cs.
2263         * gmcs.exe.sources: Using Consts.MonoVersion instead of MonoVersion.cs.
2264
2265 2005-08-25  Atsushi Enomoto  <atsushi@ximian.com>
2266
2267         * driver.cs : reverting default encoding change as well as mcs.
2268
2269 2005-08-25  Atsushi Enomoto  <atsushi@ximian.com>
2270
2271         * driver.cs, support.cs : merged r48826.
2272           Marek Safer wrote:
2273           > could you integrate your mcs changes to gmcs otherwise
2274           > gmcs cannot compile some files.
2275
2276 2005-08-20  Martin Baulig  <martin@ximian.com>
2277
2278         * anonymous.cs (CaptureContext.CaptureThis): Create the topmost
2279         scope if we don't already have it.
2280
2281         * expression.cs (Invocation.EmitCall): Use `ec.EmitThis ()' rather
2282         than `ig.Emit (OpCodes.Ldarg_0)' to make it work inside iterators;
2283         fixes #75867.
2284
2285 2005-07-31  Miguel de Icaza  <miguel@novell.com>
2286
2287         * statement.cs: Copy the local exception into the exception
2288         captured local.  Fixes 75674
2289
2290 2005-07-15  Marek Safar  <marek.safar@seznam.cz>
2291
2292         * expression.cs (MemberAccess.ResolveNamespaceOrType): Don't report nested
2293         type as namespace.
2294
2295 2005-08-12  Martin Baulig  <martin@ximian.com>
2296
2297         * expression.cs (MemberAccess.ResolveNamespaceOrType): Only search
2298         for nested types here to avoid hitting the cache too early.
2299
2300 2005-08-09  Miguel de Icaza  <miguel@novell.com>
2301
2302         * enum.cs: On the new compiler CLS error 3005 is now a warning not
2303         an error. 
2304
2305 2005-08-03  Martin Baulig  <martin@ximian.com>
2306
2307         Make iterators in generic methods work; see gtest-191.cs.
2308
2309         * generic.cs
2310         (Constraints.Resolve): Protect against being called twice.
2311
2312         * class.cs
2313         (TypeContainer.GetClassBases): Make this `protected virtual'.
2314
2315         * iterator.cs (Iterator.ctor): Added `GenericMethod' argument.
2316         (Iterator.GetClassBases): Override this and compute the base
2317         classes here.
2318         (Iterator.DefineNestedTypes): If we're a generic method, all our
2319         method type parameters become class type parameters on the proxy
2320         class.
2321
2322         * statement.cs
2323         (ToplevelBlock.Parameters): Make this a property, not a field.
2324         (ToplevelBlock.ResolveMeta): Update the `parameters' from the `ip'.
2325
2326 2005-08-03  Martin Baulig  <martin@ximian.com>
2327
2328         * typemanager.cs (TypeManager.IsSubclassOf): Use
2329         `TypeManager.IsEqual' instead of `Type.Equals'; fixes gtest-190.cs.
2330         (TypeManager.GetFullName_recursed): Improved.
2331
2332 2005-07-27  Carlos Alberto Cortez <calberto.cortez@gmail.com>
2333
2334         Fix #75417
2335         * ecore.cs (Expression.IsAccessorAccessible): Change the check for
2336         Private accessor case, using TypeManager.IsPrivateAccessible instead of
2337         invocation_type == mi.DeclaringType, since the first one also checks
2338         other condition used by generic instances.
2339         
2340 2005-07-27  Martin Baulig  <martin@ximian.com>
2341
2342         * anonymous.cs (CaptureContext.AddField): Added
2343         `AnonymousContainer am' argument; compute its toplevel scope if
2344         it's not already computed.  Fixes #75649.
2345
2346 2005-07-14  Marek Safar  <marek.safar@seznam.cz>
2347
2348         * attribute.cs (Attribute.ResolveAttributeType): Renamed from
2349         CheckAttributeType and refactored.
2350         (Attribute.ResolvePossibleAttributeType): Changed to reuse
2351         ResolveAsTypeTerminal error handling.
2352         (ResolveAsTypeTerminal): Introduced because of global attributes extra
2353         handling.
2354         (GetSignatureForError): Print errors in same way.
2355
2356         * class.cs,
2357         * codegen.cs: Reflect attribute GetSignatureForError change.
2358
2359         * ecore.cs,
2360         * expression.cs: Add silent parameter to ResolveAsTypeStep.
2361
2362         * namespace.cs (UsingEntry): Refactored to make fields private.
2363
2364         * assign.cs,
2365         statement.cs: Error_UnexpectedKind has extra parameter.
2366
2367 2005-07-14  Raja R Harinath  <rharinath@novell.com>
2368
2369         * ecore.cs (IAlias): Remove.
2370         * decl.cs (DeclSpace): Don't derive from IAlias.  Remove members
2371         that implement the interface.
2372         * namespace.cs (Namespace): Likewise.
2373         (Namespace.declspaces): Renamed from 'defined_names'.
2374         (Namespace.AddDeclSpace): Renamed from 'DefineName'.  Take a
2375         DeclSpace instead of an IAlias.
2376         * tree.cs (Tree.AddDecl): Update.
2377
2378 2005-07-12  Raja R Harinath  <rharinath@novell.com>
2379
2380         * statement.cs (Block.Flags); Remove HasVarargs.
2381         (Block.HasVarargs): Move to ToplevelBlock.
2382         (Block.ThisVariable, Block.AddThisVariable): Likewise.
2383         (Block.Variables): Make protected.  Initialize variable hashtable
2384         if necessary.
2385         (Block.AddVariable): Update.
2386         (Block.Resolve): Update to changes.
2387         (ToplevelBlock.HasVarargs): New boolean.
2388         (ToplevelBlock.ThisVariable): Move here from Block.
2389         (ToplevelBlock.AddThisVariable): Likewise.
2390         (ToplevelBlock.IsThisAssigned): New.  Forwards call to this_variable.
2391         * expression.cs (This.ResolveBase): Update to changes.
2392         (ArglistAccess.DoResolve): Likewise.
2393
2394 2005-07-11  Marek Safar  <marek.safar@seznam.cz>
2395
2396         Fix #75321
2397         * ecore.cs, class.cs: Use SetAssigned instead of direct access.
2398
2399         * class.cs (TypeContainer.VerifyMembers): Distinguish between
2400         not used and not used & assigned.
2401         (FieldBase.ASSIGNED): Moved to MemberCore.Flags.
2402
2403 2005-07-11  Marek Safar  <marek.safar@seznam.cz>
2404
2405         Fix #75053
2406         * expression.cs (Is.DoResolve): null is never provided type.
2407
2408 2005-07-08  Marek Safar  <marek.safar@seznam.cz>
2409
2410         Fix #52496
2411         * cs-parser.jay: Less strict event error rule to catch more errors.
2412
2413 2005-07-11  Martin Baulig  <martin@ximian.com>
2414
2415         * generic.cs (ConstructedType.CheckConstraints): Improve the check
2416         for the constructor constraint: we do not only have to check
2417         whether the class has a public constructor, but also ensure that
2418         it's parameterless.  Fixes #75492.
2419
2420 2005-07-11  Martin Baulig  <martin@ximian.com>
2421
2422         * expression.cs (Binary.ResolveOperator): Only allow `==' and `!='
2423         between type parameters if they either have the reference type
2424         constraint or the class constraint.
2425
2426 2005-07-10  Kamil Skalski <nazgul@nemerle.org>
2427
2428         * generic.cs: Use MakeGenericType instead of BindGenericParameters.
2429
2430 2005-07-07  Marek Safar  <marek.safar@seznam.cz>
2431
2432         Fix #74975
2433         * attribute.cs (orig_sec_assembly): Holds original version of assembly.
2434         (ExtractSecurityPermissionSet): Cope with self referencing security
2435         attributes properly.
2436
2437         * driver.cs (SetOutputFile): Made public property OutputFile.
2438
2439 2005-07-07  Raja R Harinath  <rharinath@novell.com>
2440
2441         Fix #75486.
2442         * class.cs (TypeContainer.first_nonstatic_field): Rename from
2443         has_nonstatic_fields.  Make into a FieldBase pointer.
2444         (TypeContainer.AddField): Add CS0282 check.
2445         (TypeContainer.EmitType): Update.
2446
2447 2005-07-06  Miguel de Icaza  <miguel@novell.com>
2448
2449         * cs-tokenizer.cs (consume_identifier): Do not create strings to
2450         compare if they start with __.
2451
2452 2005-07-06  Raja R Harinath  <rharinath@novell.com>
2453
2454         * statement.cs (Switch.SwitchGoverningType): Only look at
2455         UserCasts that don't need implicit standard conversions to one of
2456         the allowed switch types (Fixes test-322.cs).
2457         (LocalInfo.Resolve): Re-enable sanity-test.
2458
2459 2005-07-06  Marek Safar  <marek.safar@seznam.cz>
2460
2461         * cs-tokenizer.cs (consume_identifier): Detect double undescores
2462         
2463         * ecore.cs (FieldExpr.AddressOf): Changed volatile error to warning.
2464         
2465         * expression.cs (Invocation.DoResolve): Report error CS0245 here.
2466
2467 2005-07-06  Raja R Harinath  <rharinath@novell.com>
2468
2469         Fix #75472.
2470         * ecore.cs (SimpleName.GetSignatureForError): Add.
2471         * expression.cs (MemberAccess.DoResolve): Don't clobber 'expr' field.
2472         (MemberAccess.GetSignatureForError): Add.
2473
2474 2005-07-05  Marek Safar  <marek.safar@seznam.cz>
2475  
2476         The big error and warning messages review.
2477         
2478         * anonymous.cs,
2479         * assign.cs,
2480         * attribute.cs,
2481         * class.cs,
2482         * codegen.cs,
2483         * convert.cs,
2484         * cs-parser.jay,
2485         * cs-tokenizer.cs,
2486         * decl.cs,
2487         * delegate.cs,
2488         * doc.cs,
2489         * driver.cs,
2490         * ecore.cs,
2491         * enum.cs,
2492         * expression.cs,
2493         * flowanalysis.cs,
2494         * iterators.cs,
2495         * literal.cs,
2496         * location.cs,
2497         * modifiers.cs,
2498         * namespace.cs,
2499         * parameter.cs,
2500         * pending.cs,
2501         * report.cs,
2502         * rootcontext.cs,
2503         * statement.cs,
2504         * support.cs,
2505         * tree.cs,
2506         * typemanager.cs: Updated.
2507         
2508         * class.cs: (MethodCore.SetYields): Moved here to share.
2509         (PropertyMethod.Define): Moved iterator setup here.
2510         
2511         * iterators.cs: Add orig_method to have full access to parent
2512         container.
2513
2514 2005-07-05  Raja R Harinath  <rharinath@novell.com>
2515
2516         Make 'fixed variable' handling standards compliant. Fix #70807, #72729.
2517         * ecore.cs (IVariable.VerifyFixed): Remove 'is_expression' parameter.
2518         (FieldExpr.VerifyFixed): Ensure that the field is part of a fixed
2519         variable of struct type.
2520         * expression.cs (Unary.ResolveOperator): Update to change.
2521         (Indirection.VerifyFixed): Likewise.
2522         (LocalVariableReference.VerifyFixed): A local variable is always fixed.
2523         (ParameterReference.VerifyFixed): Value parameters are fixed.
2524         (This.VerifyFixed): Treat 'this' as a value parameter.
2525         * statement.cs (LocalInfo.IsFixed): Remove.
2526
2527 2005-07-01  Martin Baulig  <martin@ximian.com>
2528
2529         * iterators.cs (Iterator.CapturedThisReference.Emit): Use
2530         `ec.EmitThis ()' to get the correct scope.
2531
2532 2005-07-01  Martin Baulig  <martin@ximian.com>
2533
2534         * ecore.cs (FieldExpr.DoResolve): Don't capture the field if it's
2535         instance is a ParameterReference; fixes #75299.
2536
2537 2005-06-30  Raja R Harinath  <rharinath@novell.com>
2538
2539         Fix #75412.
2540         * expression.cs (Indexers.map): Remove.
2541         (Indexers.Append): Filter out inaccessible setters and getters.
2542         (IndexerAccess.DoResolve, IndexerAccess.DoResolveLValue): Update.
2543
2544         Fix #75283.
2545         * ecore.cs (MemberExpr.EmitInstance): New.  Add CS0120 check.
2546         Refactored from ...
2547         (FieldExpr.EmitInstance, PropertyExpr.EmitInstance): ... these.
2548         (FieldExpr.Emit, PropertyExpr.Emit): Update.
2549         (FieldExpr.EmitAssign, PropertyExpr.EmitAssign): Update.
2550         * expression.cs (Invocation.EmitCall): Add CS0120 check.
2551
2552 2005-06-30  Marek Safar  <marek.safar@seznam.cz>
2553
2554         Fix #75322
2555         * class.cs (FieldBase.GetInitializerExpression): One more field
2556         for backup.
2557
2558 2005-06-28  Miguel de Icaza  <miguel@novell.com>
2559
2560         * pending.cs: Do not define a proxy if the base method is virtual,
2561         it will be picked up by the runtime (bug 75270).
2562
2563 2005-07-08  Martin Baulig  <martin@ximian.com>
2564
2565         * anonymous.cs (CaptureContext.EmitParameterInstance): Correctly
2566         handle parameters in nested scopes; fixes #74808; see gtest-188.cs.
2567
2568 2005-07-07  Martin Baulig  <martin@ximian.com>
2569
2570         * generic.cs (ConstructedType.CheckConstraint): Use
2571         ResolveAsTypeStep(), not ResolveAsTypeTerminal() so we're not
2572         called recursively; fixes #75329.
2573
2574 2005-07-06  Martin Baulig  <martin@ximian.com>
2575
2576         * generic.cs (TypeManager.InferTypeArguments): Added support for
2577         anonymous methods; fixes #75461.
2578
2579 2005-07-01  Martin Baulig  <martin@ximian.com>
2580
2581         * iterators.cs (Iterator.CapturedThisReference.Emit): Use
2582         `ec.EmitThis ()' to get the correct scope.
2583
2584 2005-07-01  Martin Baulig  <martin@ximian.com>
2585
2586         * ecore.cs (FieldExpr.DoResolve): Only capture the field if it's
2587         instance is `This'; fixes #75299.
2588
2589 2005-06-30  Martin Baulig  <martin@ximian.com>
2590
2591         * class.cs (Indexer): Implement IIteratorContainer; added support
2592         for iterators in indexers.
2593
2594         * codegen.cs
2595         (EmitContext.CurrentIterator): Make this a property, not a field.
2596
2597         * anonymous.cs (AnonymousContainer.Iterator): New public property.
2598
2599 2005-06-28  Miguel de Icaza  <miguel@novell.com>
2600
2601         * pending.cs: Do not define a proxy if the base method is virtual,
2602         it will be picked up by the runtime (bug 75270).
2603
2604 2005-06-28  Martin Baulig  <martin@ximian.com>
2605
2606         * cs-parser.jay (interface_method_declaration): Avoid a
2607         reduce/reduce conflict by moving some of the code into a separate
2608         `interface_method_declaration_body' rule; fixes #75368.
2609
2610 2005-06-28  Martin Baulig  <martin@ximian.com>
2611
2612         * typemanager.cs (TypeManager.MemberLookup_FindMembers): Move the
2613         array check after the check for TypeBuilder's.
2614
2615 2005-06-21  Raja R Harinath  <rharinath@novell.com>
2616
2617         * convert.cs (FindMostEncompassedType): Add two trivial special
2618         cases (number_of_types == 0 || number_of_types == 1).
2619         (FindMostEncompasingType): Likewise.
2620
2621 2005-06-17  Raja R Harinath  <rharinath@novell.com>
2622
2623         Some cleanups preparing for the fix of #75283.
2624         * ecore.cs (PropertyExpr.InstanceResolve): Tighten conditions for
2625         error testing.
2626         (EventExpr.InstanceResolve): Likewise.
2627         (EventExpr.DoResolve): Remove redundant checks.
2628
2629 2005-06-08  Miguel de Icaza  <miguel@novell.com>
2630
2631         * class.cs: Small fix.
2632
2633 2005-06-08  Raja R Harinath  <rharinath@novell.com>
2634
2635         Fix #75160.
2636         * class.cs (GetPartialBases): Fix return value check of
2637         part.GetClassBases.
2638
2639 2005-06-07  Raja R Harinath  <rharinath@novell.com>
2640
2641         Ensure that partial classes are registered in their enclosing
2642         namespace.  Initial part of fix of #75160.
2643         * tree.cs (Tree.RecordDecl): Add new namespace argument.
2644         Register declspace with namespace here, not in
2645         DeclSpace.RecordDecl.
2646         * cs-parser.jay: Pass namespace to RecordDecl.
2647         * class.cs (PartialContainer.Create): Likewise.
2648         (ClassPart.DefineType): New sanity-check.  Throws an exception if
2649         called.
2650         * decl.cs (Declspace.RecordDecl): Remove.
2651         * namespace.cs (NamespaceEntry.DefineName): Remove.
2652
2653 2005-06-06  Marek Safar  <marek.safar@seznam.cz>
2654
2655         * rootcontext.cs: Reset TargetExt as well.
2656
2657 2005-06-03  Raja R Harinath  <rharinath@novell.com>
2658
2659         * ecore.cs (Expression.Resolve): Emit CS0654 error when
2660         -langversion:ISO-1.
2661
2662 2005-06-02  Raja R Harinath  <rharinath@novell.com>
2663
2664         Fix #75080, cs0119.cs.
2665         * ecore.cs (Expression.ExprClassToResolveFlags): New.  Broken out
2666         of ...
2667         (Expression.Resolve): ... this.  Use it.  Remove bogus code
2668         allowing ExprClass.Type and ExprClass.Namespace for
2669         ResolveFlags.VariableOrValue.
2670         (Expression.Resolve) [1-argument variant]: Change default resolve
2671         flags based on language version.
2672         (Expression.Error_UnexpectedKind): Use a simple string array
2673         rather than an ArrayList.
2674         * expression.cs (TypeOf.DoResolve): Set eclass to ExprClass.Value,
2675         not ExprClass.Type.
2676         (TypeOfVoid.DoResolve): Likewise.
2677         (MemberAccess.DoResolve) [3-argument variant]: Make private.  Drop
2678         flags argument -- it always has the same value.
2679
2680 2005-05-31  Raja R Harinath  <rharinath@novell.com>
2681
2682         Fix #75081.
2683         * ecore.cs (Expression.ResolveLValue): Add a Location parameter.
2684         Use it in the error message.
2685         * assign.cs, expression.cs, statement.cs: Update.
2686
2687 2005-05-30  Raja R Harinath  <rharinath@novell.com>
2688
2689         Fix #75088.
2690         * ecore.cs (Expression.MemberLookupFailed): Add CS0122 check in
2691         the "almostMatchedMember" case too.
2692         * typemanager.cs (Closure.CheckValidFamilyAccess): Add anything
2693         that failed the accessibility checks to 'almost_match'.
2694
2695 2005-05-27  Vladimir Vukicevic  <vladimir@pobox.com>
2696
2697         * attribute.cs: Use internal MethodBuilder methods to set
2698         ExactSpelling and SetLastError on PInvoke methods, instead
2699         of passing them via charset.  Fixes #75060.
2700
2701 2005-05-27  Raja R Harinath  <rharinath@novell.com>
2702
2703         * parameter.cs (Parameter): Remove TODO comment.
2704         (Parameter.DefineParameter): Remove Location parameter.
2705         (Parameters.LabelParameters): Likewise.
2706         * class.cs (Constructor.Emit): Update to change.
2707         (MethodData.Emit): Likewise.
2708         * anonymous.cs (AnonymousMethod.EmitMethod): Likewise.  
2709         * delegate.cs (Delegate.Define, Delegate.Emit): Likewise.
2710
2711 2005-05-27  Atsushi Enomoto  <atsushi@ximian.com>
2712
2713         * parameter.cs,
2714           Removed Parameters.Location and added Parameter.Location instead.
2715           Removed Location parameter from Emit() and GetSignature().
2716         * anonymous.cs,
2717           class.cs,
2718           cs-parser.jay,
2719           delegate.cs,
2720           iterators.cs,
2721           statement.cs :
2722           Modified all related calls.
2723
2724 2005-06-21  Martin Baulig  <martin@ximian.com>
2725
2726         * generic.cs (NullCoalescingOperator.Emit): Make this work if the
2727         left-hand side is not a nullable type; fixes #75328.
2728
2729 2005-06-21  Martin Baulig  <martin@ximian.com>
2730
2731         * typemanager.cs
2732         (TypeManager.CSharpName): Use GetFullName() instead of `t.FullName'.
2733         (TypeManager.GetFullNameSignature): Likewise.
2734
2735         * convert.cs (Convert.Error_CannotImplicitConversion): Compare
2736         `source.FullName' and `target.FullName' to check whether there are
2737         two conflicting definitions.
2738
2739 2005-06-21  Martin Baulig  <martin@ximian.com>
2740
2741         * convert.cs (Convert.ImplicitTypeParameterConversion): Always use
2742         a BoxedCast - also for reference types - to be compatible with csc.
2743
2744 2005-06-21  Martin Baulig  <martin@ximian.com>
2745
2746         * expression.cs (MemberAccess.DoResolve): Add support for nested
2747         types in a generic instance; fixes #75320.
2748
2749 2005-06-20  Martin Baulig  <martin@ximian.com>
2750
2751         * generic.cs (TypeManager.InferType): Also walk the class
2752         hierarchy for generic instances; fixes #75261.
2753
2754 2005-06-17  Martin Baulig  <martin@ximian.com>
2755
2756         * typemanager.cs (TypeManager.IsBuiltinType): Use TypeToCoreType()
2757         to make things work for corlib.
2758
2759 2005-06-15  Martin Baulig  <martin@ximian.com>
2760
2761         * attribute.cs (Attribute.CheckSecurityActionValidity): Remove the
2762         obsolete `SecurityAction' values.
2763
2764 2005-06-06  Marek Safar  <marek.safar@seznam.cz>
2765
2766         * rootcontext.cs: Reset TargetExt as well.
2767         
2768 2005-06-09  Martin Baulig  <martin@ximian.com>
2769
2770         * delegate.cs (Delegate.VerifyMethod): Added
2771         `MethodGroupExpr old_mg' argument; inherit its
2772         `HasTypeParameters'; fix #75085.
2773
2774 2005-06-09  Martin Baulig  <martin@ximian.com>
2775
2776         * expression.cs (Invocation.OverloadResolve): Correctly handle
2777         generic methods for the SetMemberIsUsed(); fix #75064.
2778
2779 2005-06-09  Martin Baulig  <martin@ximian.com>
2780
2781         * statement.cs (Throw.Resolve): Use TypeManager.IsSubclassOf();
2782         fixes #75062.
2783
2784 2005-06-08  Martin Baulig  <martin@ximian.com>
2785
2786         * cs-parser.jay (nullable_type_or_conditional): If we put the
2787         nullable back and our `type' is a `ComposedCast', remove the
2788         nullable from it.  Fixes #75156.
2789
2790         * expression.cs (ComposedCast.RemoveNullable): New public method.
2791
2792 2005-06-08  Martin Baulig  <martin@ximian.com>
2793
2794         The big Iterators rewrite :-)
2795
2796         * iterators.cs: Rewrite this to use the anonymous methods framework.
2797
2798         * rootcontext.cs (RootContext.DefineTypes): Define Delegates
2799         before the TypeContainers; see 2test-21.cs.
2800
2801         * class.cs
2802         (TypeContainer.DefineType): Don't create a new EmitContext if we
2803         already have one (this only happens if we're an Iterator).
2804         (TypeContainer.Define): Also call Define() on all our iterators.
2805         (Method.CreateEmitContext): Added support for iterators.
2806
2807         * anonymous.cs
2808         (AnonymousContainer): New abstract base class for `AnonymousMethod'.
2809         (AnonymousContainer.CreateMethodHost): Moved here from
2810         AnonymousMethod and made abstract.
2811         (AnonymousContainer.CreateScopeType): New abstract method.
2812         (AnonymousContainer.IsIterator): New public property.
2813         (ScopeInfo.EmitScopeType): Call CreateScopeType() on our Host to
2814         get the ScopeTypeBuilder rather than manually defining it here. 
2815         (ScopeInfo.EmitScopeInstance): New public method; correctly handle
2816         iterators here.
2817
2818         * driver.cs (Driver.MainDriver): Call TypeManager.InitCodeHelpers()
2819         before RootContext.DefineTypes().
2820
2821         * codegen.cs (EmitContext.RemapToProxy): Removed.
2822         (EmitContext.CurrentAnonymousMethod): Changed type from
2823         AnonymousMethod -> AnonymousContainer.
2824         (EmitContext.ResolveTopBlock): Protect from being called twice.
2825         (EmitContext.MapVariable, RemapParameter(LValue)): Removed.
2826         (EmitContext.EmitThis): Removed the iterators hacks; use the
2827         anonymous methods framework for that.
2828
2829         * statement.cs
2830         (ToplevelBlock.Container): Make this a property, not a field.
2831         (ToplevelBlock.ReParent): New public method; move the
2832         ToplevelBlock into a new container.
2833         (Foreach.TemporaryVariable): Simplify.
2834
2835 2005-06-05  Martin Baulig  <martin@ximian.com>
2836
2837         * statement.cs (LocalInfo.CompilerGenerated): New flag.
2838         (Block.AddTemporaryVariable): New public method; creates a new
2839         `LocalInfo' for a temporary variable.
2840         (Block.EmitMeta): Create the LocalBuilders for all the temporary
2841         variables here.
2842         (Foreach.TemporaryVariable): Use Block.AddTemporaryVariable() for
2843         non-iterator variables.
2844
2845 2005-06-05  Martin Baulig  <martin@ximian.com>
2846
2847         * statement.cs (Foreach.TemporaryVariable): Create the
2848         LocalBuilder in the Emit phase and not in Resolve since in some
2849         situations, we don't have an ILGenerator during Resolve; see
2850         2test-19.cs for an example.
2851
2852 2005-06-04  Martin Baulig  <martin@ximian.com>
2853
2854         The big Foreach rewrite - Part II.
2855
2856         * typemanager.cs (TypeManager.object_getcurrent_void): Replaced
2857         with `PropertyInfo ienumerator_getcurrent'.
2858
2859         * codegen.cs (VariableStorage): Removed.
2860
2861         * statement.cs
2862         (Foreach): Derive from Statement, not ExceptionStatement.
2863         (Foreach.CollectionForeach): New nested class.  Moved all the code
2864         dealing with collection foreach here.
2865         (Foreach.ForeachHelperMethods): Removed.
2866         (Foreach.TemporaryVariable): Implement IMemoryLocation.
2867
2868 2005-05-23  Martin Baulig  <martin@ximian.com>
2869
2870         * statement.cs (Try.DoResolve): Don't create a `finally' if we
2871         don't need to.  Fix #75014.
2872
2873 2005-05-26  Raja R Harinath  <rharinath@novell.com>
2874
2875         Improve user-defined conversion handling.
2876         * convert.cs (GetConversionOperators): Rewrite.  Return only the
2877         applicable operators.
2878         (AddConversionOperators): New.  Helper for GetConversionOperators.
2879         (FindMostEncompassedType, FindMostEncompassingType): Verify that
2880         there is only one most encompassed/encompassing type.
2881         (FindMostSpecificSource, FindMostSpecificTarget): Remove
2882         "applicable operator" handling.
2883         (UserConversion): Move cache here from GetConversionOperators.
2884         Directly cache the chosen operator, rather than the whole
2885         MethodGroup.
2886         (ExplicitNumericConversion): Fix buggy implementation of Decimal
2887         case.  Allow conversion of decimal to sbyte and byte too.
2888         * expression.cs (EmptyExpression.Grab, EmptyExpression.Release):
2889         New static methods.  Used to avoid allocating EmptyExpressions in
2890         convert.cs.
2891
2892 2005-05-24  Duncan Mak  <duncan@novell.com>
2893
2894         * ecore.cs (CastFromDecimal): New class for casting a decimal to
2895         another class, used in Convert.ExplicitNumericConversion.
2896         (CastToDecimal): New class, similar to above, but casts to
2897         System.Decimal, used in Convert.ImplicitNumericConversion and also
2898         in explicit convesion from double/float to decimal.
2899
2900         * convert.cs (ImplicitNumericConversion): Handle implicit
2901         conversions to System.Decimal.
2902         (ExplicitNumericConversion): handle explicit conversions to
2903         System.Decimal.
2904
2905         This fixes #68711.
2906         
2907 2005-05-20  Miguel de Icaza  <miguel@novell.com>
2908
2909         * typemanager.cs: Do not throw an exception in the TypeBuilder
2910         case, we take care of it on the TypeCode.
2911
2912 2005-05-17  Marek Safar  <marek.safar@seznam.cz>
2913         
2914         * attribute.cs (Attribute.ResolveArguments): GuidAttribute check
2915         is back.
2916         
2917         * cs-parser.jay: Catch more lexical errors.
2918         
2919         * report.cs: Add one more Error method.
2920         
2921         * rootcontext.cs,
2922         * typemanager.cs: Register System.Runtime.InteropServices.GuidAttribute
2923
2924 2005-05-20  Martin Baulig  <martin@ximian.com>
2925
2926         * class.cs (TypeContainer.CircularDepException): Removed.
2927         (TypeContainer.DefineType): Removed the `InTransit' stuff.
2928         (TypeContainer.CheckRecursiveDefinition): Check for circular class
2929         (CS0146) and interface (CS0529) dependencies here.
2930
2931 2005-05-20  Martin Baulig  <martin@ximian.com>
2932
2933         * expression.cs (New.DoResolve): Move the CS0712 check above the
2934         CS0144 check; otherwise it can never be reached.
2935
2936 2005-05-20  Martin Baulig  <martin@ximian.com>
2937
2938         * cs-parser.jay: Fix CS0080 check; add CS0231 and CS0257 from MCS.
2939
2940 2005-05-20  Martin Baulig  <martin@ximian.com>
2941
2942         * class.cs (TypeContainer.DefineType): Fix CS0698 check.
2943
2944         * typemanager.cs (TypeManager.IsAttributeType): New public method.
2945
2946 2005-05-19  Martin Baulig  <martin@ximian.com>
2947
2948         * delegate.cs
2949         (ImplicitDelegateCreation.Check): Added `bool check_only' argument
2950         to disable error reporting.
2951
2952         * convert.cs (Convert.ImplicitStandardConversionExists): Use it
2953         here since we don't want to report an error; see the new test-336.cs.
2954
2955 2005-05-19  Raja R Harinath  <rharinath@novell.com>
2956
2957         * statement.cs (ToplevelBlock.GetParameterReference)
2958         (ToplevelBlock.IsParameterReference,ToplevelBlock.IsLocalParameter):
2959         Move here from class Block.
2960         * ecore.cs (SimpleName.SimpleNameResolve): Update to changes.
2961         * expression.cs (ParameterReference.DoResolveBase): Likewise.
2962
2963 2005-05-18  Martin Baulig  <martin@ximian.com>
2964
2965         Fix #74978.
2966
2967         * flowanalysis.cs
2968         (FlowBranching.Reachability): Add non-static public And() and Or()
2969         methods.
2970         (FlowBranchingSwitch): New class; do the `break_origins' thing
2971         like in FlowBranchingLoop.
2972         (FlowBranching.UsageVector.MergeBreakOrigins): Also merge the
2973         reachability, not just locals and parameters.
2974         (FlowBranching.MergeChild): Remove some of the hacks for loop and
2975         switch; MergeBreakOrigins() now takes care of that.
2976
2977 2005-05-18  Martin Baulig  <martin@ximian.com>
2978
2979         * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
2980         a loop and may leave it, reset the barrier; fixes #74974.
2981
2982 2005-05-16  Raja R Harinath  <rharinath@novell.com>
2983
2984         Fix test-382.cs.  Emit values of decimal constants.
2985         * class.cs (TypeContainer.RegisterFieldForInitialization): New.
2986         Carved out of ...
2987         (TypeContainer.AddField): ... this.
2988         (TypeContainer.EmitFieldInitializers): Allow the list of fields
2989         with initializers to include 'Const's.
2990         (ClassPart.RegisterFieldForInitialization): Forward to
2991         PartialContainer.
2992         * const.cs (Const.Const): Pass initializer to base class.
2993         (Const.Define): In case of decimal constants, register them for
2994         initialization in a static constructor.
2995
2996 2005-05-14  Martin Baulig  <martin@ximian.com>
2997
2998         * statement.cs (Block.Resolve): Correctly handle unreachable code;
2999         do not call ResolveUnreachable() on unreachable statements in
3000         here, see the comment in the source code.
3001
3002 2005-05-13  Raja R Harinath  <rharinath@novell.com>
3003
3004         Fix #74934.
3005         * expression.cs (BinaryResolveOperator): If one of the operands of
3006         an equality comparison is 'null' and the other is a pointer type,
3007         convert the null to a NullPointer.
3008         * convert.cs (ImplicitReferenceConversion): If the expression is a
3009         NullLiteral and the target type is a pointer type, return a
3010         NullPointer instead.
3011         (ImplicitConversionStandard): Likewise.
3012
3013 2005-05-13  Marek Safar  <marek.safar@seznam.cz>
3014         
3015         * cs-parser.jay: Set readonly context based on special constructs.
3016         
3017         * expression.cs (LocalVariableReference.DoResolveBase): Improved
3018         readonly variable error handling.
3019         
3020         * rootcontext.cs (EmitCode): Don't verify members when error
3021         occurred.
3022         
3023         * statement.cs (LocalInfo): Add reaodnly context information.
3024         (SetReadOnlyContext, GetReadOnlyContext): New methods.
3025
3026 2005-05-17  Martin Baulig  <martin@ximian.com>
3027
3028         * expression.cs (Argument.Resolve): Turn on flow analysis; fix
3029         #70970. 
3030
3031 2005-05-13  Martin Baulig  <martin@ximian.com>
3032
3033         * statement.cs (Block.Resolve, ResolveUnreachable): Correctly
3034         handle unreachable blocks.
3035
3036 2005-05-13  Martin Baulig  <martin@ximian.com>
3037
3038         * class.cs
3039         (ConstructorInitializer.GetOverloadedConstructor): Don't crash.
3040         (MethodCore.CheckCore): Use TypeManager.IsEqual(); fix #74904 and
3041         #74905. 
3042
3043 2005-05-13  Martin Baulig  <martin@ximian.com>
3044
3045         * statement.cs (Block.Resolve): Make the `bool unresolved' flag an
3046         instance variable, not a local.  Fix #74873.
3047         (Block.ResolveUnreachable): Set it to true here.
3048
3049 2005-05-12  Martin Baulig  <martin@ximian.com>
3050
3051         * cs-parser.jay (property_declaration): Pass the `current_class',
3052         not the `current_container' to Property's .ctor.  Fixes #74912.
3053
3054 2005-05-11  Martin Baulig  <martin@ximian.com>
3055
3056         * typemanager.cs (Closure): Copy this from MCS and merge all the
3057         GMCS-specific changes into it.
3058
3059 2005-05-12  Raja R Harinath  <harinath@gmail.com>
3060
3061         Fix #74920.
3062         * typemanager.cs (unmanaged_enclosing_types): New.
3063         (IsUnmanagedType): Avoid infloops by using
3064         'unmanaged_enclosing_types' to talk with recursive invocations.
3065
3066 2005-05-11  Duncan Mak  <duncan@novell.com>
3067
3068         * cs-tokenizer.cs (get_cmd_arg): Check that 'c' is not -1 before
3069         continuing to process for 'arg'.
3070         (handle_preprocessing_directive): Check the argument of the #endif
3071         directive and report error CS1025 if there are any trailing
3072         characters.
3073
3074         According to the C# spec, having even whitespace after the #endif
3075         directive is illegal; however, because we call arg.TrimEnd ()
3076         beforehand, we have the same behavior as csc, allowing whitespace
3077         after the directive.
3078
3079         Fixes #74892.
3080
3081 2005-05-11  Marek Safar  <marek.safar@seznam.cz>
3082
3083         Fix #74863.
3084         
3085         * class.cs (ConstructorInitializer.GetOverloadedConstructor): Removed.
3086         (Constructor.GetObsoleteAttribute): Implemented correctly.
3087
3088 2005-05-10  Martin Baulig  <martin@ximian.com>
3089
3090         * generic.cs (Constraints.Resolve): Report CS0246 if we cannot
3091         resolve the type; fixes #74864.
3092         (DefaultValueExpression): Create the LocalTemporary in Emit(), not
3093         in DoResolve(); fixes #74862.
3094
3095 2005-05-10  Martin Baulig  <martin@ximian.com>
3096
3097         * support.cs (ReflectionParameters.ParameterModifier): Use
3098         `Parameter.Modifier.REF' if we both have `ParameterAttributes.Out'
3099         and `ParameterAttributes.In'.  Fixes #74884.
3100
3101 2005-05-10  Martin Baulig  <martin@ximian.com>
3102
3103         * typemanager.cs (TypeManager.MemberLookup_FindMembers): Don't use
3104         the cache if we're just looking for `MemberTypes.NestedType' in a
3105         generic instance.
3106
3107         * ecore.cs (Expression.ResolveAsTypeTerminal): Don't check the
3108         constraints if we're still resolving the type tree.
3109         (Expression.MemberLookup): If we're resolving the type tree, only
3110         look for `MemberTypes.NestedType' since we're only interested in
3111         getting types.
3112
3113         * class.cs (TypeContainer.DefineType): Don't resolve the type
3114         parameters here; do this later in ResolveType() after the type
3115         tree has been resolved.
3116         (TypeContainer.ResolveType): New public method; this is called
3117         after the type tree is resolved and before the types are being
3118         populated.  We resolve the generic constraints here.
3119         (TypeContainer.DoDefineMember): Check the constraints on our base
3120         class and interfaces.
3121
3122         * decl.cs (DeclSpace.ResolveBaseTypeExpr): Make this protected;
3123         set the `ResolvingTypeTree' flag on the EmitContext.
3124
3125         * codegen.cs (EmitContext.ResolvingTypeTree): New public field.
3126
3127 2005-05-10  Marek Safar  <marek.safar@seznam.cz>
3128
3129         * class.cs (Method.Define): Catch attempt for Finalizer declaration.
3130         
3131         * expression.cs (Argument.GetParameterModifier): Turned to property.
3132         (Invocation.Error_InvalidArguments): Add more descriptive errors.
3133         
3134         * parameter.cs (Parameter.GetModifierSignature): Translates modifier to
3135         its C# equivalent.
3136         
3137 2005-05-09  Raja R Harinath  <rharinath@novell.com>
3138
3139         Fix #74852.
3140         * decl.cs (MemberCache.AddMethods): Register override methods,
3141         rather than non-override methods.
3142         * typemanager.cs (RegisterOverride): New.
3143         (IsOverride): Update.
3144
3145 2005-05-09  Marek Safar  <marek.safar@seznam.cz>
3146
3147         * typemanager.cs (TypeManager): Moved InitGenerics to Reset method.
3148
3149 2005-05-06  Martin Baulig  <martin@ximian.com>
3150
3151         * attribute.cs
3152         (Attributable.IsClsComplianceRequired): Fix typo in the method name.
3153         (AttributeTester.AnalyzeTypeCompliance): Add generics support.
3154
3155 2005-05-09  Marek Safar  <marek.safar@seznam.cz>
3156
3157         Fix #73105.
3158         
3159         * ecore.cs (SimpleName.SimpleNameResolve): Add in_transit to catch
3160         recursive declaration.
3161         
3162         * statement.cs (Block.ResolveMeta): Report any error in resolving.
3163         
3164 2005-05-06  Marek Safar  <marek.safar@seznam.cz>
3165
3166         * cfold (DoConstantNumericPromotions): Don't try to convert 0 enum.
3167         
3168         * expression.cs (Binary.DoResolve): (x && 0) is always 0.
3169
3170 2005-05-05  Raja R Harinath  <rharinath@novell.com>
3171
3172         Fix #74797.
3173         * decl.cs (DeclSpace.FamilyAccessible): 
3174         Use TypeManager.IsNestedFamilyAccessible.
3175
3176         Fix reopened #64812.
3177         * typemanager.cs (Closure.Filter): Introduce checks for 'protected
3178         internal'.
3179
3180 2005-05-04  Raja R Harinath  <rharinath@novell.com>
3181             Abin Thomas  <projectmonokochi@rediffmail.com>
3182             Anoob V E  <projectmonokochi@rediffmail.com>
3183             Harilal P R  <projectmonokochi@rediffmail.com>
3184
3185         Fix #64812.
3186         * typemanager.cs (Closure.CheckValidFamilyAccess): Don't blindly
3187         allow access to all static members.
3188
3189 2005-05-04  Martin Baulig  <martin@ximian.com>
3190
3191         * ecore.cs (FieldExpr.DoResolveLValue): Always call fb.SetAssigned().
3192
3193 2005-05-04  Martin Baulig  <martin@ximian.com>
3194
3195         Fix #74655.
3196
3197         * statement.cs (Switch.SimpleSwitchEmit): Always emit the default
3198         section at the end; make things work if `default' is not the last
3199         section.        
3200
3201 2005-05-04  Martin Baulig  <martin@ximian.com>
3202
3203         Fix #70400.
3204
3205         * statement.cs (Switch): Replaced the `got_default' field with a
3206         `default_section' one.
3207         (Switch.CheckSwitch): Set `default_section' here.
3208         (Switch.Resolve): If we're a constant switch and the constant is
3209         not found, use the default section.
3210
3211 2005-05-03  Martin Baulig  <martin@ximian.com>
3212
3213         * expression.cs (ArrayAccess.EmitGetLength): New public method.
3214
3215         * statement.cs (Foreach.ArrayForeach): New nested class.
3216         (Foreach.TemporaryVariable): New nested class.
3217         (Foreach.EmitArrayForeach): Removed; this is now in the new
3218         ArrayForeach class.
3219
3220 2005-05-03  Raja R Harinath  <rharinath@novell.com>
3221
3222         * pending.cs (BaseImplements): Move the #74773 fix here.  This is
3223         more conservative.
3224         (VerifyPendingMethods): Revert change below.
3225
3226         * typemanager.cs (IsOverride, RegisterNonOverride): New.
3227         * decl.cs (MemberCache.AddMethod): Register "non-override" methods
3228         that used to trigger warning -28.  Remove warning -28.
3229         * expression.cs (Invocation.OverloadResolve): Use
3230         TypeManager.IsOverride to distinguish override methods.
3231
3232         Fix #74773.
3233         * pending.cs (VerifyPendingMethods): If a base type implements the
3234         requested interface, don't bother checking individual methods of
3235         the base type.  As a side-effect, this prevents the creation of
3236         unnecessary proxies.
3237
3238 2005-05-02  Martin Baulig  <martin@ximian.com>
3239
3240         Fix #70182.
3241
3242         * flowanalysis.cs (FlowBranching.UsageVector.MergeJumpOrigins):
3243         Also `And' the locals if the old vector is null.
3244         (FlowBranching.UsageVector.BitVector.And): Allow `vector' being
3245         null; in this case we basically reset all the variables.        
3246
3247 2005-05-02  Martin Baulig  <martin@ximian.com>
3248
3249         Fix #74529.
3250
3251         * flowanalysis.cs (FlowBranching.UsageVector.MergeBreakOrigins):
3252         Added `FlowBranching branching' argument; always `and' the
3253         variables instead of `or'ing them unless we're an infinite loop.
3254
3255         * statement.cs (While.Resolve): Create a new sibling unless we're
3256         infinite.       
3257
3258 2005-05-02  Martin Baulig  <martin@ximian.com>
3259
3260         Fix #70140.
3261
3262         * class.cs (ConstructorInitializer.Resolve): Added `Block block'
3263         arguments; use it instead of creating a new TopLevelBlock.
3264         (Constructor.Emit): Call `block.ResolveMeta ()' before resolving
3265         our ConstructorInitializer.
3266
3267         * statement.cs
3268         (TopLevelBlock.TopLevelBranching): New public property.
3269         (TopLevelBlock.ResolveMeta): New public method; call ResolveMeta()
3270         and create our `TopLevelBranching'.
3271
3272         * codegen.cs (EmitContext.ResolveTopBlock): If we're not an
3273         anonymous method host, use `block.TopLevelBranching' rather than
3274         creating a new branching.
3275
3276 2005-04-20  Miguel de Icaza  <miguel@novell.com>
3277
3278         * anonymous.cs (ScopeInfo.AddChild): when adding a new child to
3279         a ScopeInfo, if any of the current children is a child of the new
3280         entry, move those children there.
3281
3282 2005-04-30  Martin Baulig  <martin@ximian.com>
3283
3284         * statement.cs (Switch.SimpleSwitchEmit): Reset `default_at_end'
3285         at the beginning of a SwitchSection.  Fix #73335.
3286
3287 2005-04-27  Marek Safar  <marek.safar@seznam.cz>
3288
3289         Fix #74378
3290         * class.cs (EmitFieldInitializers): Use FieldExpr in initializer.
3291         
3292         * ecore.cs (FieldExpr): Add a new ctor with in_initializer.
3293         (FieldExpr.DoResolve): Obsolete members are ignored for field
3294         initializers.
3295         
3296 2005-04-26  Marek Safar  <marek.safar@seznam.cz>
3297
3298         * attribute.cs (AreOverloadedMethodParamsClsCompliant): Add array
3299         of arrays detection.
3300
3301         * class.cs (Interface.VerifyClsCompliance): Add base interfaces
3302         verification.
3303         (Field.VerifyClsCompliance): Volatile fields are not compliant.
3304
3305         * decl.cs (MemberCache.VerifyClsParameterConflict): Add array of
3306         arrays report.
3307
3308 2005-04-25  Ben Maurer  <bmaurer@ximian.com>
3309
3310         * cs-parser.jay: Use the prefered version of -unsafe in error
3311         message.
3312
3313 2005-04-22  Marek Safar  <marek.safar@seznam.cz>
3314
3315         * driver.cs (CompilerCallableEntryPoint.Invoke): Reset under any
3316         circumstances.
3317
3318 2005-04-20  John Luke  <john.luke@gmail.com>
3319
3320         * driver.cs: fix typo in error message, --outout to --output
3321
3322 2005-04-30  Martin Baulig  <martin@ximian.com>
3323
3324         * attribute.cs (Attribute.CheckSecurityActionValidity): Correctly
3325         handle the .NET 2.x security attributes.
3326
3327 2005-04-30  Martin Baulig  <martin@ximian.com>
3328
3329         * typemanager.cs
3330         (TypeManager.ExpandInterfaces): Don't add things twice.
3331
3332         * class.cs
3333         (TypeContainer.VerifyClsCompliance): Allow generic instances.
3334
3335 2005-04-29  Martin Baulig  <martin@ximian.com>
3336
3337         * generic.cs (Constraints.ResolveTypes): Expand interfaces.
3338
3339         * anonymous.cs: Added support for anonymous generic methods.
3340
3341 2005-04-29  Martin Baulig  <martin@ximian.com>
3342
3343         * typemanager.cs (TypeManager.GetInterfaces): Correctly handle
3344         generic instances.
3345
3346 2005-04-29  Martin Baulig  <martin@ximian.com>
3347
3348         * generic.cs (TypeManager.HasConstructorConstraint): Removed.
3349
3350         * expression.cs (New.DoResolve): Fix the CS0304 check.
3351
3352 2005-04-29  Martin Baulig  <martin@ximian.com>
3353
3354         * typemanager.cs (TypeManager.GetFullName): Updated to the new
3355         naming schema.
3356
3357         * class.cs (MethodCore.IsDuplicateImplementation): If we're an
3358         explicit interface implementation, compare the interface types.
3359         (MethodData.Define): Use the new naming scheme from the latest
3360         .NET 2.x beta2.
3361         (MemberBase.DoDefineBase): Resolve `InterfaceType' here.
3362
3363         * decl.cs (MemberName.GetMemberName): Removed.
3364         (MemberName.MethodName, FullName): New properties.
3365
3366 2005-04-25  Raja R Harinath  <rharinath@novell.com>
3367
3368         * gmcs.exe.config: Update v2.0.40607 -> v2.0.50215.
3369
3370 2005-04-22  Martin Baulig  <martin@ximian.com>
3371
3372         * generic.cs (GenericMethod): Create the EmitContext in the
3373         `Define()'; in `Define(MethodBuilder)', create the type parameters
3374         before calling `Define()'.  Fixes #73933.
3375
3376 2005-04-22  Martin Baulig  <martin@ximian.com>
3377
3378         * generic.cs
3379         (Constraints.Resolve): Make things work wrt. the new type lookup system.
3380         (ConstructedType.ResolveAsTypeTerminal): Don't override this.
3381
3382         * ecore.cs (Expression.ResolveAsTypeTerminal): If `te' is a
3383         ConstructedType, check its constraints.
3384
3385 2005-04-20  Marek Safar  <marek.safar@seznam.cz>
3386
3387         * codegen.cs (InRefOutArgumentResolving): New field.
3388         
3389         * ecore.cs (FieldExpr.DoResolve): Check for assigning to readonly
3390         fields outside contructor.
3391         
3392         * expression.cs (Argument.Resolve): Set InRefOutArgumentResolving.
3393         
3394 2005-04-19  Miguel de Icaza  <miguel@novell.com>
3395
3396         * anonymous.cs (CaptureContext.EmitParameterInstance): The
3397         parameter code was not completed ever, so it was not as up-to-date
3398         as local variables.  Must finish it.
3399
3400         The bug fix was to compare the Toplevel of the block, not the
3401         current block.  Thanks for Ben for pointing this out. 
3402
3403 2005-04-19  Raja R Harinath  <rharinath@novell.com>
3404
3405         * decl.cs (AddMethods): Use the declaring type of the problem
3406         method to determine if we want to squash a warning.
3407
3408 2005-04-19  Marek Safar  <marek.safar@seznam.cz>
3409
3410         * attribute.cs: Removed debug output.
3411
3412         * decl.cs (MemberCache.AddMethods): Fixed Finalize ignoring.
3413         
3414         * driver.cs (Driver.parse): Synchronize parser ErrorOutput with
3415         Report.Stderr.
3416         
3417 2005-04-18  Raja R Harinath  <rharinath@novell.com>
3418
3419         Fix #74481.
3420         * expression.cs (Binary.EqualsNullIsReferenceEquals): New.
3421         (Binary.DoResolveOperator): Use it to avoid blindly optimizing out
3422         all null comparisons against reference types.
3423
3424 2005-04-18  Marek Safar  <marek.safar@seznam.cz>
3425
3426         Fix# 74565
3427         * class.cs (TypeContainer.CircularDepException) New nested
3428         exception class.
3429         (GetPartialBases, GetNormalBases, GetClassBases): Removed error.
3430         (TypeContainer.DefineType): Removed error, reset InTransit before
3431         exit.
3432         (Class.DefineType): Throw exception when is in Transit.
3433         Catch exception and report error.
3434         (Struct.DefineType): Throw exception when is in Transit.
3435         Catch exception and report error.
3436         (Interface.DefineType): Throw exception when is in Transit.
3437         Catch exception and report error.
3438
3439         * codegen.cs: Add InCatch,InFinally to EmitContext to easily
3440         handle nested exception handlers.
3441
3442         * flowanalysis.cs (InTryWithCatch): New method, search for try with
3443         a catch.
3444
3445         * iterators.cs (Yield.CheckContext): Add CS1626 report. Updated
3446         InFinally and InCatch storage.
3447
3448         * statement.cs (Throw.Resolve): Use InCatch, InFinally from ec.
3449         (Catch.Resolve): Set and Restore ec.InCatch.
3450         (Try.Resolve): Set and Restore ec.InFinally.
3451         (Try.HasCatch): True when try has catch.
3452
3453 2005-04-17  Atsushi Enomoto  <atsushi@ximian.com>
3454
3455         * doc.cs : In some cases FilterName returns MonoEvent and MonoField
3456           for the same event member, so exclude such cases from warning 419.
3457           Fixed bug #74633.
3458
3459 2005-04-16  Miguel de Icaza  <miguel@novell.com>
3460
3461         * expression.cs (Binary.ResolveOperator): Apply patch from John
3462         Luke to fix bug 59864: operators &, | and ^ on enumerations
3463         require that the same enum type on both sides.
3464
3465         * driver.cs: Add warnings to old flag usage, this is to assist
3466         people who produce Makefiles and hope that the Makefiles will be
3467         used on Windows.
3468
3469         * class.cs (TypeContainer.EmitType): Moved the definition of the
3470         special $PRIVATE$ field from the resolve phase to the Emit phase.
3471         During resolve we do not know if we are a struct with
3472         HasExplicitLayout, we know this only after the attributes for the
3473         type are emitted.
3474
3475         Set the FieldOffset to zero on the dummy field that we create for
3476         the class.   Fixes 74590.
3477
3478 2005-04-16  Raja R Harinath  <rharinath@novell.com>
3479
3480         Fix #73834.
3481         * ecore.cs (PropertyExpr.resolved): New.
3482         (DoResolve): Use it to handle a case of double resolution here.
3483         Handle a case of identical-name-and-type-name.
3484         * expression.cs (ArrayCreation.CheckIndices): Avoid double
3485         resolution by storing the results of expression resolution back
3486         into the "probes" array.
3487
3488 2005-04-15  Raja R Harinath  <rharinath@novell.com>
3489
3490         Fix cs0208-7.cs and cs0208-8.cs.
3491         * typemanager.cs (IsUnmanagedType): Arrays are not allowed
3492         (cf. ECMA standard, behaviour of CSC 1.1 and CSC 2.0).  Improve
3493         error reporting to point out the reason a struct is not unmanaged.
3494
3495 2005-04-13  Atsushi Enomoto  <atsushi@ximian.com>
3496
3497         * doc.cs : In FindDocumentedType(), avoid TypeExpr.ResolveType() and 
3498           just use TypeExpr.Type. This fixes bug #74595 when merged to gmcs.
3499
3500 2005-04-13  Raja R Harinath  <rharinath@novell.com>
3501
3502         Fix #74528.
3503         * ecore.cs (PropertyExpr.InstanceResolve): Handle a case of
3504         IdenticalNameAndTypeName here.
3505         (EventExpr.InstanceResolve): Likewise.
3506
3507 2005-04-13  Marek Safar  <marek.safar@seznam.cz>
3508
3509         C# 2.0 DefaultCharSetAttribute implementation
3510         
3511         * attribute.cs (Attribute.ResolveAsTypeStep): New protected method
3512         which allows us to set GlobalNamespace for every resolve.
3513         (Attribute.ResolveArguments): Cut from Resolve.
3514         (Attribute.GetCharSetValue): Returns CharSet named argument.
3515         (Attribute.DefinePInvokeMethod): Gets default charset from
3516         module settings.
3517         (GlobalAttribute.ResolveAsTypeStep): Override.
3518         (GlobalAttribute.ResolveArguments): Override.
3519         
3520         * class.cs (TypeAttr): Is protected.
3521         
3522         * codegen.cs (ModuleClass.DefaultCharSet): New member.
3523         (ModuleClass.DefaultCharSetType): New memeber.
3524         (ModuleClass.ResolveAttributes): Resolves DefaultCharSetAttribute.
3525         
3526         * decl.cs (Decl.TypeAttr): New protected virtual. Returns default
3527         charset from module.
3528         
3529         * delegate.cs (TypeAttr): Override.
3530         (Delegate.DefineType): Use this TypeAttr.
3531         
3532         * driver.cs (Driver.MainDriver): Call Module.ResolveAttributes
3533         at very early stage (before types are defined) to resolve model
3534         module attributes. It will probably not work with corlib but it
3535         should be ok.
3536         
3537         * enum.cs (Enum.TypeAttr): New protected virtual. Returns default
3538         charset from module.
3539         
3540         * typemanager.cs (default_charset_type): New type.
3541
3542 2005-04-13  Raja R Harinath  <rharinath@novell.com>
3543
3544         * decl.cs (MemberCache.AddMethods): Don't warn if
3545         System.Object.Finalize has buggy MethodAttributes.
3546
3547         * typemanager.cs (IsUnmanagedType): Restore !IsValueType check
3548         removed below.
3549
3550 2005-04-13  Atsushi Enomoto  <atsushi@ximian.com>
3551
3552         * doc.cs : detect ambiguous reference to overloaded members.
3553           Fixed bug #71603. MS 1.1 csc does not detect it.
3554
3555 2005-04-13  Atsushi Enomoto  <atsushi@ximian.com>
3556
3557         * doc.cs : delegates must not be referenced with parameters.
3558           Fixed bug #71605.
3559
3560 2005-04-12  Miguel de Icaza  <miguel@novell.com>
3561
3562         * typemanager.cs (IsUnmanagedType): Arrays are allowed.
3563
3564 2005-04-10  Miguel de Icaza  <miguel@novell.com>
3565
3566         * driver.cs (MainDriver): Stop processing if the CLS stage found
3567         errors. 
3568
3569         (CompilerCallableEntryPoint.InvokeCompiler): Always
3570         reset after execution;   Take a TextWriter argument for the
3571         output.
3572
3573         * report.cs: Use the error stream instead of hardcoding stderr. 
3574
3575 2005-04-09  Miguel de Icaza  <miguel@novell.com>
3576
3577         * class.cs: Reduce code paths to test, too small of an
3578         optimization to make it worth the extra testing.  Always perform
3579         it. 
3580
3581 2005-04-08  Raja R Harinath  <rharinath@novell.com>
3582
3583         Fix #74510.
3584         * class.cs (OperatorArrayList.CheckPairedOperators): Skip
3585         operators that had errors reported on them.
3586
3587 2005-04-08  Marek Safar  <marek.safar@seznam.cz>
3588
3589         * attribute.cs (Attribute.IsValidArgumentType): Test valid named
3590         argument types.
3591         (Attribute.Resolve): Add named argument type checking.
3592         
3593         * class.cs (FixedField.Define): Use IsPrimitiveType
3594         
3595         * expression.cs (Binary.ResolveOperator): Reflect IsCLRType renaming.
3596         
3597         * iterators.cs (Iterator.DefineIterator): Add check for arglist and
3598         unsafe parameter types.
3599         
3600         * statement.cs (Using.ResolveExpression): Add better error description.
3601         
3602         * typemanager.cs (IsCLRType): Renamed to IsPrimitiveType.
3603         
3604 2005-04-08  Raja R Harinath  <rharinath@novell.com>
3605
3606         Fix #74484.
3607         * attribute.cs (Attribute.GetAttributeUsage): Resolve
3608         AttributeUsageAttribute in the emitcontext of the attribute class,
3609         not in the emitcontext of the attributable entity it was attached to.
3610         * cs-parser.jay: Use 'current_class', not 'current_container',
3611         when creating a GlobalAttribute.
3612
3613 2005-04-08  Alp Toker  <alp@atoker.com>
3614
3615         * pending.cs: The fix to #58413 failed to compile methods implementing
3616         interfaces with/without params modifiers and vice versa, even though
3617         params modifiers aren't part of the signature. Make the modifier check
3618         less strict as in csc.
3619
3620 2005-04-07  Abin Thomas  <projectmonokochi@rediffmail.com>
3621             Anoob V E  <projectmonokochi@rediffmail.com>
3622             Harilal P R  <projectmonokochi@rediffmail.com>
3623
3624         Fix #58413.
3625         * pending.cs (TypeAndMethods.mods): New.  Store the parameter
3626         modifiers of pending methods.
3627         (PendingImplementation.PendingImplementation): Initialize it.
3628         Add Parameter.Modifier [][] mods and initialize it with ParameterData.
3629         (PendingImplementation.InterFaceMethod): Repalce Type[] argument
3630         with ParameterData.  Add check for modifiers.
3631         * class.cs (MethodData.Define): Update to changes.
3632
3633 2005-04-07  Raja R Harinath  <rharinath@novell.com>
3634
3635         * ecore.cs (Expression.IsAccessorAccessible): Clarify code somewhat.
3636
3637 2005-04-07  Marek Safar  <marek.safar@seznam.cz>
3638
3639         * class.cs (PropertyMethod.Define): Check private accessor in abstract
3640         property.
3641         
3642         * decl.cs (DeclSpace.ApplyAttributeBuilder): Don't allow RequiredAttribute
3643         
3644         * rootcontext.cs,
3645         * typemanager.cs: Registered RequiredAttributeAttribute.
3646         
3647 2005-04-06  Marek Safar  <marek.safar@seznam.cz>
3648
3649         * class.cs (VerifyMembers): Doesn't need EmitContext argument.
3650         Warning CS0169 is back at level 3.
3651         (IMethodData.SetMemberIsUsed): New method.
3652         
3653         * decl.cs (IsUsed): New value; moved from FieldBase.Status
3654         (SetMemberIsUsed, IsUsed): New methods, encapsulate IsUsed.
3655         
3656         * delegate.cs (ResolveMethodGroupExpr): Call SetMemberIsUsed.
3657
3658         * ecore.cs (FieldExpr.ResolveMemberAccess): Call SetMemberIsUsed for
3659         contants.
3660         (PropertyExpr.ResolveAccessors): Call SetMemberIsUsed when delegate
3661         is used.
3662         
3663         * expression.cs (OverloadResolve): Call SetMemberIsUsed. when method
3664         is used.
3665         
3666         * rootcontext.cs (RootContext.EmitCode): Call VerifyMembers in extra run
3667         to avoid the problems with nested types.
3668
3669 2005-04-05  Abin Thomas  <projectmonokochi@rediffmail.com>
3670             Anoob V.E  <projectmonokochi@rediffmail.com>
3671             Harilal P.R  <projectmonokochi@rediffmail.com>
3672             Raja R Harinath  <rharinath@novell.com>
3673
3674         Fix #73820.
3675         * delegate.cs (Define): Emit ParamArrayAttribute for 'params'
3676         attribute.
3677         * typemanager (GetConstructor): Make public.
3678
3679 2005-04-05  John Luke  <john.luke@gmail.com>
3680             Raja R Harinath  <rharinath@novell.com>
3681
3682         Fix #62232.
3683         * typemanager.cs (IsUnmanagedType): Check non-public fields of a
3684         struct too.  Return false quicker in a few cases.
3685         (VerifyUnManaged): Use it.
3686
3687 2005-04-05  Raja R Harinath  <rharinath@novell.com>
3688
3689         Fix #74041.
3690         * statement.cs (Block.Resolve): Initialize 'unreachable' to false,
3691         not 'unreachable_seen'.
3692
3693 2005-04-04  Marek Safar  <marek.safar@seznam.cz>
3694
3695         * attribute.cs (Attribute.GetValue): Removed unused.
3696         
3697         * codegen.cs (CodeGen.TrimExt): Removed unused.
3698         
3699         * cs-parser.jay (output): Removed unused.
3700         
3701         * cs-tokenizer.cs (hex_digits): Removed unused.
3702         
3703         * enum.cs (MapToInternalType, GetEnumeratorName): Removed unused.
3704         
3705         * expression.cs (Indirection.LoadExprValue): Removed unused.
3706         (ArrayCreation.ExpressionToArrayArgument): Removed unused.
3707         
3708         * iterators.cs (Iterator.param_types): Removed unused.
3709         
3710         * statement.cs (Goto.block): Removed unused.
3711         (ToplevelBlock.did): Removed unused.
3712         (Switch.ResolveConstantSwitch): Removed unused.
3713
3714 2005-04-01  Ben Maurer  <bmaurer@ximian.com>
3715
3716         * rootcontext.cs: Allow mcs to bootstrap with the compilation
3717         resetting thingy.
3718
3719 2005-04-19  Martin Baulig  <martin@ximian.com>
3720
3721         Merged r42462 from MCS and made it work for GMCS.
3722
3723         * class.cs (MethodCore.ds): Moved this field to `MemberBase'.
3724
3725         * generic.cs (GenericMethod.Define): Removed `return_type' argument.
3726
3727 2005-04-01  Raja R Harinath  <rharinath@novell.com>
3728
3729         Fix #74232 and cs0208-3.cs.
3730         * expression.cs (ComposedCast.DoResolveAsTypeStep): Add CS0208 check.
3731         * typemanager.cs (IsUnmanagedType): Don't allow 'object' as an
3732         unmanaged type.  Don't use FieldBuilders when 't' is a
3733         TypeBuilder.  Use ModFlags and MemberType fields.
3734         * class.cs (MemberBase.member_type): Rename from MemberType.
3735         (MemberBase.MemberType): New property.  Determines member_type on
3736         demand.
3737         (MemberBase.DoDefine): Don't initialize MemberType here.
3738         (FieldMember.Define): Likewise.
3739
3740 2005-04-01  Marek Safar  <marek.safar@seznam.cz>
3741
3742         Fix #74241
3743         * class.cs (Event.Emit): Call Add/Remove emit even for interfaces.
3744         Attributes are emitted there.
3745         
3746 2005-04-01  Raja R Harinath  <rharinath@novell.com>
3747
3748         * cs-tokenizer.cs (consume_identifier): Treat 'partial' as a
3749         keyword in 'partial enum' too.
3750         * cs-parser.jay (enum_declaration): Add CS0267 check ('partial enum'
3751         is not allowed).
3752         Report from Kamil Skalski <nazgul@omega.pl>.
3753
3754         Fix #74309.
3755         * rootcontext.cs (ResolveTree): The 'root.Interfaces' list can
3756         have partial containers too.
3757
3758         * ecore.cs (SimpleName.SimpleNameResolve): Move 'invariant meaning
3759         in block' checks to Block.CheckInvariantMeaningInBlock.
3760         * statement.cs (Block.GetKnownVariableInfo): Make private.
3761         (Block.IsVariableUsedInChildBlock): Remove.
3762         (Block.IsVariableUsedInBlock): Likewise.
3763         (Block.CheckInvariantMeaningInBlock): New.  Show location of
3764         conflicting declaration.
3765         (Block.AddVariable): Make error messages less long-winded and more
3766         specific.  Show location of conflicting declaration.
3767         * parameter.cs (Parameters.Location): New readonly property.
3768
3769 2005-03-31  Raja R Harinath  <rharinath@novell.com>
3770
3771         Clean up semantics of invoking ResolveMemberAccess.
3772         * ecore.cs (SimpleName.DoSimpleNameResolve): If a MemberExpression
3773         can have an instance, ensure that we pass in a non-TypeExpression
3774         to ResolveMemberAccess.  Tighten up IdenticalNameAndTypeName checks.
3775         (MemberExpr.DoSimpleNameResolve): Remove type_is_inferred
3776         argument.  Update to changes and simplify.
3777         (FieldExpr.Emitinstance): Remove CS0120 check.
3778         (PropertyExpr.EmitInstance): Likewise.
3779         * expression.cs (Argument.Resolve): Likewise.
3780         (Invocation.DoResolve): Update to changes in semantics of
3781         InstanceExpression.
3782
3783 2005-03-31  Marek Safar  <marek.safar@seznam.cz>
3784
3785         Fix #74241
3786         * class.cs (AbstractPropertyEventMethod.EmitMethod): Enable emit method
3787         customization.
3788         
3789         * decl.cs (MemberCache.AddMethods): Fix infinite loop.
3790
3791 2005-03-31  Raja R Harinath  <rharinath@novell.com>
3792
3793         Fix difference in behaviour with commandline invocation.
3794         * driver.cs (Driver.Reset): New.
3795         (CompilerCallableEntryPoint): Call it.
3796
3797         * statement.cs (If.Resolve): Avoid spurious "uninitialized
3798         variable" warnings if the boolean expression failed to resolve.
3799
3800 2005-03-30  Sebastien Pouliot  <sebastien@ximian.com>
3801
3802         * attribute.cs: Fix the union of several permissions when some of them
3803         are unrestricted (so the result isn't an unrestricted permission set).
3804         Fix #74036.
3805
3806 2005-03-30  Raja R Harinath  <rharinath@novell.com>
3807
3808         * ecore.cs (MemberExpr): New class.  Convert from interface
3809         IMemberExpr.
3810         (MemberExpr.ResolveMemberAccess): Refactor and move here from
3811         MemberAccess.ResolveMemberAccess.  Tighten up pre-conditions and
3812         error checks.
3813         (MethodGroupExpr, FieldExpr, PropertyExpr, EventExpr): Update.
3814         (MethodGroupExpr.IsExplicitImpl): Remove.
3815         (Expression.GetFieldFromEvent): Remove.
3816         (SimpleName.MemberStaticCheck): Remove.
3817         (SimpleName.DoSimpleNameResolve): Update to changes.
3818         * expression.cs (MemberAccess.ResolveMemberAccess): Refactor.
3819         (MemberAccess.IdenticalNameAndTypeName): Remove.
3820         (MemberAccess.error176): Move to MemberExpr.
3821         (MemberAccess.DoResolve): Update to changes.
3822         (BaseAccess.DoResolve): Likewise.
3823
3824 2005-03-30  Marek Safar  <marek.safar@seznam.cz>
3825
3826         C# 2.0 Conditional attribute class implementation
3827         
3828         * attribute.cs (AttributeTester.IsAttributeExcluded): New method.
3829         Analyzes class whether it has attribute which has ConditionalAttribute
3830         and its condition is not defined.
3831         
3832         * class.cs (Class.ApplyAttributeBuilder): Add IsAttributeExcluded check.
3833         (Class.IsExcluded): New method. Search for at least one defined
3834         condition in ConditionalAttribute of attribute class.
3835
3836 2005-03-30  Raja R Harinath  <rharinath@novell.com>
3837
3838         * ecore.cs (PropertyExpr): Derive from Expression, not
3839         ExpressionStatement.
3840         (PropertyExpr.EmitStatement): Remove.
3841
3842 2005-03-29  Raja R Harinath  <rharinath@novell.com>
3843
3844         Fix #74060.
3845         * expression.cs (MemberAccess.ResolveMemberAccess): Allow the
3846         internal field "value__" of an enum be private.  The examples for
3847         "value__" that I found on MSDN all used FieldAttributes.Private.
3848
3849         * decl.cs (MemberCache.AddMethods): Use C# terminology in warning.
3850         Don't mention IL method attribute names.
3851
3852         Fix #47991.  Remove a TODO.
3853         * statement.cs (Block.Toplevel): Make into a field.
3854         (Block.Parameters): Move into ToplevelBlock.
3855         (Block.known_variables): Rename from child_variable_names.
3856         (Block.Block): Remove variants that take Parameters.  Initialize
3857         'Toplevel' with the immediately surrounding toplevel block.
3858         (Block.AddKnownVariable): Rename from AddChildVariableName.  Add a
3859         LocalInfo parameter.
3860         (Block.GetKnownVariableInfo): New.
3861         (Block.IsVariableNameUsedInChildBlock): Update.
3862         (Block.IsVariableNameUsedInBlock): New.  Checks if a name is used in
3863         the block, even though it may not be in scope.
3864         (Block.AddVariable): Remove Parameters parameter.  Use
3865         Toplevel.Parameters instead.
3866         (Block.AddConstant): Remove Parameters parameter.
3867         (Block.GetParameterReference): Update to use Toplevel.Parameters.
3868         (Block.IsParamaterReference): Likewise.
3869         (Block.IsLocalParameter): Likewise.  Simplify a lot.
3870         (ToplevelBlock.Parameters): New.  Moved from Block.
3871         (ToplevelBlock.ToplevelBlock): Update to changes.  Always
3872         initialize Parameters to a non-null value.
3873         * cs-parser.jay: Update to changes.
3874         * ecore.cs (SimpleName.SimpleNameResolve): Emit cs0136 error for
3875         simple names that mean different things in the same block.  Use
3876         Block.IsVariableNameUsedInBlock.
3877
3878 2005-03-28  Raja R Harinath  <rharinath@novell.com>
3879
3880         * enum.cs (Enum.LookupEnumValue): Remove debugging code.
3881
3882 2005-03-26  Raja R Harinath  <harinath@acm.org>
3883
3884         Fix #73038.
3885         * assign.cs (Assign.DoResolve): When the RHS of an assignment
3886         fails to resolve, ensure that the LHS is still resolved as an
3887         lvalue.
3888
3889 2005-03-25  Raja R Harinath  <harinath@acm.org>
3890
3891         * enum.cs (Enum.DefineType): Set ec.InEnumContext and
3892         ec.ContainerType.
3893         (Enum.current_ec): Remove.
3894         (Enum.LookupEnumValue): Remove EmitContext argument.
3895         Just uses the one created during DefineType.
3896         (Enum.FindMembers): Update.
3897         * expression.cs (MemberAccess.DoResolve): Update.
3898
3899 2005-03-22  Marek Safar  <marek.safar@seznam.cz>
3900
3901         * assign.cs (Assign.DoResolve): Check for CS1717 when
3902         source and target are same (uses Equals).
3903
3904         * expression.cs (LocalVariableReference, ParameterReference,
3905         This): Implemented Equals, GetHashCode.
3906
3907         * statement.cs (Block.GetParameterReference): Removed useless
3908         local variable.
3909
3910 2005-03-22  Raja R Harinath  <rharinath@novell.com>
3911
3912         Fix cs0128.cs
3913         * statement.cs (Block.AddVariable): Ensure that we skip implicit
3914         blocks before deciding whether the error is cs0136 or cs0128.
3915
3916         * cs-parser.jay: Pass MemberName to RootContext.Tree.RecordDecl.
3917         (using_alias_directive, using_namespace_directive): Pass
3918         MemberName, not an expression to Namespace.UsingAlias and
3919         Namespace.Using.
3920         (MakeName): Use the MemberName of the namespace.
3921         * namespace.cs (Namespace.MemberName): New.
3922         (UsingEntry.UsingEntry): Take a MemberName, not an expression.
3923         (AliasEntry.AliasEntry, Namespace.Using, Namespace.UsingAlias):
3924         Likewise.
3925         * decl.cs (MemberName.Name): Make readonly.
3926         (MemberName.FromDotted): New "constructor".
3927         (MemberName.Equals, MemberName.GetHashCode): Implement overrides.
3928         (MemberCore.Name): Compute from MemberName on demand.
3929         (MemberCore.SetMemberName): Provide a way to change the
3930         MemberName.
3931         (MemberCore.AddToContainer): Don't take a fullname parameter.
3932         * class.cs (TypeContainer.AddToMemberContainer): Don't add the
3933         fully qualified name of the container to the member name.
3934         (TypeContainer.AddToTypeContainer): Use a fully qualified name
3935         only if the type is a member of the root container.
3936         (TypeContainer.AddMethod, TypeContainer.AddProperty): Use
3937         MemberName.Left rather than searching for an embedded ".".
3938         (PartialContainer.CreatePart): Update to changes in RootContext.
3939         (MemberBase.ShortName): Turn into a property.  Use
3940         MemberCore.SetMemberName.
3941         (MemberBase.ExplicitInterfaceName): Remove.
3942         (MemberBase.UpdateMemberName): Remove.
3943         (AbstractPropertyEventMethod.UpdateName): Use SetMemberName.
3944         (PropertyBase.SetMemberName): New override.
3945         * tree.cs (Tree.RecordDecl): Take a MemberName and use it as hash key.
3946         (Tree.GetDecl): New.
3947         (Tree.AllDecls): Rename from Decls.
3948         * attribute.cs, enum.cs, report.cs: Update to changes.
3949         * driver.cs (MainDriver): Use MemberName.FromDotted on
3950         RootContext.MainClass.
3951
3952 2005-03-21  Marek Safar  <marek.safar@seznam.cz>
3953
3954         * class.cs (FixedField.Define): Check for CS1664 and more sanity
3955         checks.
3956
3957         * expression.cs (ElementAccess.DoResolveLValue): Check for CS1708.
3958
3959 2005-03-18  Marek Safar  <marek.safar@seznam.cz>
3960
3961         * modifiers.cs (Modifiers.PROPERTY_CUSTOM): New constant for
3962         property accessor modifiers.
3963
3964         * class.cs (FieldMember.ApplyAttributeBuilder): Don't allow apply
3965         fixed buffer attribute (CS1716).
3966         (PropertyMethod.HasCustomAccessModifier): When property accessor
3967         has custom modifier.
3968
3969         * ecore (PropertyExpr.DoResolve): Add CS0271 for custom accessor
3970         modifiers.
3971         (PropertyExpr.DoResolveLValue): Add CS0272.
3972
3973 2005-03-17  Miguel de Icaza  <miguel@novell.com>
3974
3975         * convert.cs: When converting to a pointer, use the proper Conv.U
3976         or Conv.I depending on the source data type.
3977
3978         * cs-tokenizer.cs: Make the size for large decimal constants,
3979         fixes #72957.
3980
3981 2005-03-17  Martin Baulig  <martin@ximian.com>
3982
3983         * anonymous.cs (AnonymousMethod.method_modifiers): Change default
3984         from `Modifiers.INTERNAL' to `Modifiers.PRIVATE'.  Fixes #73260.
3985
3986 2005-03-17  Martin Baulig  <martin@ximian.com>
3987
3988         * anonymous.cs (AnonymousMethod.EmitMethod): Changed return type
3989         to bool so we can return an error condition.
3990         (AnonymousDelegate.Emit): Check whether AnonymousMethod.EmitMethod()
3991         returned an error.
3992
3993 2005-03-16  Zoltan Varga  <vargaz@freemail.hu>
3994
3995         * attribute.cs: Encode ThrowOnUnmappableChar and BestFitMapping
3996         attributes.
3997
3998 2005-03-16  Raja R Harinath  <rharinath@novell.com>
3999
4000         Remove TypeManager.LookupType and TypeManager.LookupTypeDirect.
4001         Refactor to avoid traversing the list of assemblies, and to avoid
4002         string concatenation.
4003         * typemanager.cs (guid_attr_type): Remove.
4004         (negative_hits, pointers, references): Remove hashes.
4005         (type_hash): New.
4006         (GetConstructedType): New.  Uses type_hash to handle constructed
4007         types (arrays, references, pointers).
4008         (GetReferenceType, GetPointerType): Use it.
4009         (GetNestedType): New.  Uses type_hash to handle nested types of
4010         reflected types.
4011         (LookupType, LookupTypeDirect): Remove.
4012         (CoreLookupType): Inline parts of old LookupTypeDirect code.  Use
4013         'types' hash and LookupTypeReflection directly.
4014         (params_string, params_object): Use GetConstructedType.
4015         * namespace.cs (Namespace.cached_types): New.  Cache of reflected
4016         top-level types.
4017         (Namespace.Lookup): Use cached_types.
4018         (NamespaceEntry.LookupNamespaceOrType): Inline the functionality
4019         provided by old TypeManager.LookupType.
4020         * rootcontext.cs (MakeFQN): Remove.
4021         * decl.cs (DeclSpace.MakeFQN): Likewise.
4022         (DeclSpace.LookupType): Use TypeManager.GetNestedType.
4023         * expression.cs (ComposedCast.DoResolveAsTypeStep): Use
4024         TypeManager.GetConstructedType.
4025         * tree.cs (decl_ns_hash, LookupByNamespace): Remove.
4026
4027 2005-04-16  Zoltan Varga  <vargaz@freemail.hu>
4028
4029         * cs-parser.jay: Fix build.
4030
4031 2005-03-15  Marek Safar  <marek.safar@seznam.cz>
4032
4033         * class.cs (TypeContainer.CircularDepException) New nested
4034         (MethodCore.CheckBase): Report CS1715 for properties and indexers.
4035
4036         * cs-parser.jay: Reports CS1527 for any namespace element.
4037
4038         * delegate.cs (DelegateCreation.Error_NoMatchingMethodForDelegate):
4039         Added CS0407.
4040
4041         * expression.cs (ParameterReference.IsAssigned): Changed error to
4042         CS0269.
4043         (Error_WrongNumArguments): Moved CS0245 detection here.
4044
4045         * statement.cs (Return.Resolve): Add CS1622 report.
4046
4047 2005-03-11  Marek Safar  <marek.safar@seznam.cz>
4048
4049         * class.cs (StaticClass.DefineContainerMembers): Added CS0720.
4050
4051 2005-03-11  Zoltan Varga  <vargaz@freemail.hu>
4052
4053         * attribute.cs expression.cs: Get rid of some allocations.
4054
4055 2004-03-11  Atsushi Enomoto  <atsushi@ximian.com>
4056
4057         * doc.cs : just eliminate the latest change.
4058
4059 2004-03-10  Atsushi Enomoto  <atsushi@ximian.com>
4060
4061         * doc.cs : commented out the latest change. It breaks xml-030.cs
4062
4063 2004-03-10  Atsushi Enomoto  <atsushi@ximian.com>
4064
4065         * doc.cs : When TypeBuilder did not create Type yet, GetEvents() will
4066           fail. So invoke CreateType() in FindDocumentedType().
4067
4068 2004-03-10  Atsushi Enomoto  <atsushi@ximian.com>
4069
4070         * cs-tokenizer.cs : added IsKeyword().
4071         * doc.cs : Detect keyword incorrectly used as identifier.
4072           Allow identifiers prefixed by @.
4073
4074 2005-03-10  Marek Safar  <marek.safar@seznam.cz>
4075
4076         * attributes.cs (Attributes.Emit): Continue after CheckTargets.
4077         It caused exception in namespace resolving (again!).
4078         
4079         * class.cs (Class.ctor): Removed exit.
4080         (PropertyMethod.ctor): ditto.
4081         
4082         * codegen.cs (Codegen.Reset): Reset static data.
4083         (Codegen.ResolveTopBlock): Forward error status from ResolveMeta.
4084         
4085         * cs-tokenizer.cs (Cleanup): Removed.
4086         
4087         * driver.cs (GetSystemDir): Rewrote to one line command.
4088         It caused problem with unloaded dynamic modules.
4089         (UnixParseOption): Removed Exit.
4090         (CompilerCallableEntryPoint.InvokeCompiler): Make static.
4091         (CompilerCallableEntryPoint.Reset): Reset suitable static data.
4092         Now can be mcs used as library.
4093         
4094         * ecore.cs (Expression.ResolveBoolean): Use Location.Null for
4095         empty location.
4096         
4097         * location.cs (Reset): Reset static data.
4098         
4099         * namespace.cs (Reset): Reset static data.
4100         
4101         * report.cs (Report.Reset): Reset static data.
4102         
4103         * rootcontext.cs (RootContext.Reset): Reset static data.
4104         
4105         * tree.cs (RootTypes.ctor): Use Location.Null
4106         
4107         * typemanager.cs (TypeManager.Reset): Reset static data.
4108         (CoreLookupType): Removed Exit.
4109         (TypeHandle.Reset): Reset static data.
4110         
4111 2005-03-10  Raja R Harinath  <rharinath@novell.com>
4112
4113         Fix #73516.
4114         * typemanager.cs (ComputeNamespaces): Import namespaces from
4115         referenced modules too.
4116
4117 2005-03-09  Raja R Harinath  <rharinath@novell.com>
4118
4119         * class.cs (TypeContainer.AddToMemberContainer): Use "." rather
4120         than '.'.
4121
4122 2005-03-09  Raja R Harinath  <rharinath@novell.com>
4123
4124         * decl.cs (DeclSpace.LookupType): Don't loop but recurse into
4125         enclosing DeclSpace.  This ensures that a name-lookup populates
4126         more caches and there are fewer 'TypeExpression's.  Carve out
4127         nested type lookup into ...
4128         (LookupNestedTypeInHierarchy): ... this.
4129
4130 2005-04-15  Martin Baulig  <martin@ximian.com>
4131
4132         Merged r41590 from MCS and make it work in the generics land.
4133
4134         * generic.cs (TypeParameter.UpdateConstraints): Removed the
4135         `check' argument.
4136
4137         * class.cs (PartialContainer.UpdateConstraints): Removed.
4138         (PartialContainer.CheckConstraints): Removed.
4139         (PartialContainer.SetParameterInfo): Store the constraints here.
4140         (PartialContainer.DefineTypeParameters): New public method;
4141         resolve the type parameter's constraints here.  Note that the
4142         PartialContainer doesn't have an EmitContext anymore, so we must
4143         do this in the ClassPart.
4144
4145 2005-03-09  Raja R Harinath  <rharinath@novell.com>
4146
4147         Clean up a few partial-class semantics.  
4148         Fixes test-357.cs and cs1618-2.cs.
4149         * cs-parser.jay (struct_declaration): Use 'current_class' as
4150         parent of newly-created struct.  Remove call to Register ().
4151         Use 'pop_current_class' to complete handing the current struct.
4152         (interface_declaration): Likewise.
4153         (class_declaration): Likewise.
4154         (enum_declaration): Use 'current_class' as parent of newly created
4155         enum.
4156         (delegate_declaration): Likewise.
4157         (pop_current_class): New function.  This is used to handle closing
4158         up the 'current_class' and 'current_container', and pointing them
4159         to the enclosing class/container.
4160         (CSharpParser): Initialize 'current_class' too.
4161         * decl.cs (MemberCore): Add check for invariant: a partial
4162         container is not a parsed entity, and thus does not enclose any
4163         parsed members.
4164         (DeclSpace.TypeResolveEmitContext): Expose 'type_resolve_ec'.
4165         (DeclSpace.BaseTypeExpr): Use it.
4166         (DeclSpace.LookupType): Add check for invariant.
4167         * class.cs (TypeContainer): Add check for invariant: a nested
4168         class should have the same NamespaceEntry as its enclosing class.
4169         (TypeContainer.EmitFieldInitializers): Make virtual.
4170         (TypeContainer.DefineDefaultConstructor): Adhere to invariant in
4171         MemberCore.
4172         (TypeContainer.Register): Remove.
4173         (TypeContainer.DefineType): Set the 'ec' of a PartialContainer to
4174         null.  Use TypeResolveEmitContext for resolving base types and
4175         interfaces.  Move initialization of Parts.TypeBuilder here from
4176         ...
4177         (TypeContainer.DefineNestedTypes): ... here.
4178         (PartialContainer): Take a Namespace not a NamespaceEntry.
4179         (PartialContainer.Create): Don't use Register.  Call the
4180         appropriate Add... function directly.
4181         (ClassPart): Take both the PartialContainer and the enclosing
4182         class as constructor arguments.
4183         (ClassPart.EmitFieldInitializers): Override.
4184         (ClassPart.PartFindNestedTypes): Remove.
4185         (FieldBase.GetInitializerExpression): Resolve the initializer
4186         expression in the emit context of the enclosing class.
4187         * tree.cs (RootTypes): Remove Register ().
4188         
4189 2005-03-08  Marek Safar  <marek.safar@seznam.cz>
4190
4191         * cs-parser.jay: Removed CS0134.
4192         
4193         * driver.cs: Removed CS1901.
4194         
4195         * expression.cs (SizeOf.DoResolve): Don't report CS0233
4196         for predefined types.
4197
4198 2005-03-07  Duncan Mak  <duncan@novell.com>
4199
4200         * codegen.cs (Save):  Catch UnauthorizedAccessException as
4201         well. Fixes bug #73454.
4202
4203 2005-03-07  Marek Safar  <marek.safar@seznam.cz>
4204
4205         * cs-tokenizer.cs (xtoken): Add CS1035.
4206         
4207         * class.cs (MethodData.Define): Add CS0683.
4208         (FieldMember.ctor): Add CS0681.
4209
4210 2005-03-07  Raja R Harinath  <rharinath@novell.com>
4211
4212         * ecore.cs (SimpleName.DoResolve): Rename from
4213         SimpleName.DoResolveAllowStatic.
4214         (SimpleName.DoSimpleNameResolve): Remove 'allow_static' argument.
4215         Pass 'intermediate' flag to MemberStaticCheck.
4216         (SimpleName.MemberStaticCheck): Skip "static check" only in case
4217         of "intermediate" lookups via MemberAccess.
4218         (SimpleName.IdenticalNameAndTypeName): New.  Carved out of ...
4219         * expression.cs (MemberAccess.IdenticalNameAndTypeName): ... this.
4220
4221 2005-03-07  Raja R Harinath  <rharinath@novell.com>
4222
4223         Fix #73394.
4224         * ecore.cs (FieldExpr.EmitInstance): Catch cases of CS0120 that
4225         slipped in because of variable names that are identical to a
4226         builtin type's BCL equivalent ('string String;', 'int Int32;').
4227         (PropertyExpr.EmitInstance): Likewise.
4228
4229 2005-03-04  Marek Safar  <marek.safar@seznam.cz>
4230
4231         * cs-tokenizer.cs (PreProcessPragma): Add warning 1633, 1635.
4232         
4233         * report.cs (warning_ignore_table): Made public.
4234
4235 2005-03-04  Raja R Harinath  <rharinath@novell.com>
4236
4237         Fix #73282.
4238         * class.cs (MethodData.Emit): Pass 'container' to
4239         container.GetObsoleteAttribute instead of 'container.Parent'.
4240
4241 2005-03-03  Marek Safar  <marek.safar@seznam.cz>
4242
4243         * cs-parser.jay: Add 1534 error test.
4244
4245         * iterators.cs (Yield.CheckContext): Add error 1629.
4246         (Iterator.ctor): Save unsafe modifier.
4247         (MoveNextMethod.DoEmit): Restore unsafe context.
4248
4249         * namespace.cs (UsingAlias): Better error message.
4250
4251 2005-03-03  Dan Winship  <danw@novell.com>
4252
4253         * convert.cs (Error_CannotImplicitConversion): fix two bugs in
4254         the warning message [#73219]
4255
4256 2005-03-03  Raja R Harinath  <rharinath@novell.com>
4257
4258         Fix compile with MCS 1.0.0.0.
4259         * cs-tokenizer.cs (PreProcessPragma): Simplify w_disable and
4260         w_restore to not depend on string constant folding.
4261
4262 2005-03-03  Raja R Harinath  <rharinath@novell.com>
4263
4264         * decl.cs (DeclSpace.LookupType): Remove 'silent' argument.  Move
4265         CS0246 check to users who passed 'silent = false'.
4266         * ecore.cs (TypeLookupExpression.DoResolveAsTypeStep): Add CS0246
4267         check.
4268         (SimpleName.SimpleNameResolve): Update.
4269         * expression.cs (ComposedCast.DoResolveAsTypeStep): Add CS0246 check.
4270         (MemberAccess.IdenticalNameAndTypeName): Update.
4271         * doc.cs (FindDocumentedTypeNonArray): Update.
4272
4273 2005-03-03  Raja R Harinath  <rharinath@novell.com>     
4274
4275         * codegen.cs (EmitContext): Remove ResolvingTypeTree.
4276         * parameters.cs (ComputeAndDefineParameters): Remove.
4277         * decl.cs (ResolveBaseTypeExpr): Don't set ResolvingTypeTree.
4278         * delegate.cs (Define): Don't invoke ComputeAndDefineParameters.
4279         Use GetParameterInfo.
4280
4281 2005-03-02  Marek Safar  <marek.safar@seznam.cz>
4282
4283         * report.cs (StaticClass.DefineContainerMembers): Add warning 628.
4284
4285 2005-03-02  Raja R Harinath  <rharinath@novell.com>
4286
4287         Unify DeclSpace.LookupType and DeclSpace.FindType.
4288         * decl.cs (DeclSpace.FindNestedType): New virtual function.  This
4289         is in charge of defining nested types on demand.
4290         (DeclSpace.LookupType): Use it when the current_type is a
4291         TypeBuilder.  Use LookupTypeDirect for reflected types.
4292         (DeclSpace.FindType): Remove.
4293         (DeclSpace.LookupInterfaceOrClass): Likewise.
4294         (DeclSpace.DefineTypeAndParents): Likewise.
4295         * ecore.cs (SimpleName.ResolveAsTypeStep): Just call
4296         DeclSpace.LookupType.
4297         * doc.cs (FindDocumentedTypeNonArray): Use DeclSpace.LookupType.
4298         * typemanager.cs (LookupType): Simplify.
4299         (AddUserType): Remove type from negative_hits.
4300         * namespace.cs (Namespace.Lookup): Use TypeManager.LookupTypeDirect.
4301         * class.cs (TypeContainer.FindMembers): Move handling of nested
4302         types ...
4303         (TypeContainer.FindMembers_NestedTypes): ... here.
4304         (TypeContainer.FindNestedType): Implement override.
4305         (ClassPart.FindNestedType): Delegate to PartialContainer.
4306         (ClassPart.PartFindNestedType): Looks up the nested types of the
4307         part alone.
4308
4309 2005-04-14  Martin Baulig  <martin@ximian.com>
4310
4311         * generic.cs (ConstructedType): Moved all the type lookup and
4312         nested class logic into SimpleName.
4313         (ConstructedType.ResolveConstructedType): Our underlying type is
4314         already fully resolved; all the type lookup stuff is in
4315         SimpleName.
4316
4317         * ecore.cs (SimpleName.ResolveAsTypeStep): Resolve nested
4318         constructed types here instead of in ConstructedType.
4319
4320         * decl.cs (MemberName.GetTypeExpression): Always create a
4321         SimpleName, not a ConstructedType.
4322         (DeclSpace.ResolveNestedType): Removed; this is now in SimpleName.
4323
4324 2005-03-02  Martin Baulig  <martin@ximian.com>
4325
4326         * class.cs (TypeContainer.DoDefineMembers): We also need a default
4327         static constructor in static classes.
4328
4329 2005-03-01  Zoltan Varga  <vargaz@freemail.hu>
4330
4331         * attribute.cs: Pass -1 to DefineLPArrayInternal if sizeConst or
4332         sizeParamIndex is not specified.
4333
4334 2005-03-01  Marek Safar  <marek.safar@seznam.cz>
4335
4336         Fix #73117
4337         * report.cs (WarningMessage.IsEnabled): Missing null check.
4338
4339 2005-02-28  Marek Safar  <marek.safar@seznam.cz>
4340
4341         * attribute.cs (DefinePInvokeMethod): Fix, all data are stored
4342         in the fields and not in the properties.
4343
4344 2005-02-28  Zoltan Varga  <vargaz@freemail.hu>
4345
4346         * attribute.cs (GetMarshal): Marshal SizeConst and SizeParamIndex 
4347         fields as well.
4348
4349 2005-02-28  Marek Safar  <marek.safar@seznam.cz>
4350
4351         * attribute.cs: Small refactoring (improved robustness).
4352         (ImplOptions, UnmanagedType, UsageAttribute): Removed members.
4353         (ValidateGuid): Removed.
4354         (Resolve): Removed referenced to above mentioned.
4355         (GetAttributeUsage): Made private and changed to work without
4356         class assistance.
4357         (GetIndexerAttributeValue): Don't crash.
4358         (GetConditionalAttributeValue): Ditto.
4359         (GetClsCompliantAttributeValue): Ditto.
4360         (ExtractSecurityPermissionSet): All attributes exceptions are
4361         error 648.
4362         (GetPropertyValue): New helper.
4363         (GetMethodImplOptions): New method.
4364         (DefinePInvokeMethod): Reuse common code. Implemented handling of
4365         some missing properties.
4366         
4367         * class.cs (ClassOrStruct.ApplyAttributeBuilder): Updated.
4368         (Method.ApplyAttributeBuilder): Updated.
4369         
4370         * decl.cs (DeclSpace.ApplyAttributeBuilder): Don't catch shared
4371         exception.
4372
4373 2005-02-28  Raja R Harinath  <rharinath@novell.com>
4374
4375         Fix #73052.
4376         * report.cs (Report.SymbolRelatedToPreviousError): Handle
4377         non-simple types (array, pointer, reference).
4378
4379 2005-02-28  Marek Safar  <marek.safar@seznam.cz>
4380
4381         * cs-parser.jay: Add errors 1617, 650, 1007, 531, 547, 548
4382
4383         * class.cs (MethodCore.IsDuplicateImplementation): Special error
4384         for operators.
4385         (Method.CheckBase): Catch wrong destructor here.
4386         (MethodData.Define): Add errors 550, 668.
4387
4388         * cs-tokenizer.cs (PreProcessPragma): Add warning 1634.
4389
4390         * ecore.cs (PropertyExpr.DoResolveLValue): Fixed wrong error code.
4391
4392         * pending.cs (VerifyPendingMethods): Add error 551.
4393
4394         * typemanager.cs (CSharpName): Next error report helper.
4395
4396 2005-02-25  Marek Safar  <marek.safar@seznam.cz>
4397
4398         * attribute.cs (Atttribute.Resolve): Add cache for parameter-less
4399         attributes. Removed useless attribute double check.
4400         It saves almost 2MBs for corlib.
4401
4402 2005-02-25  Raja R Harinath  <rharinath@novell.com>
4403
4404         Fix #72924.
4405         * statement.cs (ExpressionStatement.Resolve): Make robust to being
4406         called twice in case of error.
4407
4408 2005-02-23  Chris Toshok  <toshok@ximian.com>
4409
4410         Fix compiler portions of #72827.
4411         * statement.cs (Block.Emit): call Begin/EndScope on the
4412         EmitContext instead of the ILGenerator.
4413
4414         * codegen.cs (EmitContext.BeginScope): new method, call
4415         ILGenerator.BeginScope as well as the SymbolWriter's OpenScope (if
4416         we have one.)
4417         (EmitContext.BeginScope): same, but EndScope and CloseScope
4418
4419         * symbolwriter.cs (SymbolWriter.OpenScope): get the current il
4420         offset and call the superclass's OpenScope(int) with it.
4421         (SymbolWriter.CloseScope): get the current il
4422         offset and call superclass's CloseScope(int) with it.
4423
4424 2005-02-23  Marek Safar  <marek.safar@seznam.cz>
4425
4426         * anonymous.cs (AnonymousMethod.Compatible): Fixed to report
4427         CS1677 for out and ref as well.
4428
4429         * class.cs (Method.Define): Add error CS1599 detection.
4430         
4431         * cs-parser.jay: Add CS1609, CS1670, CS1627 detection.
4432         
4433         * cs-tokenizer.cs (xtoken): Add error CS1646 detection.
4434         
4435         * delegate.cs (Delegate.Define): Add error CS1599 detection.
4436         
4437         * support.cs.cs (ModifierDesc): New helper method.
4438
4439 2005-02-23  Raja R Harinath  <rharinath@novell.com>
4440             Abin Thomas  <projectmonokochi@rediffmail.com>
4441             Anoob V E  <projectmonokochi@rediffmail.com>
4442             Harilal P R  <projectmonokochi@rediffmail.com>
4443
4444         Fix #57851, #72718.
4445         * class.cs (ConstructorBuilder.Resolve): Make sure that the second
4446         MemberLookup (used for error reporting) actually returns a result.
4447         Fix error report number (122, not 112).
4448
4449 2005-02-22  Abin Thomas  <projectmonokochi@rediffmail.com>
4450             Anoob V E  <projectmonokochi@rediffmail.com>
4451             Harilal P R  <projectmonokochi@rediffmail.com>
4452
4453         Fix #71134.
4454         * pending.cs (PendingImplementation.GetAbstractMethods):
4455         Find NonPublic members too.
4456
4457 2005-02-22  Marek Safar  <marek.safar@seznam.cz>
4458
4459         * expression.cs.cs (ConditionalLogicalOperator.DoResolve):
4460         Fixed error 217.
4461         
4462         * class.cs (MethodCore.CheckMethodAgainstBase):
4463         Add error 239 report.
4464
4465 2005-02-21  Marek Safar  <marek.safar@seznam.cz>
4466
4467         * ecore.cs (PropertyExpr.DoResolve): Add error 214 report.
4468         
4469         * class.cs (Operator.Define): Add error 217 report.
4470         
4471 2005-02-21  Raja R Harinath  <rharinath@novell.com>
4472
4473         Fix #68955.
4474         * expression.cs (Invocation.IsApplicable): Make public.
4475         (Invocation.IsParamsMethodApplicable): Likewise.
4476         * delegate.cs (Delegate.VerifyApplicability): Don't use
4477         Invocation.VerifyArgumentCompat for parameter applicability
4478         testing.  Use Invocation.IsApplicable and
4479         Invocation.IsParamsMethodApplicable.
4480
4481 2005-02-21  Marek Safar  <marek.safar@seznam.cz>
4482
4483         * ecore.cs (PropertyExpr.DoResolve): Add error 214 report.
4484         
4485         * class.cs (Operator.Define): Add error 217 report.
4486         
4487 2005-02-21  Raja R Harinath  <rharinath@novell.com>
4488
4489         * namespace.cs (UsingEntry.Resolve): Undo change below.
4490
4491 2005-02-21  Raja R Harinath  <rharinath@novell.com>
4492
4493         Fix #72756.
4494         * ecore.cs (Expression.MemberLookupFailed): Add argument to
4495         disable the error message when the extended MemberLookup also
4496         fails.
4497         (Expression.MemberLookupFinal): Update.
4498         (SimpleName.DoSimpleNameResolve): Update.
4499         * expression.cs (MemberAccess.ResolveNamespaceOrType):
4500         Don't use MemberLookupFinal.
4501         (New.DoResolve): Update.
4502         (BaseAccess.CommonResolve): Update.
4503
4504 2005-02-21  Raja R Harinath  <rharinath@novell.com>
4505
4506         Fix #72732.
4507         * attribute.cs (Attribute.ResolveType): If a 'resolve_error' had
4508         occured previously, don't resolve again.
4509
4510 2005-02-21  Marek Safar  <marek.safar@seznam.cz>
4511
4512         Fix #69949
4513         * attribute.cs (Attribute.GetAttributeUsage): Add EmitContext
4514         argument. Call ResolveAttributeUsage for unresolved.
4515         when types doesn't match ctor arguments.
4516         
4517         * class.cs (DoDefineMembers.TypeContainer): Removed safety check
4518         for nested attribute classes.
4519         (Class.attribute_usage): Removed.
4520         (Class.ResolveAttributeUsage): Resolves AttributeUsageAttribute
4521         for attribute class.
4522         
4523         * ecore.cs (IsAttribute): Removed.
4524         
4525         * namespace.cs (UsingEntry.Resolve): Don't destroy NamespaceEntry.
4526         
4527         * rootcontext.cs (RegisterAttribute): Removed, attributes are
4528         now normal types.
4529         (attribute_types): Removed.
4530         (EmitCode): Global attributes are emited as the latest.
4531
4532 2005-02-18  Marek Safar  <marek.safar@seznam.cz>
4533
4534         * class.cs (EmitFieldInitializers): Don't emit field initializer
4535         for default values when optimilization is on.
4536         
4537         * constant.cs (Constant.IsDefaultValue): New property.
4538         
4539         * driver.cs: Add /optimize handling.
4540         
4541         * constant.cs,
4542         * ecore.cs,
4543         * literal.cs: Implement new IsDefaultValue property.
4544         
4545         * rootcontext.cs (Optimize): New field, holds /optimize option.
4546
4547 2005-02-18  Raja R Harinath  <rharinath@novell.com>
4548
4549         Fix crasher in re-opened #72347.
4550         * namespace.cs (Namespace.Lookup): Return null if
4551         DeclSpace.DefineType returns null.
4552
4553         Fix #72678.
4554         * expression.cs (Argument.Resolve): Handle a case of CS0120 here.
4555
4556 2005-02-18  Raja R Harinath  <rharinath@novell.com>
4557
4558         Fix remainder of #63202.  Change semantics of DoResolveLValue: it
4559         now returns null if it cannot resolve to an lvalue.
4560         * ecore.cs (Expression.DoResolveLValue): Return 'null' by default.
4561         (Expression.ResolveLValue): Emit CS0131 error if DoResolveLValue
4562         returned null.  Remove check for SimpleName.
4563         (EventExpr.DoResolveLValue): New.
4564         * iterators.cs (Iterator.FieldExpression.DoResolveLValue): New.
4565         * expression.cs (Argument.Error_LValueRequired): New.  Move CS1510
4566         error from ...
4567         (Argument.Resolve): ... here.  Use it.  Use DoResolveLValue to
4568         avoid CS0131 error.
4569         (Unary.ResolveOperator): Move CS0211 check ...
4570         (Unary.DoResolve): ... here.  Use DoResolveLValue to avoid
4571         CS0131 error.
4572         (Unary.DoResolveLValue): Simplify.
4573         (AddressOf.DoResolveLValue): New.
4574         (ArrayAccess.DoResolveLValue): New.
4575
4576 2005-02-16  Marek Safar  <marek.safar@seznam.cz>
4577
4578         * attribute.cs (Attribute.Resolve): Add arguments casting for
4579         when types doesn't match ctor arguments.
4580
4581 2005-02-16  Raja R Harinath  <rharinath@novell.com>
4582
4583         Fix parts of #63202.
4584         * expression.cs (UnaryMutator.ResolveOperator): Remove redundant
4585         lookup of operator in base type.  Ensure that all checks happen
4586         when the operator resolves to an "op_..." method.
4587
4588 2005-02-15  Raja R Harinath  <rharinath@novell.com>
4589
4590         Fix #71992.
4591         * namespace.cs (NamespaceEntry.LookupNamespaceOrType): Add
4592         'ignore_cs0104' parameter.  Pass it to ...
4593         (NamespaceEntry.Lookup): ... this.
4594         * decl.cs (DeclSpace.LookupType): Add 'ignore_cs0104' parameter.
4595         * ecore.cs (SimpleName.ResolveAsTypeStep): Update.
4596         (TypeLookupExpression.DoResolveAsTypeStep): Update.
4597         * expression.cs (MemberAccess.IdenticalNameAndTypeName):
4598         Update.  Request that cs0104 errors be ignored.
4599         (ComposedCast.ResolveAsTypeStep): Update.
4600
4601 2005-02-14  Raja R Harinath  <rharinath@novell.com>
4602
4603         Fix #59209.
4604         * expression.cs (Invocation.BetterFunction): Remove support for
4605         comparing virtual functions and their overrides.
4606         (Invocation.IsOverride): New.
4607         (Invocation.OverloadResolve): Don't consider 'override' functions
4608         during candidate selection.  Store them in a lookaside list.
4609         If the selected method is a 'virtual' function, use the list to
4610         find any overrides that are closer to the LHS type.
4611
4612 2005-02-14  Marek Safar  <marek.safar@seznam.cz>
4613
4614         * expression.cs (New.DoResolve): Add complex core type reduction.
4615         (New.Constantify): Converts complex core type syntax like 'new int ()'
4616         to simple constant.
4617         
4618 2005-02-14  Raja R Harinath  <rharinath@novell.com>
4619
4620         * decl.cs (EntryType.EntryType): New constructor to create an
4621         updated copy of a cache entry.
4622         (MemberCache.AddMethods): Use it.
4623         (MemberCache.ClearDeclaredOnly): Remove.
4624         (MemberCache.MemberCache): Update.
4625
4626 2005-02-11  Miguel de Icaza  <miguel@novell.com>
4627
4628         * codegen.cs (EmitContext): Introduce the `MethodIsStatic'
4629         variable.  This one is represents the actual low-level declaration
4630         of the method, as opposed to the semantic level `IsStatic'.   
4631
4632         An anonymous method which is hosted into a static method might be
4633         actually an instance method.  IsStatic would reflect the
4634         container, while MethodIsStatic represents the actual code
4635         generated.
4636
4637         * expression.cs (ParameterReference): Use the new MethodIsStatic
4638         instead of IsStatic.
4639
4640         * anonymous.cs (AnonymousMethod.Compatible): Pass the
4641         Modifiers.STATIC to the Anonymous' Method EmitContext if static is
4642         set on the current EmitContext. 
4643
4644         * expression.cs (Cast): Overload DoResolveLValue so we can pass
4645         resolve our casted expression as an LValue.  This triggers the
4646         proper LValue processing that is later required by Assign.
4647
4648         This fixes 72347.
4649
4650         * cs-tokenizer.cs (pp_and): recurse on pp_and, fixes #61903.
4651
4652 2005-02-11  Marek Safar  <marek.safar@seznam.cz>
4653
4654         C# 2.0 Fixed buffer implementation
4655
4656         * anonymous.cs: Update after RegisterHelperClass renaming.
4657
4658         * attribute.cs (AttributeTester.fixed_buffer_cache):
4659         Cache of external fixed buffers.
4660         (AttributeTester.GetFixedBuffer): Returns IFixedBuffer
4661         implementation if field is fixed buffer else null.
4662
4663         * class.cs
4664         (TypeContainer.AddField): Accept FieldMember instead of Field.
4665         (FieldBase.IsFieldClsCompliant): Extracted code from
4666         VerifyClsCompliance descendant customization.
4667         (FixedField): New class handles fixed buffer fields.
4668         (FixedFieldExternal): Keeps information about imported fixed
4669         buffer.
4670         (IFixedField): Make access to internal or external fixed buffer
4671         same.
4672
4673         * cs-parser.jay: Add fixed buffer parsing.
4674
4675         * ecore.cs (FieldExpr.Emit): Add special emit case for fixed
4676         buffer.
4677
4678         * expression.cs (Indirection): Extended implementation to accept
4679         fixed buffer field.
4680         (PointerArithmetic.Emit): Get element from fixed buffer as well.
4681         (ElementAccess.MakePointerAccess): Get type as parameter.
4682         (DoResolve): Add fixed buffer field expression conversion.
4683         (DoResolveLValue): Ditto.
4684         (FixedBufferPtr): New class. Moved most of original ArrayPtr.
4685         (ArrayPtr): Derives from FixedBufferPtr.
4686         (ArrayPtr.Emit): Add extra emit for array elements.
4687
4688         * flowanalysis.cs.cs (StructInfo): Use FieldMember.
4689
4690         * rootcontext.cs (CloseTypes): Emit CompilerGenerated attribute
4691         for compiler generated types.
4692         (RegisterCompilerGeneratedType): Renamed from RegisterHelperClass.
4693
4694         * statement.cs (Fixed): Refactored to be easier add fixed buffer
4695         and consume less memory.
4696         (Fixed.Resolve): Add fixed buffer case.
4697
4698         * typemanager.cs (compiler_generated_attr_ctor,
4699         fixed_buffer_attr_ctor): Add new 2.0 compiler attributes.
4700         (HasElementType): Add our own implementation to work on every
4701         runtime.
4702
4703 2005-02-11  Miguel de Icaza  <miguel@novell.com>
4704
4705         * anonymous.cs (CaptureContext): Track whether `this' has been
4706         referenced.   
4707
4708         * expression.cs (This.ResolveBase): Call CaptureThis.  Before we
4709         only captured `this' if it was implicitly done (instance
4710         methods/variables were used). 
4711
4712         * codegen.cs (EmitContext.CaptureThis): New method to flag that
4713         `this' must be captured.
4714
4715 2005-01-30  Miguel de Icaza  <miguel@novell.com>
4716  
4717         * anonymous.cs (CreateMethodHost): If there Scope.ScopeTypeBuilder
4718         is null it means that there has been no need to capture anything,
4719         so we just create a sibling.
4720
4721         Renamed `EmitHelperClasses' to `EmitAnonymousHelperClasses'
4722
4723         Just a partial fix.  The other half is fairly elusive.
4724         
4725 2005-02-10  Raja R Harinath  <rharinath@novell.com>
4726
4727         Fix #52586, cs0121-4.cs.
4728         * decl.cs (MemberCache.DeepCopy): Rename from SetupCache.  Take
4729         and return a hashtable.
4730         (MemberCache.ClearDeclaredOnly): New.
4731         (MemberCache.MemberCache): Update to change.  Make a deep copy of
4732         the method_hash of a base type too.
4733         (MemberCache.AddMethods): Adapt to having a deep copy of the base
4734         type methods.  Overwrite entries with the same MethodHandle so
4735         that the ReflectedType is correct.  The process leaves in base
4736         virtual functions and their overrides as distinct entries.
4737         (CacheEntry): Now a class instead of a struct.  It shouldn't alter
4738         matters since it was boxed in a ArrayList before.
4739         (CacheEntry.Member, CacheEntry.EntryType): Remove 'readonly'
4740         modifier.
4741         * expression.cs (Invocation.BetterFunction): Simplify.  Handle the
4742         case of a virtual function and its override (choose the overload
4743         as better).
4744         (Invocation.OverloadResolve): Avoid 'override' members during
4745         'applicable_type' calculation.
4746
4747 2005-03-28  Raja R Harinath  <rharinath@novell.com>
4748
4749         * typemanager.cs (TypeHandle.BaseType): Make into an IMemberContainer.
4750         (TypeHandle.TypeHandle): Use LookupMemberCache rather than
4751         GetTypeHandle.  It is possible for a reflected type to derive from
4752         a TypeBuilder (e.g., int[] derives from the TypeBuilder
4753         System.Array during mscorlib compilation).
4754         * decl.cs (MemberCache.MemberCache): If the base cache doesn't
4755         contain a method_hash, don't create one either.  Don't create a
4756         deep copy of the base cache's method_hash.
4757         (MemberCache.SetupCache): Rename back from DeepCopy.
4758         (MemberCache.AddMethods): Rewrite, now that method_hash isn't
4759         already initialized.  If we see an override function, add its
4760         underlying base virtual function to the member_hash too.
4761
4762 2005-02-09  Raja R Harinath  <rharinath@novell.com>
4763
4764         Combine two near-redundant caches.
4765         * typemanager.cs (method_params): Rename from method_internal_params.
4766         (TypeManager.GetParameterData): New.  Replace
4767         Invocation.GetParameterData.
4768         (TypeManager.LookupParametersByBuilder): Remove.
4769         * expression.cs (Invocation.method_parameter_cache): Remove.
4770         (Invocation.GetParameterData): Remove.
4771         Update to changes.
4772         * anonymous.cs, attribute.cs, convert.cs, delegate.cs:
4773         Update to changes.
4774
4775 2005-02-08  Raja R Harinath  <rharinath@novell.com>
4776
4777         Fix #72015.
4778         * delegate.cs (Delegate.DefineType): When bootstrapping corlib, if
4779         TypeManager.multicast_delegate_type is null, resolve it by looking
4780         up "System.MulticastDelegate".
4781         * rootcontext.cs (RootContext.ResolveCore): Simplify.
4782
4783 2005-02-07  Abin Thomas (NOSIP)  <projectmonokochi@rediffmail.com>
4784             Anoob V.E (NOSIP)  <projectmonokochi@rediffmail.com>
4785             Harilal P.R (NOSIP)  <projectmonokochi@rediffmail.com>
4786
4787         Fix cs0164.cs.
4788         * statement.cs (LabeledStatement.Resolve): Don't set 'referenced'.
4789         (LabeledStatement.AddReference): New.  Set 'referenced'.
4790         (Goto.Resolve): Use it.
4791
4792 2005-02-05  John Luke  <john.luke@gmail.com>
4793
4794         * driver.cs: remove duplicate -doc line in Usage ()
4795
4796 2005-02-04  Raja R Harinath  <rharinath@novell.com>
4797
4798         * location.cs (Location.AddFile): Fix CS2002 error report.
4799
4800 2005-02-02  Martin Baulig  <martin@ximian.com>
4801
4802         * delegate.cs (Delegate.DefineType): Report an internal error if
4803         TypeManager.multicast_delegate_type is null.  See bug #72015 for
4804         details.        
4805
4806 2005-02-02  Raja R Harinath  <rharinath@novell.com>
4807
4808         Fix a crasher in a variant of #31984.
4809         * const.cs (Constant.CheckBase): New override that defers the
4810         new-or-override check in case the base type hasn't been populated
4811         yet.
4812         (Constant.Define): Ensure the new-or-override check is performed.
4813
4814 2005-02-01  Duncan Mak  <duncan@ximian.com>
4815
4816         * const.cs (LookupConstantValue): Check that `ce' is not null
4817         before calling GetValue ().
4818
4819 2005-02-01  Raja R Harinath  <rharinath@novell.com>
4820
4821         Fix test-334.cs (#69519).
4822         * cs-parser.jay (using_alias_directive): Pass in an expression to
4823         NamespaceEntry.UsingAlias.
4824         (using_namespace_directive): Pass in an expression to
4825         NamespaceEntry.Using.
4826         (namespace_name): Don't flatten to a string.
4827         * namespace.cs (NamespaceEntry.AliasEntry): Store an expression.
4828         (NamespaceEntry.AliasEntry.Resolve): Lookup using
4829         ResolveAsTypeStep.
4830         (NamespaceEntry.UsingEntry): Likewise.
4831         (NamespaceEntry.Using,NamespaceEntry.UsingAlias): Update to
4832         changes.
4833         (NamespaceEntry.LookupForUsing): Remove.
4834         (NamespaceEntry.LookupNamespaceOrType): Add support for dotted
4835         names.
4836         (NamespaceEntry.Lookup): Remove support for dotted names.
4837
4838 2005-02-01  Raja R Harinath  <rharinath@novell.com>
4839
4840         * namespace.cs (NamespaceEntry.NamespaceEntry): Simplify, and
4841         split into two.
4842         (NamespaceEntry.ImplicitParent): Compute on demand.
4843         (NamespaceEntry.Doppelganger): New implicit namespace-entry that
4844         parallels the current.
4845         (NamespaceEntry.LookupForUsing): Use it.
4846         (NamespaceEntry.Lookup): If the current namespace-entry is
4847         implicit, don't search aliases and using tables.
4848
4849 2005-02-01  Raja R Harinath  <rharinath@novell.com>
4850
4851         Fix #31984.
4852         * class.cs (TypeContainer.DoDefineMembers): Don't initialize
4853         BaseCache here.
4854         (TypeContainer.BaseCache): Compute on demand.
4855         (TypeContainer.FindMembers): Define constants and types if they're
4856         not already created.
4857         (FieldMember.Define): Move resetting of ec.InUnsafe before error
4858         check.
4859         * const.cs (Constant.Define): Make idempotent.
4860
4861 2005-01-29  Miguel de Icaza  <miguel@novell.com>
4862
4863         * pending.cs: Produce better code (no nops produced by using Ldarg
4864         + value).
4865         
4866         * pending.cs (PendingImplementation.DefineProxy): It was not `arg
4867         i - 1' it should be arg + 1.
4868
4869         Fixes bug #71819.
4870
4871 2005-01-28  Raja R Harinath  <rharinath@novell.com>
4872
4873         * attribute.cs (Attribute.CheckAttributeType): Make private
4874         non-virtual.
4875         (Attribute.ResolveType): Make virtual.
4876         (GlobalAttribute.ResolveType,GlobalAttribute.Resolve): Simplify
4877         handling of RootContext.Tree.Types.
4878
4879 2005-01-27  Raja R Harinath  <rharinath@novell.com>
4880
4881         Update attribute-handling to use the SimpleName/MemberAccess
4882         mechanisms.
4883         * cs-parser.jay (attribute): Pass in an expression to the
4884         constructors of Attribute and GlobalAttribute.
4885         * attribute.cs (Attribute): Take an expression for the name.
4886         (Attribute.ResolvePossibleAttributeTypes): New.  Resolves the
4887         passed in attribute name expression.
4888         (Attribute.CheckAttributeType): Use it.
4889         * ecore.cs (FullNamedExpression.ResolveAsTypeStep): New.
4890         * expression.cs (MemberAccess.ResolveAsTypeStep): Move body to ...
4891         (MemberAccess.ResolveNamespaceOrType): ... here.  Add 'silent'
4892         argument to prevent error messages if the lookup fails.
4893
4894 2005-01-27  Marek Safar  <marek.safar@seznam.cz>
4895
4896         * expression.cs (Indirection): Implemented IVariable interface
4897         to support indirection in AddressOf operator.
4898         (PointerArithmetic.Emit): Add optimalization for case where
4899         result can be precomputed.
4900
4901 2005-01-26  Martin Baulig  <martin@ximian.com>
4902
4903         * class.cs (TypeContainer.AttributeTargets): Return the correct
4904         AttributeTargets depending on our `Kind' instead of throwing an
4905         exception; fixes #71632.
4906
4907 2005-01-26  Marek Safar  <marek.safar@seznam.cz>
4908
4909         Fix #71257
4910         * expression.cs (MemberAccess.ResolveMemberAccess): Add CS0176 test for
4911         constant members.
4912
4913 2005-03-17  Martin Baulig  <martin@ximian.com>
4914
4915         * anonymous.cs (AnonymousMethod.method_modifiers): Change default
4916         from `Modifiers.INTERNAL' to `Modifiers.PRIVATE'.  Fixes #73260.
4917
4918 2005-03-17  Martin Baulig  <martin@ximian.com>
4919
4920         * anonymous.cs (AnonymousMethod.EmitMethod): Changed return type
4921         to bool so we can return an error condition.
4922         (AnonymousDelegate.Emit): Check whether AnonymousMethod.EmitMethod()
4923         returned an error.
4924
4925 2005-03-17  Martin Baulig  <martin@ximian.com>
4926
4927         * generic.cs (TypeMananager.IsIEnumerable): New public method.
4928
4929         * convert.cs (Convert.ImplicitReferenceConversion(Exists)): Allow
4930         converting from an array-type of T to `IEnumerable<T>'.
4931
4932 2005-03-16  Martin Baulig  <martin@ximian.com>
4933
4934         * generic.cs (Nullable.Unwrap): Implement IAssignMethod.
4935         (Nullable.LiftedUnaryMutator): New public class.
4936
4937         * expression.cs (UnaryMutator.DoResolve): Added support for
4938         Nullable Types.
4939
4940 2005-03-14  Martin Baulig  <martin@ximian.com>
4941
4942         * generic.cs (Nullable.NullCoalescingOperator): Implemented.
4943
4944 2005-03-14  Martin Baulig  <martin@ximian.com>
4945
4946         * generic.cs (Nullable.LiftedBinaryOperator): Added support for
4947         the comparision operators `<', `>', `<=' and `>='.
4948
4949 2005-03-13  Martin Baulig  <martin@ximian.com>
4950
4951         * generic.cs
4952         (Nullable.NullLiteral): Renamed to `Nullable.NullableLiteral' to
4953         avoid confusion with the `NullLiteral'.
4954         (Nullable.LiftedBinaryOperator): Correctly implement `==' and '!='.
4955
4956 2005-03-13  Martin Baulig  <martin@ximian.com>
4957
4958         * expression.cs (Binary.ResolveOperator): For `==' and `!=', allow
4959         comparing arbitrary types with the null literal.
4960
4961 2005-03-13  Martin Baulig  <martin@ximian.com>
4962
4963         * generic.cs (Nullable.LiftedBinaryOperator): Add support for the
4964         boolean operators '&&', '||', '&' and '|'.
4965         (Nullable.OperatorTrueOrFalse): New public class.
4966
4967         * ecore.cs (Expression.GetOperatorTrue/False): Return an `Expression'
4968         instead of a `StaticCallExpr'; added support for nullables.
4969
4970 2005-03-10  Martin Baulig  <martin@ximian.com>
4971
4972         * expression.cs
4973         (ArrayAccess.EmitDynamicInitializers): Use `etype.IsValueType'
4974         rather than `etype.IsSubclassOf (TypeManager.value_type)'.      
4975
4976 2005-03-07  Martin Baulig  <martin@ximian.com>
4977
4978         * generic.cs (Nullable.Unwrap): Implement IMemoryLocation and make
4979         it work if `expr' is not an IMemoryLocation.
4980         (Nullable.Lifted): Implement IMemoryLocation.
4981         (Nullable.LiftedConversion.ResolveUnderlying): Use the correct
4982         target type.
4983
4984 2005-03-05  Martin Baulig  <martin@ximian.com>
4985
4986         * generic.cs (Nullable.Unwrap, Wrap): New protected classes.
4987         (Nullable.Lifted): New abstract class; rewrote the lifted conversions.
4988         (Nullable): Added support for lifted unary and binary operators.
4989
4990         * expression.cs (Unary.DoResolve): Added support for nullable types.
4991         (Binary.DoResolve): Likewise.
4992         (Conditional.DoResolve): Likewise.
4993
4994 2005-03-02  Martin Baulig  <martin@ximian.com>
4995
4996         * decl.cs (DeclSpace.SetParameterInfo): Make this virtual.
4997
4998         * class.cs (ClassPart.SetParameterInfo): Override this.
4999         (PartialContainer.SetParameterInfo): Override this.
5000         (TypeContainer.CheckConstraints): New protected method.
5001         (PartialContainer.CheckConstraints): Override this and check
5002         whether the same contraints were specified in all parts of a
5003         partial generic type definition.
5004         (PartialContainer.UpdateConstraints): New public method.
5005
5006         * generic.cs (TypeParameter.UpdateConstraints): New public method.
5007
5008 2005-03-02  Martin Baulig  <martin@ximian.com>
5009
5010         Committing a patch from Carlos Alberto Cortez to fix #72887.
5011
5012         * convert.cs (Convert.ExplicitReferenceConversionExists): Allow
5013         casts from `T []' to `int []'.
5014
5015 2005-03-02  Martin Baulig  <martin@ximian.com>
5016
5017         * generic.cs (TypeManager.IsEqual): Make this symmetric.
5018
5019         * expression.cs (Binary.ResolveOperator): When resolving a
5020         BinaryDelegate, use `TypeManager.IsEqual (l, r)' rather than just
5021         `=='.  Fixes #71866.  See gen-127.cs.
5022
5023 2005-03-02  Martin Baulig  <martin@ximian.com>
5024
5025         * class.cs (TypeContainer.DoDefineMembers): We also need a default
5026         static constructor in static classes.
5027
5028 2005-03-02  Martin Baulig  <martin@ximian.com>
5029
5030         * generic.cs
5031         (NullableType.Name, NullableType.FullName): Add a "?" to the name.
5032         (Nullable.LiftedConversion): Added support for user-defined
5033         conversions.
5034
5035         * cs-tokenizer.cs (Tokenizer.PutbackCloseParens): New public method.
5036
5037         * cs-parser.jay: Use ComposedCast everywhere instead of
5038         NullableType, so we don't need to check for NullableType
5039         everywhere.
5040         (conditional_expression): Added `INTERR CLOSE_PARENS' rule for the
5041         case where we'll be resolved into a `parenthesized_expression_0'
5042         afterwards.
5043
5044         * convert.cs
5045         (Convert.UserDefinedConversion): Added nullable conversions.
5046
5047 2005-02-28  Martin Baulig  <martin@ximian.com>
5048
5049         * generic.cs (TypeManager.IsNullableType): New static method.
5050         (Nullable): New abstract class.
5051         (Nullable.NullLiteral): New public class.
5052         (Nullable.LiftedConversion): New public class.
5053
5054         * cs-parser.jay (non_expression_type): Changed `builtin_types' to
5055         `builtin_types opt_nullable'.
5056
5057         * convert.cs
5058         (Convert.ImplicitConversionStandard): Added nullable conversions.
5059         (Convert.ExplicitConversionStandard): Likewise.
5060         (Convert.ExplicitConversion): Likewise.
5061
5062 2005-02-26  Martin Baulig  <martin@ximian.com>
5063
5064         * expression.cs (ComposedCast.DoResolveAsTypeStep): Allow `dim' to
5065         begin with a "?", for instance "?[]".  Don't do a type lookup if
5066         `dim' is empty.
5067
5068 2005-02-25  Martin Baulig  <martin@ximian.com>
5069
5070         The first part of Nullable Types :-)
5071
5072         * generic.cs (NullableType): New public class.
5073         (NullCoalescingOperator): New public class.
5074         (TypeArguments.Resolve): Add a CS0306 check.
5075
5076         * cs-parser.jay (opt_error_modifier): Removed, this was unused.
5077         (opt_nullable): New rule.
5078         (type): Added `opt_nullable' to `namespace_or_type_name',
5079         `builtin_types' and `pointer_type'.
5080         (array_type): Added `opt_nullable'.
5081         (opt_rank_specifier_or_nullable): New rule; this is the
5082         combination of `opt_rank_specifier' and `opt_nullable'.
5083         (opt_error): New rule; catch errors here.
5084         (nullable_type_or_conditional): New rule; we use this to check for
5085         nullable and still detect the conditional operator.
5086         (local_variable_type): Use `opt_rank_specifier_or_nullable'
5087         instead `opt_rank_specifier'.
5088
5089         * expression.cs (ComposedCast.DoResolveAsTypeStep): Added support
5090         for nullables.
5091
5092 2005-02-24  Martin Baulig  <martin@ximian.com>
5093
5094         * README, README.Changes: Removed; they're old and obsolete.
5095
5096 2005-02-22  Martin Baulig  <martin@ximian.com>
5097
5098         * generic.cs (TypeParameter.Resolve): If resolving the constraints
5099         returned an error, set `constraints' to null to avoid a crash
5100         later on.
5101         (TypeParameter.ResolveType): Likewise.
5102
5103 2005-02-22  Martin Baulig  <martin@ximian.com>
5104
5105         * generic.cs
5106         (Constraints.ResolveTypes): Protect against being called twice.
5107         (Constraints.CheckInterfaceMethod): Don't call ResolveTypes().
5108         (TypeParameter.ResolveType): New public method; calls
5109         constraints.ResolveTypes().
5110         (TypeParameter.DefineType): Moved constraints.ResolveType() out
5111         into the new ResolveType().
5112         (GenericMethod.Define): Call ResolveType() on all our
5113         TypeParameter's.        
5114
5115 2005-02-21  Martin Baulig  <martin@ximian.com>
5116
5117         * generic.cs
5118         (TypeManager.generic_nullable_type): New static public field.
5119         (TypeManager.InitGenericCoreType): Lookup "System.Nullable`1".
5120
5121         * rootcontext.cs
5122         (RootContext.ResolveCore): Resolve "System.Nullable`1".
5123
5124 2005-02-15  Martin Baulig  <martin@ximian.com>
5125
5126         * generic.cs (ConstructedType.Constraints): Correctly check
5127         constraints if the argument type is a type parameter; fixes
5128         #72326. 
5129
5130 2005-02-02  Martin Baulig  <martin@ximian.com>
5131
5132         * delegate.cs (Delegate.DefineType): Report an internal error if
5133         TypeManager.multicast_delegate_type is null.  See bug #72015 for
5134         details.        
5135
5136 2005-01-29  Miguel de Icaza  <miguel@novell.com>
5137
5138         * pending.cs: Produce better code (no nops produced by using Ldarg
5139         + value).
5140         
5141         * pending.cs (PendingImplementation.DefineProxy): It was not `arg
5142         i - 1' it should be arg + 1.
5143
5144         Fixes bug #71819.
5145         
5146 2005-01-26  Martin Baulig  <martin@ximian.com>
5147
5148         * cs-parser.jay (indexer_declarator): Don't report an error if we
5149         have type parameters since we can be an explicit interface
5150         implementation; fixes #71449.
5151
5152 2005-01-26  Martin Baulig  <martin@ximian.com>
5153
5154         * class.cs (TypeContainer.AttributeTargets): Return the correct
5155         AttributeTargets depending on our `Kind' instead of throwing an
5156         exception; fixes #71632.
5157
5158 2005-01-26  Martin Baulig  <martin@ximian.com>
5159
5160         * delegate.cs (Delegate.DefineType): Correctly define our type
5161         parameters.  Fixes #71483.
5162
5163 2005-01-25  Raja R Harinath  <rharinath@novell.com>
5164
5165         Fix #71602.
5166         * expression.cs (MemberAccess.DoResolve): Don't complain with
5167         cs0572 when the LHS of a member access has identical name and type
5168         name.
5169
5170 2005-01-25  Marek Safar  <marek.safar@seznam.cz>
5171
5172         Fix #71651, #71675
5173         * attribute.cs (ExtractSecurityPermissionSet): Catch exceptions from
5174         CreatePermission.
5175         Create custom PermissionSet only for PermissionSetAttribute.
5176
5177 2005-01-24  Marek Safar  <marek.safar@seznam.cz>
5178
5179         Fix #71649
5180         * class.cs (StaticClass.DefineContainerMembers): Enable enums and
5181         delegates in static class.
5182
5183 2005-01-24  Martin Baulig  <martin@ximian.com>
5184
5185         * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
5186         merging an implicit block, just use its reachability.
5187
5188         * statement.cs (Block.Resolve): Make the unreachable code check
5189         work wrt. implicit blocks; see test-337 from #63842.
5190
5191 2005-01-21  Alp Toker  <alp@atoker.com>
5192  
5193         * cs-parser.jay: destructor_declaration's container is PartialContainer
5194         not Class when partial types are used, so use Kind prop instead of
5195         'is'.
5196         
5197 2005-01-22  Miguel de Icaza  <miguel@ximian.com>
5198
5199         * cs-parser.jay: Improve error reporting when an interface
5200         declares new types.
5201
5202 2005-01-20  Dick Porter  <dick@ximian.com>
5203
5204         * support.cs: SeekableStreamReader fix from Sandor Dobos
5205         (dobos_s@ibcnet.hu) to cope with Position setting when multibyte
5206         chars are read.  Fixes bug 70369.
5207
5208 2005-01-20  Raja R Harinath  <rharinath@novell.com>
5209
5210         * cs-parser.jay (catch_clause): Simplify current_block handling
5211         somewhat.
5212
5213 2005-01-17  Miguel de Icaza  <miguel@ximian.com>
5214
5215         * convert.cs (ImplicitStandardConversionExists): Synchronize the
5216         code with ImplicitStandardConversion to handle the implicit
5217         conversion of method groups into valid delegate invocations. 
5218
5219         The problem is that in parameter handling we were using this code
5220         path.  Fixes bug #64698
5221
5222 2005-01-19  Raja R Harinath  <rharinath@novell.com>
5223
5224         * cs-parser.jay: Fix several infelicities.
5225         - Avoid assigning to the parser value stack.  Code like 
5226           '$3 = null' is unclean.  Synthesize a value for the code block
5227           instead. 
5228         - Avoid using oob_stack for storing location information.  Use ...
5229         (_mark_): ... this.  New (empty) rule.  Saves the current location
5230         in $$.
5231         (foreach_statement): Avoid using oob_stack for current_block
5232         handling.  Use technique used in for_statement and
5233         using_statement.  Synthesize a value for the code block to store
5234         additional intermediate information.
5235
5236 2005-01-13  Miguel de Icaza  <miguel@ximian.com>
5237
5238         * ecore.cs (IsAccessorAccessible): Accessibility to private fields
5239         of a different type is only allowed to private fields of a
5240         containing type, not on fields of a base class.
5241
5242         See test-174.cs and error cs0122-9.cs
5243
5244 2005-01-13  Raja R Harinath  <rharinath@novell.com>
5245
5246         Fix test-335.cs (bug #58126).
5247         * cs-parser.jay (argument): Split out non-expression parts of the
5248         rule into 'non_simple_argument'.
5249         (invocation_expression): Support parenthesized invocations with
5250         multiple arguments, and with single non-simple arguments.
5251
5252 2005-01-13  Raja R Harinath  <rharinath@novell.com>
5253
5254         * cs-tokenizer.cs (xtoken): Reset 'comments_seen' in a couple more
5255         places.
5256
5257 2005-01-12  Raja R Harinath  <rharinath@novell.com>
5258
5259         Fix cs0038-1.cs, cs1640-6.cs.
5260         * ecore.cs (Expression.Resolve): Remove special-case for
5261         SimpleName in error-handling.
5262         (Expression.almostMatchedMembers): Relax access permission to
5263         protected.
5264         (Expression.MemberLookupFailed): Handle duplicates in
5265         almostMatchedMembers list.
5266         (SimpleName.DoSimpleNameResolve): Catch CS0038 errors earlier.
5267         * expression.cs (New.DoResolve): Report CS1540 for more cases.
5268         * typemanager.cs (GetFullNameSignature): Use the MethodBase
5269         overload if the passed in MemberInfo is a MethodBase.
5270
5271 2005-01-25  Martin Baulig  <martin@ximian.com>
5272
5273         * doc.cs
5274         (DocUtil.emptyParamList): Removed; use `Type.EmptyTypes' instead.
5275
5276 2005-01-12  Marek Safar  <marek.safar@seznam.cz>
5277
5278         Fix #70749
5279         * attribute.cs (ExtractSecurityPermissionSet): Don't report error
5280         for non-CAS & merge permission sets properly.
5281
5282 2005-01-11  Raja R Harinath  <rharinath@novell.com>
5283
5284         Improve standard-compliance of simple name and member access 
5285         resolution.  Fixes bugs #52697, #57200, #67520, #69519.
5286         * ecore.cs (FullNamedExpression): New abstract base class 
5287         for Namespaces and TypeExpressions.
5288         (ResolveFlags.SimpleName): Remove.
5289         (SimpleName): Remove support for dotted names.
5290         (SimpleName.ResolveAsTypeStep): Simplify.  Now just a wrapper to 
5291         DeclSpace.FindType and DeclSpace.LookupType.
5292         (SimpleName.DoSimpleNameResolve): Remove support for dotted names.
5293         (Expression.ExprClassName): Make member function.
5294         * expression.cs (MemberAccess.ResolveAsTypeStep): Support LHS being
5295         a namespace.  Remove creation of dotted "SimpleName"s.
5296         (MemberAccess.DoResolve): Likewise.
5297         * decl.cs (DeclSpace.Cache): Make private.
5298         (DeclSpace.LookupInterfaceOrClass): Return a FullNamedExpression.
5299         (DeclSpace.FindType): Update.
5300         (DeclSpace.LookupType): Move here from RootContext.  Return a 
5301         FullNamedExpression.
5302         * namespace.cs (Namespace): Derive from FullNamedExpression
5303         so that it can be part of expression resolution.
5304         (Namespace.Lookup): Return an FullNamedExpression.
5305         (NamespaceEntry.LookupAlias): Lookup aliases only in current
5306         namespace.
5307         * rootcontext.cs (NamespaceLookup): Remove.
5308         (LookupType): Move to DeclSpace.
5309         * attribute.cs (CheckAttributeType): Update.
5310         * doc.cs (FindDocumentedType): Remove allowAlias argument.
5311         (FindDocumentedTypeNonArray): Likewise.
5312
5313 2005-01-11  Raja R Harinath  <rharinath@novell.com>
5314
5315         Fix cs0509.cs, cs1632.cs.
5316         * class.cs (TypeContainer.GetNormalBases): Don't assume !IsClass
5317         is the same as IsInterface.
5318         (TypeContainer.GetClassBases): Likewise.
5319         * statement.cs (LabeledStatement.ig): New field.
5320         (LabeledStatement.LabelTarget): Save ILGenerator which created the
5321         label.
5322         (LabeledStatement.DoEmit): Check that the label was created with
5323         the same ILGenerator.
5324
5325 2005-01-10  Marek Safar  <marek.safar@seznam.cz>
5326
5327         Fix #71058
5328         * attribute.cs (GetMethodObsoleteAttribute): Need to transform
5329         accessors to its properties.
5330
5331         * ecore.cs (PropertyExpr): Add AccessorTable to help track back
5332         from accessors to property.
5333         
5334 2005-01-10  Marek Safar  <marek.safar@seznam.cz>
5335
5336         Fix #70722
5337         * class.cs (MethodCore.CheckBase): Test base method obsoleteness
5338         only for overrides.
5339         
5340 2005-01-08  Miguel de Icaza  <miguel@ximian.com>
5341
5342         * attribute.cs: Check for null and empty strings.  
5343
5344         I have lost another battle to Paolo.
5345
5346 2005-01-07  Marek Safar  <marek.safar@seznam.cz>
5347
5348         Fix #70942
5349         * class.cs (PropertyMethod): Set Parent field in ctors.
5350         (SetMethod.InternalParameters): Add unsafe switch hack.
5351         Override MarkForDuplicationCheck where it is appropriate.
5352
5353         * decl.cs (MemberCore.MarkForDuplicationCheck): New method.
5354         It says whether container allows members with the same name.
5355         Base default is no.
5356         (DeclSpace.AddToContainer): Use MarkForDuplicationCheck.
5357         Removed is_method parameter.
5358
5359 2005-01-06  Duncan Mak  <duncan@ximian.com>
5360
5361         * cs-tokenizer.cs (xtoken): Redo the work for signaling CS1040
5362         because the previous change led to incorrect reporting of CS1032
5363         ("Cannot define/undefine preprocessor symbols after first token in
5364         file"). Instead of using `tokens_seen' as the only flag that
5365         triggers CS1040, introduce `comments_seen'. This new flag is used
5366         to signify having seen comments on the current line, so it is
5367         unset after a newline.
5368
5369 2005-01-06  Atsushi Enomoto  <atsushi@ximian.com>
5370
5371         * doc.cs : When searching for a type, find nested type too.
5372           This fixes bug #71040.
5373
5374 2005-01-06  Atsushi Enomoto  <atsushi@ximian.com>
5375
5376         * doc.cs :
5377           - Warn missing member comment on those classes which also does not
5378             have doc comments. Fixed bug #71041.
5379           - Don't warn missing doc comment on default constructor.
5380             Fixed bug #71042.
5381
5382 2005-01-06  Duncan Mak  <duncan@ximian.com>
5383
5384         * cs-tokenizer.cs (xtoken): After handling traditional C-style
5385         comments, set `tokens_seen' to true. This allows us to detect
5386         misplaced preprocessor directives (i.e. not at the beginning of
5387         the a line, nor after whitespaces). In that case, report error
5388         CS1040. This fixes bug #56460.
5389
5390         * cs-parser.jay (interface_member_declaration): Add checks for
5391         IsExplicitImpl, and report CS0541 error if an interface member is
5392         defined as an explicit interface declaration.
5393
5394 2005-01-06  Marek Safar  <marek.safar@seznam.cz>
5395
5396         Fix #70817
5397         * class.cs (PropertyMethod): Set Parent field in ctors.
5398         (SetMethod.InternalParameters): Add unsafe switch hack.
5399         
5400         * decl.cs (MemberCore.Parent): Cannot be readonly.
5401
5402 2005-01-06  Raja R Harinath  <rharinath@novell.com>
5403
5404         * decl.cs (DeclSpace.ResolveType): Remove.
5405         (DeclSpace.ResolveBaseTypeExpr): Rename from ResolveTypeExpr.
5406         Merge in code from ...
5407         (DeclSpace.GetTypeResolvingEmitContext): ... here.  Remove.
5408         * class.cs, enum.cs: Update to changes.
5409
5410 2005-01-06  Miguel de Icaza  <miguel@ximian.com>
5411
5412         * anonymous.cs: Ensure that we init the scope of our parent if it
5413         has not been initialized yet.
5414
5415 2004-12-30  Duncan Mak  <duncan@ximian.com>
5416
5417         * typemanager.cs (TypeManager.CheckStructCycles): Don't crash here
5418         if field.FieldBuilder is null. Fixes #70758.
5419
5420         * convert.cs: Fixed some typos and updated some of the comments.
5421         (ImplicitStandardConversionExists):
5422         (TryImplicitIntConversion): If `target_type' is an interface and
5423         the type of `ic' implements this interface, return true or a new
5424         BoxedCast instead of null. This fixes #70468.
5425
5426 2004-12-29  Duncan Mak  <duncan@ximian.com>
5427
5428         * expression.cs (Argument.Emit): Check that Expr is
5429         IMemoryLocation before casting to it, and report CS1510 otherwise.
5430
5431         This fixes #70402.
5432
5433 2004-12-21  Ben Maurer  <bmaurer@ximian.com>
5434
5435         * statement.cs (Block.ThisVariable): remove the recursion here, to
5436         make the --profile more sane.
5437
5438 2004-12-17  Carlos Cortez <calberto.cortez@gmail.com>
5439
5440         * driver.cs: Patch to handle a xsp bug that prevents to reference an .exe
5441         assembly, by JB Evain.
5442
5443 2004-12-17  Raja R Harinath  <rharinath@novell.com>
5444
5445         * class.cs, decl.cs, ecore.cs, iterators.cs, pending.cs, 
5446           rootcontext.cs, typemanager.cs: Make nomenclature consistent.
5447         "parent" refers to enclosing type/class.  "base" refers to superclass.
5448
5449 2004-12-17  Raja R Harinath  <rharinath@novell.com>
5450
5451         * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
5452         Ensure that we only have GlobalAttributes.
5453         * attribute.cs (Attribute.Emit): Make non-virtual.
5454         (GlobalAttribute.Emit): Remove.
5455         (Attribute.Resolve): Make virtual.
5456         (GlobalAttribute.Resolve): New.  Set Rootcontext.Tree.Types.NamespaceEntry.
5457         (Attribute.GetConditionalAttributeValue): Take an EmitContext as
5458         the argument. Don't create one.
5459         (Attribute.GetObsoleteAttribute): Likewise.
5460         (Attribute.GetClsCompliantAttributeValue): Likewise.
5461         * class.cs, decl.cs: Update to changes.
5462
5463 2004-12-17  Marek Safar  <marek.safar@seznam.cz>
5464
5465         * delegate.cs (NewDelegate.DoResolve): Add error 149 report.
5466         
5467         * ecore.cs (Expression.MemberLookupFailed): Fixed error 143.
5468         
5469         * statement.cs (Foreach.Resolve): Add error 186 report.
5470
5471 2004-12-16  Marek Safar  <marek.safar@seznam.cz>
5472
5473         * expression.cs (Conditional.DoResolve): Add warning 429.
5474         
5475         * statement.cs (If.Resolve): Add warning 665.
5476
5477 2004-12-16  Raja R Harinath  <rharinath@novell.com>
5478
5479         New invariant: RootContext.Tree.Types.NamespaceEntry == null
5480         except when in the parser, and in GlobalAttribute.
5481         * driver.cs (MainDriver): Reset RootContext.Tree.Types.NamespaceEntry.
5482         * attribute.cs (GlobalAttribute.CheckAttributeType): Reset
5483         RootContext.Tree.Types.NamespaceEntry once work is done.
5484         (GlobalAttribute.Emit): New.  Wrapper for Attribute.Emit, but sets
5485         and resets RootContext.Tree.Types.NamespaceEntry.
5486
5487 2004-12-15  Marek Safar  <marek.safar@seznam.cz>
5488
5489         * cs-parser.jay: Don't create a block for every variable.
5490
5491 2004-12-14  Miguel de Icaza  <miguel@ximian.com>
5492
5493         * location.cs: Provide extra information.
5494
5495         * statement.cs: The instance is not `ldarg_0.THIS' when accessing
5496         variables from the captured environment, it is the ldarg_0.
5497
5498 2004-12-14  Marek Safar  <marek.safar@seznam.cz>
5499
5500         * cs-parser.jay: Changed warning level for 642 to 4 until Miguel
5501         find a conclusion.
5502         
5503         * class.cs: Changed warning level for 169 to avoid developer
5504         displeasure from warning flooding. It will be changed back when they
5505         fix most of current BCL warnings.
5506         
5507         * RootContext.cs: Pushed default WarningLevel to 3.
5508         
5509         * statement.cs: Removed unused variable.
5510
5511 2004-12-14  Marek Safar  <marek.safar@seznam.cz>
5512
5513         * class.cs (TypeContainer.GetClassBases): Add error 1521 report.
5514         (TypeContainer.MethodModifiersValid): Refactored to use MemberCore.
5515         Add error 502 report.
5516         (StaticClass.DefineType): Add error 441 report.
5517         (Class.AllowedModifiersProp): New virtual property as temporary
5518         extension to AllowedModifiers.
5519         (Class.DefineType): Add error 418 report. Moved ModFlags check here
5520         to share implementation with StaticClass and don't call virtual
5521         methods from ctor.
5522         
5523         * driver.cs (MainDriver): Add error 1558 test.
5524
5525         * parameter.cs (Parameter.ApplyAttributeBuilder): Add error 662
5526         report. Moved error 36 test here.
5527
5528         * statement.cs (Throw.Resolve): Add error 724 report.
5529
5530         * typemanager.cs: Add out_attribute_type core type.
5531         
5532 2004-12-13  Marek Safar  <marek.safar@seznam.cz>
5533
5534         * class.cs (TypeContainer.VerifyClsCompliance): Add error
5535         3018 report.
5536         (PropertyBase.VerifyClsCompliance): Add errror 3025 report.
5537
5538         * codegen.cs (ModuleClass.ApplyAttributeBuilder): Add error
5539         3017 report.
5540         
5541         * decl.cs (MemberCore.VerifyClsCompliance): Add warning 3021.
5542
5543         * parameter.cs (ReturnParameter.ApplyAttributeBuilder): 
5544         Add error 3023 report.
5545         (Parameter.ApplyAttributeBuilder): Add error 3022 report.
5546
5547         * tree.cs (RootTypes.IsClsCompliaceRequired): Add fake
5548         implementation.
5549
5550 2004-12-12  John Luke  <john.luke@gmail.com>
5551
5552         * driver.cs (AddArgs): take -- into account when
5553         adding arguments, fixes bug 65710 
5554
5555 2004-12-12  Martin Baulig  <martin@ximian.com>
5556
5557         * expression.cs (Unary.TryReduceNegative): Added support for
5558         SByteConstant and ByteConstant.
5559         (Unary.Reduce): Check error values from TryReduceNegative().
5560
5561 2004-12-10  Marek Safar  <marek.safar@seznam.cz>
5562
5563         * attributes.cs (Attribute.Resolve): Avoid multiple error report
5564         and report exception as error 182.
5565
5566 2004-12-10  Raja R Harinath  <rharinath@novell.com>
5567
5568         * driver.cs (Main): Fix message when there are warnings.
5569
5570 2004-12-09  Miguel de Icaza  <miguel@ximian.com>
5571
5572         * delegate.cs: Fixed my fix from yesterday, sorry about that.
5573
5574 2004-12-09  Marek Safar  <marek.safar@seznam.cz>
5575
5576         * anonymous.cs, class.cs, convert.cs, doc.cs, support.cs: 
5577         Reduced number of warnings.
5578         
5579         * class.cs (TypeContainer.VerifyClsCompliance): One if is enough.
5580
5581 2004-12-08  Miguel de Icaza  <miguel@ximian.com>
5582
5583         * driver.cs: Removed message.
5584
5585         * delegate.cs: Fix bug introduced in 1.1.x: 70219.
5586
5587 2004-12-08    <vargaz@freemail.hu>
5588
5589         * cs-tokenizer.cs: Add workaround for NET 2.0 beta 1 csc bug.
5590
5591 2004-12-08  Martin Baulig  <martin@ximian.com>
5592
5593         * class.cs (TypeContainer.VerifyClsCompliance): Report a CS3003
5594         instead of a CS3002 for properties and indexer.
5595
5596 2004-12-08  Martin Baulig  <martin@ximian.com>
5597
5598         * decl.cs (MemberName.ToString): Make this work again.
5599
5600 2004-12-08  Marek Safar  <marek.safar@seznam.cz>
5601
5602         * attribute.cs (Resolve): Add error 591 detection.
5603
5604         * class.cs (FieldMember.Define): Add error 1547 detection.
5605         (Indexer.Define): Add error 620 detection.
5606         (Operator.Define): Add error 590 detection.
5607
5608         * ecore.cs: Missing argument for error 79.
5609
5610         * expression.cs (ComposedCast.DoResolveAsTypeStep): Add error 611
5611         detection.
5612
5613 2004-12-07  Marek Safar  <marek.safar@seznam.cz>
5614
5615         Fix #70106
5616         * assign.cs.cs (Assign.DoResolve): Reports error 1648 for value types
5617         only.
5618
5619 2004-12-07  Atsushi Enomoto  <atsushi@ximian.com>
5620
5621         * cs-parser.jay : handle doc comments on implicit/explicit operators.
5622           Some operator comments were suppressed.
5623         * doc.cs : Implicit/explicit operator name in doc comments are like
5624           "op_Explicit(type)~returnType", so added suffix handling.
5625
5626 2005-01-21  Alp Toker  <alp@atoker.com>
5627
5628         * cs-parser.jay: destructor_declaration's container is PartialContainer
5629         not Class when partial types are used, so use Kind prop instead of 'is'.
5630
5631 2004-12-12  Martin Baulig  <martin@ximian.com>
5632
5633         * expression.cs (Unary.TryReduceNegative): Added support for
5634         SByteConstant and ByteConstant.
5635         (Unary.Reduce): Check error values from TryReduceNegative().
5636
5637 2004-12-11  Martin Baulig  <martin@ximian.com>
5638
5639         * support.cs (ReflectionParameters.ParameterName): If we have a
5640         `gpd', call `ParameterName' on it.
5641
5642         * parameter.cs (Parameter.GetParameterAttributes): New static method.
5643
5644         * pending.cs (PendingImplementation.DefineProxy): Call
5645         DefineParameter() for all of the MethodBuilder's arguments.
5646
5647 2004-12-09  Martin Baulig  <martin@ximian.com>
5648
5649         * doc.cs (DocUtil): Make this a static class.
5650
5651 2004-12-09  Martin Baulig  <martin@ximian.com>
5652
5653         * expression.cs (Invocation.InferType): Moved the type inference
5654         implementation into TypeManager.
5655
5656         * generics.cs (TypeManager): Moved the type inference
5657         implementation here.
5658
5659 2004-12-09  Martin Baulig  <martin@ximian.com>
5660
5661         * typemanager.cs (TypeManager): Make this a partial class.
5662
5663         * generics.cs
5664         (TypeManager): Move the generics part of `TypeManager' here.
5665
5666 2004-12-08  Martin Baulig  <martin@ximian.com>
5667
5668         * class.cs (TypeContainer.VerifyClsCompliance): Report a CS3003
5669         instead of a CS3002 for properties and indexer.  Added CS3024
5670         check for generic interfaces.
5671
5672         * attributes.cs (AttributeTester.AnalyzeTypeCompliance): Generic
5673         instances are not CLS-compliant.
5674
5675 2004-12-08  Martin Baulig  <martin@ximian.com>
5676
5677         * cs-parser.jay
5678         (void_pointer_expression): New rule for `void*', `void**' etc.
5679         (typeof_expression): Add `void_pointer_expression'; fixes #66846.       
5680
5681 2004-12-08  Martin Baulig  <martin@ximian.com>
5682
5683         * expression.cs (Invocation.InferType): Removed the hack for
5684         MethodCore.MayUnify().  
5685
5686         * typemanager.cs (TypeManager.MayBecomeEqualGenericTypes): Make
5687         this actually work.
5688
5689         * class.cs (MethodCore.MayUnify): Use
5690         TypeManager.MayBecomeEqualGenericTypes().       
5691
5692 2004-12-08  Martin Baulig  <martin@ximian.com>
5693
5694         * expression.cs (Is.DoResolve, As.DoResolve): If we're a type
5695         parameter, box it.  Fixes #69233.
5696
5697 2004-12-08  Martin Baulig  <martin@ximian.com>
5698
5699         * generic.cs (ConstructedType.CheckConstraints): Valuetypes always
5700         have the ctor constraint.  Fixes #68326.
5701
5702 2004-12-07  Atsushi Enomoto  <atsushi@ximian.com>
5703
5704         * cs-parser.jay : interface comment was not consumed because of
5705           extra opt_semicolon before doc handling.
5706
5707 2004-12-03  Raja R Harinath  <rharinath@novell.com>
5708
5709         Fix test-327.cs, test-328.cs, and put in early infrastructure
5710         for eventually fixing #52697.
5711         * namespace.cs (NamespaceEntry.LookupForUsing): New method.
5712         (NamespaceEntry.LookupNamespaceOrType): New method, refactored
5713         from other methods.
5714         (NamespaceEntry.Lookup): Remove 'ignore_using' flag.
5715         (AliasEntry.Resolve, UsingEntry.Resolve): Use 'LookupForUsing'.
5716         (VerifyUsing, error246): Update.
5717         * rootcontext.cs (RootContext.NamespaceLookup): Just use
5718         'NamespaceEntry.LookupNamespaceOrType'.
5719
5720 2004-12-07  Martin Baulig  <martin@ximian.com>
5721
5722         * driver.cs: Call it "BETA SOFTWARE" :-)
5723
5724 2004-12-06  Raja R Harinath  <rharinath@novell.com>
5725
5726         Fix crash on cs0657-17.cs.
5727         * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
5728         Use RootContext.Tree.Types, not 'new RootTypes ()'.
5729         * attribute.cs (GlobalAttribute.CheckAttributeType): Narrow down
5730         the case where the NamespaceEntry gets overwritten.
5731
5732 2004-12-06  Marek Safar  <marek.safar@seznam.cz>
5733
5734         Fixed #69195, #56821
5735         * ecore.cs (ResolveBoolean): Tiny refactoring.
5736
5737         * expression.cs (Binary.DoResolve): Add warning 429 and skipping
5738         of right expression resolving when left is false constant and
5739         operator is LogicalAnd OR true constant and operator is LogicalOr.
5740
5741         * statement.cs (ResolveUnreachable): Always reports warning.
5742
5743 2004-12-05  Miguel de Icaza  <miguel@ximian.com>
5744
5745         * class.cs: Distinguish between 1721 and 1722 (just a little help
5746         for the programmer).
5747
5748 2004-12-03  Miguel de Icaza  <miguel@ximian.com>
5749
5750         * delegate.cs: Only allow this on new versions of the language. 
5751
5752 2004-12-02  Duncan Mak  <duncan@ximian.com>
5753
5754         * ecore.cs (PropertyExpr.IsAccessorAccessible): Moved to
5755         Expression class.
5756         (Expression.IsAccessorAccessible): Moved from the PropertyExpr to
5757         here as a static method. Take an additional bool out parameter
5758         `must_do_cs1540_check' for signaling to InstanceResolve.
5759         (PropertyExpr.InstanceResolve): Removed the `must_do_cs1540_check'
5760         member field from PropertyExpr class and made it an argument of
5761         the method instead.
5762         (EventExpr.InstanceResolve): Copied from PropertyExpr, removed the
5763         check for MarshalByRefObject, and report CS0122 instead of CS1540.
5764         (EventExpr.DoResolve): Call IsAccessorAccessible on `add_accessor'
5765         and `remove_accessor' as well as InstanceResolve: report CS0122
5766         where applicable.
5767
5768         Fixes #70129.
5769
5770 2004-12-07  Martin Baulig  <martin@ximian.com>
5771
5772         * decl.cs (DeclSpace.AddToContainer): Report correct errors CS0694
5773         and CS0692 where appropriate.
5774
5775 2004-12-06  Martin Baulig  <martin@ximian.com>
5776
5777         * class.cs (MethodCore.MayUnify): Moved the CS0408 check here from
5778         IsDuplicateImplementation() and improved it.
5779
5780         * expression.cs (Invocation.InferTypeArguments): Added
5781         `Type[] inferred_class_types' argument (for MethodCore.MayUnify)
5782         and removed the "ref" modifier from `infered_types'.
5783
5784         * decl.cs (MemberName.ToString): Removed the exception.
5785
5786 2004-12-03  Atsushi Enomoto  <atsushi@ximian.com>
5787
5788         * cs-tokenizer.cs : Only '////' is rejected. Other non-whitespace
5789           comments are allowed.
5790
5791 2004-12-03  Carlos Alberto Cortez <calberto.cortez@gmail.com>
5792
5793         * delegate.cs: Add checks for subtypes in paramaters and return values
5794         in VerifyMethod () to add support for Covariance/Contravariance
5795         in delegates.
5796         
5797 2004-12-02  Miguel de Icaza  <miguel@ximian.com>
5798
5799         * report.cs: Remove extra closing parenthesis.
5800
5801         * convert.cs (Error_CannotImplicitConversion): If the name of the
5802         types are the same, provide some extra information.
5803
5804 2004-12-02  Marek Safar  <marek.safar@seznam.cz>
5805
5806         Fix bug #70102
5807         * attribute.cs (Resolve): Improved implementation of params
5808         attribute arguments.
5809
5810         * support.cs (ParameterData): Add HasParams to be faster.
5811
5812 2004-12-02  Atsushi Enomoto  <atsushi@ximian.com>
5813
5814         all things are for /doc support:
5815
5816         * doc.cs: new file that supports XML documentation generation.
5817         * mcs.exe.sources: added doc.cs.
5818         * driver.cs:
5819           Handle /doc command line option.
5820           Report error 2006 instead of 5 for missing file name for /doc.
5821           Generate XML documentation when required, after type resolution.
5822         * cs-tokenizer.cs:
5823           Added support for picking up documentation (/// and /** ... */),
5824           including a new XmlCommentState enumeration.
5825         * cs-parser.jay:
5826           Added lines to fill Documentation element for field, constant,
5827           property, indexer, method, constructor, destructor, operator, event
5828           and class, struct, interface, delegate, enum.
5829           Added lines to warn incorrect comment.
5830         * rootcontext.cs :
5831           Added Documentation field (passed only when /doc was specified).
5832         * decl.cs:
5833           Added DocComment, DocCommentHeader, GenerateDocComment() and
5834           OnGenerateDocComment() and some supporting private members for
5835           /doc feature to MemberCore.
5836         * class.cs:
5837           Added GenerateDocComment() on TypeContainer, MethodCore and Operator.
5838         * delegate.cs:
5839           Added overriden DocCommentHeader.
5840         * enum.cs:
5841           Added overriden DocCommentHeader and GenerateDocComment().
5842
5843 2004-12-01  Miguel de Icaza  <miguel@ximian.com>
5844
5845         * cfold.cs (ConstantFold.DoConstantNumericPromotions): After
5846         unwrapping the enumeration values, chain to
5847         DoConstantNumericPromotions again, so we can promote things to the
5848         fundamental types (takes care of enums that are bytes, sbytes).
5849
5850         Fixes bug #62054.
5851
5852 2004-12-01  Raja R Harinath  <rharinath@novell.com>
5853
5854         * attribute.cs (Attribute.CheckAttributeType): Remove complain flag.
5855         Fix long-standing bug in type-lookup.  Use FindType instead of
5856         LookupType when ec.ResolvingTypeTree.
5857         (Attribute.ResolveType, Attribute.Resolve)
5858         (Attribute.DefinePInvokeMethod,GlobalAttribute.CheckAttributeType):
5859         Update to changes.
5860         (Attributes.Search): Remove internal version.  Update.
5861         (Attributes.SearchMulti): Update.
5862         (Attributes.GetClsCompliantAttribute): Remove.
5863         (Attributes.GetIndexerNameAttribute): Remove.
5864         * decl.cs (MemberCore.GetClsCompliantAttributeValue): Update to changes.
5865         (DeclSpace.GetClsCompliantAttributeValue): Likewise.
5866         * class.cs (Indexer.Define): Likewise.
5867
5868 2004-12-01  Marek Safar  <marek.safar@seznam.cz>
5869
5870         Fix bug #68790
5871         * ecore.cs: CheckMarshallByRefAccess new virtual method for testing
5872         MarshallByReference members access.
5873
5874         * expression.cs: Use CheckMarshallByRefAccess;
5875         Better error CS0197 message.
5876
5877         * report.cs: Print whole related error message.
5878
5879 2004-11-29  Marek Safar  <marek.safar@seznam.cz>
5880
5881         * class (GetClassBases): Better error 60 report.
5882         (EventProperty): Disabled warning 67 detection.
5883
5884 2004-11-29  Marek Safar  <marek.safar@seznam.cz>
5885
5886         Fix bug #60324
5887         * cfold.cs (Assign.DoResolve): Add subtraction for DecimalConstant.
5888
5889         * constant.cs (DecimalConstant.Emit): Don't use int ctor for
5890         precise values.
5891
5892 2004-11-29  Marek Safar  <marek.safar@seznam.cz>
5893
5894         Fix bug #49488
5895         * assign.cs (Assign.DoResolve): Add error 1648, 1650 report.
5896
5897         * decl.cs (MemberCore.MemberName): Error 1648 in compiler.
5898
5899 2004-11-26  Miguel de Icaza  <miguel@ximian.com>
5900
5901         * attribute.cs (Attribute.Resolve): Refine error reporting and
5902         report a cs0117 if the identifier does not exist, to distinguish
5903         from 0617 which is a miss-use of the actual identifier.
5904
5905         * ecore.cs (EventExpr.Emit): Refine error report and distinguish
5906         between cs0070 and cs0079.
5907
5908         * class.cs (MemberBase.DoDefine): When reporting a wrong
5909         accessibility level, we use MethodCore to compare instead of
5910         Method (this was a regression in some refactoring effort).
5911
5912         So now we correctly report cs0056 again.
5913
5914         * convert.cs (ImplicitReferenceConversion): Corrected typo, I was
5915         testing the target_type (which was known to be object_type) and
5916         not the source type (which is anonymous_method).
5917
5918         Fixed reporting of error cs1660.
5919
5920         * expression.cs (UserCast.Source): Expose the underlying cast.
5921
5922         * statement.cs (Switch.SwitchGoverningType): Sort the list of
5923         allowed types to find a match to int32 first (most common).
5924
5925         In addition, it ignores any ImplicitUserConversions that did an
5926         internal implicit conversion (as the switch statement allows only
5927         one integral conversion to exist).
5928
5929         * class.cs (PartialContainer.Create): rename `name' to
5930         `member_name' for clarity.  Then replace the string calls with a
5931         call to MemberName.GetPartialName, as now using
5932         MemberName.ToString is an error (this is due to the side effects
5933         it had, that were fixed in the past).
5934
5935         This will restore the error reporting on a number of partial class
5936         errors that were missusing this (and getting an exception as a
5937         results, which is now just a plain textual warning, because
5938         yyparse debug output would crash otherwise).
5939
5940 2004-11-26  Raja R Harinath  <rharinath@novell.com>
5941
5942         * Makefile (PROGRAM_INSTALL_DIR): Remove.
5943
5944 2004-11-25  Ben Maurer  <bmaurer@ximian.com>
5945
5946         * rootcontext.cs (LookupType): Make sure to cache lookups that
5947         don't give us a negative result. This saves about 5% of corlib
5948         compilation time.
5949
5950 2004-11-25  Miguel de Icaza  <miguel@ximian.com>
5951
5952         * report.cs (AbstractMessage.Print): messages are sent to stderr
5953
5954         * class.cs (TypeContainer.GetClassBases): It is an error to have a
5955         non-interface in the list of interfaces (at this point, either
5956         parent was properly set, or a base class is being listed in the
5957         interfaces section).
5958
5959         This flags error 1722, and resolves the crash from bug 69259.
5960
5961 2004-11-25  Ben Maurer  <bmaurer@ximian.com>
5962
5963         * statement.cs (Using.EmitExpressionFinally): make this work right
5964         for valuetypes. Fixes 69926.
5965
5966 2004-11-25  Miguel de Icaza  <miguel@ximian.com>
5967
5968         * const.cs (Const.ChangeType): Cope with the "0 literal can be
5969         converted to an enum" here, before we try to change the underlying
5970         type.  This code exists, but it is a different code path than the
5971         one used while encoding constants.
5972
5973         (ImplicitReferenceConversionExists): In addition, resynchronized
5974         the code here, so it matches the same code in
5975         ImplicitReferenceConversionExists for the `from any class-type S
5976         to any interface-type T'.       
5977
5978 2004-11-25  Marek Safar  <marek.safar@seznam.cz>
5979
5980         * cfold.cs (BinaryFold): Add addition for DecimalConstant.
5981
5982 2004-11-24  Miguel de Icaza  <miguel@ximian.com>
5983
5984         * cs-parser.jay: Use verbosity accordingly. 
5985
5986 2004-11-24  Marek Safar  <marek.safar@seznam.cz>
5987
5988         * expression.cs (Unary.ResolveOperator): Do not report warning;
5989         AddressOf reads from variable.
5990         
5991         (LocalVariableReferences.DoResolveBase): Improved my previous fix.
5992
5993 2004-11-24  Marek Safar  <marek.safar@seznam.cz>
5994
5995         Fix bug #69462
5996
5997         * attribute.cs (Attributable): Removed CheckTargets.
5998         (Attributes.Emit): Explicit attribute targets are tested here.
5999
6000         * class.cs (EventField.ValidAttributeTargets): Explicit target "field" is
6001         not enabled for interfaces.
6002
6003         * codegen.cs (CommonAssemblyModulClass.AddAttributes): Removed CheckTargets.
6004         (GetAssemblyName): Ouch next bug there.
6005
6006 2004-11-23  Carlos Alberto Cortez <calberto.cortez@gmail.com>
6007
6008         * expression.cs: Error 275 added.
6009         
6010 2004-11-23  Marek Safar  <marek.safar@seznam.cz>
6011
6012         Fix bug #69177 (Implemented decimal constant support)
6013
6014         * cfold.cs (DoConstantNumericPromotions: Add DecimalConstant.
6015         (BinaryFold): Add DecimalConstant.
6016
6017         * const.cs (Define): Decimal constant 
6018         (is not constant.
6019         (ChangeType): Add decimal type handling.
6020         (LookupConstantValue): Don't set value for decimal type but
6021         emit DecimalConstantAttribute. Needed for constant optimization.
6022
6023         * constant.cs (ToDecimal): New method.
6024         (ConvertToDecimal): New method.
6025         (IntConstant): Implemented ConvertToDecimal.
6026         (DecimalConstant.Emit): Emit optimized version for decimals in
6027         int range.
6028
6029         * expression.cs (ResolveOperator): Changed order of constant
6030         reduction to work correctly with native types which have
6031         overloaded operators.
6032         (ResolveMemberAccess): Extract constant value from attribute
6033         for decimal type.
6034
6035         * rootcontext.cs (ResolveCore): Add DecimalConstantAttribute.
6036
6037         * typemanager.cs (TypeManager): Add decimal_constant_attribute_type,
6038         void_decimal_ctor_int_arg, decimal_constant_attribute_ctor.
6039         (ChangeType): Decimal is special.
6040         (TypeToCoreType): Add decimal type.
6041
6042 2004-11-22  Marek Safar  <marek.safar@seznam.cz>
6043
6044         * convert.cs (ImplicitConversionRequired): Add error cs0642 for
6045         decimal types.
6046
6047 2004-11-22  Marek Safar  <marek.safar@seznam.cz>
6048
6049         * class.cs (EventField.ApplyAttributeBuilder): Fix error
6050         test cs1667-5.cs.
6051
6052 2004-11-19  Marek Safar  <marek.safar@seznam.cz>
6053
6054         * class.cs (MemberBase.DoDefine): Fix error cs0508 report.
6055
6056         * pending.cs (PendingImplementation): Grab only interfaces.
6057
6058 2004-11-19  Marek Safar  <marek.safar@seznam.cz>
6059
6060         * statement.cs (ForeachHelperMethods): Add location member and
6061         error 202 detection.
6062
6063 2004-11-18  Marek Safar  <marek.safar@seznam.cz>
6064
6065         * expression.cs (DoResolveBase): Fixed wrong warning for out
6066         variables.
6067
6068 2004-12-04  Martin Baulig  <martin@ximian.com>
6069
6070         * convert.cs (Convert.TypeParameter_to_Null): Use the constraints
6071         to check whether the conversion is ok.
6072
6073         * typemanager.cs (TypeManager.GetTypeArguments): Just return
6074         `Type.EmptyTypes' if we're not a generic TypeContainer.
6075
6076 2004-11-25  Miguel de Icaza  <miguel@ximian.com>
6077
6078         * convert.cs (ImplicitReferenceConversionExists): A surprisingly
6079         old bug: when converting from the null literal to a pointer,
6080         return an EmptyCast, not the NullLiteral.
6081
6082         This fixes #69921, the recent null_type changes probably made this
6083         bug more prominent.
6084
6085 2004-12-03  Martin Baulig  <martin@ximian.com>
6086
6087         * delegate.cs (NewDelegate.DoResolve): If we have an anonymous
6088         method as our child, call AnonymousMethod.Compatible() on it.
6089
6090 2004-12-02  Miguel de Icaza  <miguel@ximian.com>
6091
6092         * class.cs (FieldBase): Use an unused bit field from the field to
6093         encode the `has_offset' property from the FieldMember.  This saves
6094         a couple of Ks on bootstrap compilation.
6095
6096         * delegate.cs (NewDelegate.DoResolve): If we have an anonymous
6097         method as our child, return the AnonymousMethod resolved
6098         expression.
6099
6100         * expression.cs (New.DoResolve): Allow return values from
6101         NewDelegate to also include AnonymousMethods.
6102
6103         Fixes #70150.
6104
6105 2004-11-29  Raja R Harinath  <rharinath@novell.com>
6106
6107         * decl.cs (MemberCore.MemberName): Remove readonly to fix an error
6108         cs1648 report.
6109         * rootcontext.cs (ResolveCore::interfaces_first_stage): Add
6110         System.Runtime.InteropServices._Exception, since it's a base
6111         interface of the core type System.Exception in the net_2_0 profile.
6112
6113 2004-11-27  Martin Baulig  <martin@ximian.com>
6114
6115         * ecore.cs (Expression.StoreFromPtr): Use `stobj' for generic parameters.
6116
6117 2004-11-26  Raja R Harinath  <rharinath@novell.com>
6118
6119         * Makefile: Convert to use executable.make.
6120         * gmcs.exe.sources: New.
6121
6122 2004-11-25  Martin Baulig  <martin@ximian.com>
6123
6124         * expression.cs (Invocation.InferType): Added support for byref types.
6125
6126 2004-11-25  Martin Baulig  <martin@ximian.com>
6127
6128         * statement.cs (Foreach.FetchMethodMoveNext): Wrap `mi.ReturnType'
6129         in TypeManager.TypeToCoreType().
6130
6131 2004-11-25  Martin Baulig  <martin@ximian.com>
6132
6133         * iterators.cs (Iterator.DoDefineMembers): Override and lookup the
6134         "Dispose" method from the `current_type'.
6135         (Iterator.EmitMoveNext): Use the `dispose_method' we looked up in
6136         DoDefineMembers() instead of using the MethodBuilder; this is
6137         required for generic iterators.
6138
6139         * class.cs (TypeContainer.DoDefineMembers): Make this virtual.
6140
6141 2004-11-24  Martin Baulig  <martin@ximian.com>
6142
6143         * ecore.cs (Expression.LoadFromPtr): Use `ldobj' for generic parameters.
6144
6145 2004-11-20  Martin Baulig  <martin@ximian.com>
6146
6147         * expression.cs (Invocation.InferType): Correctly infer generic
6148         instances; see gen-103.cs.
6149         (Invocation.InferTypeArguments): If a generic method doesn't have
6150         any unbound type parameters, we don't need to infer anything.
6151
6152 2004-11-19  Raja R Harinath  <rharinath@novell.com>
6153
6154         * Makefile (gmcs.exe): Update to new location of bootstrap mcs.exe.
6155
6156 2004-11-17  Raja R Harinath  <rharinath@novell.com>
6157
6158         * typemanager.cs (TypeHandle.GetTypeHandle): Make private.
6159         (TypeHandle.GetMemberCache): New.
6160         (TypeHandle.TypeHandle): Update.
6161         (TypeManager.LookupMemberCache): Rewritten from LookupMemberContainer.
6162         (TypeManager.LookupParentInterfacesCache):
6163         Rename from LookupInterfaceCache.  Optimize slightly.
6164         (TypeManager.MemberLookup_FindMembers): Update.
6165         * decl.cs (MemberCache.MemberCache): Set Container to null in the
6166         multi-type variant.
6167         (AddCacheContents): Rename from AddHashtable.
6168         * class.cs (TypeContainer.parent_container): Remove.
6169         (TypeContainer.VerifyClsCompliance): Don't use parent_container.
6170         (TypeContainer.DoDefineMembers): Don't initialize it.
6171         Update to name changes.
6172         
6173 2004-11-17  Miguel de Icaza  <miguel@ximian.com>
6174
6175         * class.cs (MethodCore.CheckAccessModifiers): New helper routine
6176         that factors the code to check access modifiers on override.  
6177
6178         (PropertyBase): Use the code here.
6179
6180         Patch from Lluis S'anchez, fixes bug #69361.
6181
6182 2004-11-15  Miguel de Icaza  <miguel@ximian.com>
6183
6184         * anonymous.cs (AnonymousMethod.Error_AddressOfCapturedVar): New
6185         routine that is used to report the use of a captured variable
6186         whose address has been taken.
6187
6188         There are two checks: one when variables are being captured and
6189         the other check is when the address of a variable is taken. 
6190         
6191         (because an anonymous methods might be resolved before *or* after
6192         the address has been taken) and 
6193
6194         * expression.cs (Conditional.DoResolve): Remove the special
6195         casing that Martin added to trueExpr and falseExpr being both
6196         NullLiteral.  We get the right behavior now just by introducing
6197         the null_type into the compiler. 
6198
6199         * convert.cs (ExplicitConversion): Change the code to use
6200         null_type instead of testing `expr is NullLiteral'.
6201         (ImplicitConversionStandard): use null_type too.
6202         (ImplicitReferenceConversionExists): use null_type too.
6203         (ImplicitReferenceConversion): use null_type too.
6204
6205         * literal.cs: The type of `NullLiteral' is now null_type instead
6206         of object_type. 
6207         (Resolve): Set the type here.
6208
6209         * typemanager.cs: Introduce null_type.
6210
6211 2004-11-18  Martin Baulig  <martin@ximian.com>
6212
6213         * rootcontext.cs
6214         (RootContext.LookupType): Return a `Type', not a `TypeExpr'.
6215
6216 2004-11-18  Martin Baulig  <martin@ximian.com>
6217
6218         * ecore.cs (TypeExpr.DoResolveAsTypeStep): Make this protected.
6219
6220 2004-11-18  Martin Baulig  <martin@ximian.com>
6221
6222         * generic.cs (Constraints.Resolve): Take an `EmitContext' instead
6223         of a `DeclSpace'.  If one of our constraints is a `ConstructedType',
6224         call ResolveConstructedType() on it to resolve it without checking
6225         constraints.
6226         (Constraints.ResolveTypes): Check them here.
6227         (ConstructedType.DoResolveAsTypeStep): Fully resolve ourselves,
6228         but don't check constraints.
6229         (ConstructedType.ResolveAsTypeTerminal): Override this and also
6230         check constraints here.
6231         (ConstructedType.ResolveConstructedType): New public method.  This
6232         is called from DoResolveAsTypeStep() and Constraints.Resolve() to
6233         resolve ourselves without checking constraints.
6234
6235         * ecore.cs (Expression.ResolveAsTypeTerminal): Make this virtual.
6236
6237 2004-11-18  Martin Baulig  <martin@ximian.com>
6238
6239         * decl.cs
6240         (DeclSpace.CurrentType): Changed type from `TypeExpr' to `Type'.
6241
6242         * delegate.cs (Delegate.DefineType): Always create the EmitContext.
6243
6244 2004-11-18  Martin Baulig  <martin@ximian.com>
6245
6246         * ecore.cs (TypeExpr.ResolveType): Removed.
6247         (Expression.ResolveAsTypeTerminal): We always return a fully
6248         resolved `TypeExpr', so we can just access its `Type'.
6249
6250         * class.cs (TypeContainer.DefineType): Resolve `CurrentType' here.
6251
6252 2004-11-17  Martin Baulig  <martin@ximian.com>
6253
6254         * ecore.cs (IAlias.Type): Replaced with ResolveAsType() to make
6255         sure we don't return any unresolved TypeExpr's.
6256         (TypeAliasExpression): The .ctor now takes an `IAlias' instead of
6257         a `TypeExpr'.
6258         (Expression.ResolveAsTypeTerminal): Make sure `te.Type != null'.
6259
6260         * expression.cs (MemberAccess.ResolveAsTypeStep): Don't return any
6261         unresolved `ConstructedType's.
6262
6263 2004-11-17  Martin Baulig  <martin@ximian.com>
6264
6265         * ecore.cs (TypeExpr.ResolveType): Don't make this virtual.
6266
6267 2004-11-17  Martin Baulig  <martin@ximian.com>
6268
6269         * ecore.cs
6270         (Expression.ResolveAsTypeTerminal): Removed the `bool silent' argument.
6271
6272         * decl.cs (DeclSpace.ResolveType): Removed.
6273         (DeclSpace.ResolveTypeExpr): Removed the `bool silent' argument.
6274
6275 2004-11-17  Martin Baulig  <martin@ximian.com>
6276
6277         * decl.cs (MemberCache.AddHashtable): Add entries in the opposite
6278         direction, like FindMembers() does.  Fixes #69546, testcase is in
6279         test-315.cs.    
6280
6281 2004-11-16  Martin Baulig  <martin@ximian.com>
6282
6283         This is based on a patch from Marek Safar, see bug #69082.
6284         Fixes bugs #63705 and #67130.
6285
6286         * typemanager.cs (TypeManager.LookupInterfaceCache): New public
6287         method; create a MemberCache for an interface type and cache the
6288         result.
6289
6290         * decl.cs (IMemberContainer.ParentContainer): Removed.
6291         (IMemberContainer.ParentCache): New property.
6292         (MemberCache.SetupCacheForInterface): Removed.
6293         (MemberCache..ctor): Added .ctor which takes a `Type[]'; use this
6294         to create a cache for an interface's "parent".
6295
6296         * class.cs (TypeContainer.DoDefineMembers): Setup cache for
6297         interfaces too.
6298
6299 2004-11-14  Ben Maurer  <bmaurer@ximian.com>
6300
6301         * statement.cs: Avoid adding bools to a hashtable.
6302
6303 2004-11-15  Martin Baulig  <martin@ximian.com>
6304
6305         * decl.cs (MemberName.GetPartialName): Removed, use GetTypeName() instead.
6306
6307 2004-11-11  Martin Baulig  <martin@ximian.com>
6308
6309         * typemanager.cs (TypeManager.GetMethodName): New method.
6310
6311         * class.cs (MethodData.Define): Include the generic arity in the
6312         name of an explicit interface; also add it to the method name.
6313
6314         * pending.cs (PendingImplementation.InterfaceMethod): The method
6315         name now includes the generic arity.
6316
6317 2004-11-07  Miguel de Icaza  <miguel@ximian.com>
6318
6319         * expression.cs (Invocation.OverloadResolve): Flag error if we are
6320         calling an unsafe method from a safe location.
6321
6322 2004-11-06  Marek Safar  <marek.safar@seznam.cz>
6323
6324         Fix #69167
6325         * codegen.cs (ApplyAttributeBuilder): Do not return; it is only warning.
6326
6327 2004-11-06  Miguel de Icaza  <miguel@ximian.com>
6328
6329         * namespace.cs (VerifyUsing): use GetPartialName instead of
6330         ToString. 
6331
6332 2004-11-05  Miguel de Icaza  <miguel@ximian.com>
6333
6334         * statement.cs (Return.Resolve): Fix regression in typo: if
6335         `in_exc', we have to request a NeedReturnLabel, this was a typo
6336         introduced in the anonymous method check-in.  Fixes #69131.
6337
6338         * Indexers were using the ShortName when defining themselves,
6339         causing a regression in the compiler bootstrap when applying the
6340         patch from 2004-11-02 (first part), now they use their full name
6341         and the bug is gone.
6342
6343 2004-11-04  Zoltan Varga  <vargaz@freemail.hu>
6344
6345         * driver.cs: Strip the path from the names of embedded resources. Fixes
6346         #68519.
6347
6348 2004-11-04  Raja R Harinath  <rharinath@novell.com>
6349
6350         Fix error message regression: cs0104-2.cs.
6351         * namespace.cs (NamespaceEntry.Lookup): Remove 'silent' flag.
6352         (AliasEntry.Resolve): Update.
6353         * rootcontext.cs (RootContext.NamespaceLookup): Update.  Remove
6354         'silent' flag.
6355         (RootContext.LookupType): Update.
6356
6357 2004-11-03  Carlos Alberto Cortez <carlos@unixmexico.org>
6358
6359         * cs-parser.jay: Add support for handling accessor modifiers
6360         * class: Add support port accessor modifiers and error checking,
6361         define PropertyMethod.Define as virtual (not abstract anymore)
6362         * ecore.cs: Add checking for proeprties access with access modifiers
6363         * iterators.cs: Modify Accessor constructor call based in the modified
6364         constructor
6365 2004-11-02  Ben Maurer  <bmaurer@ximian.com>
6366
6367         * expression.cs (StringConcat): Handle being called twice,
6368         as when we have a concat in a field init with more than two
6369         ctors in the class
6370
6371 2004-11-02  Miguel de Icaza  <miguel@ximian.com>
6372
6373         * class.cs (Event.Define, Indexer.Define, Property.Define): Do not
6374         special case explicit implementations, we should always produce
6375         the .property or .event declaration.
6376         
6377         * decl.cs (MemberName): Renamed GetFullName to GetPartialName
6378         since it will not return correct data if people use this
6379         unresolved in the presence of using statements (see test-313).
6380
6381         * class.cs (MethodData.Define): If we are an explicit interface
6382         implementation, set the method name to the full name of the
6383         interface plus the name of the method.  
6384
6385         Notice that using the method.MethodName.GetFullName() does not
6386         work, as it will only contain the name as declared on the source
6387         file (it can be a shorthand in the presence of using statements)
6388         and not the fully qualifed type name, for example:
6389
6390         using System;
6391
6392         class D : ICloneable {
6393                 object ICloneable.Clone ()  {
6394                 }
6395         }
6396
6397         Would produce a method called `ICloneable.Clone' instead of
6398         `System.ICloneable.Clone'.
6399
6400         * namespace.cs (Alias.Resolve): Use GetPartialName.
6401         
6402 2004-11-01  Marek Safar  <marek.safar@seznam.cz>
6403
6404         * cs-parser.jay: Add error 1055 report.
6405
6406 2004-11-01  Miguel de Icaza  <miguel@ximian.com>
6407
6408         * assign.cs (Assign.DoResolve): Only do the transform of
6409         assignment into a New if the types are compatible, if not, fall
6410         through and let the implicit code deal with the errors and with
6411         the necessary conversions. 
6412
6413 2004-11-01  Marek Safar  <marek.safar@seznam.cz>
6414
6415         * cs-parser.jay: Add error 1031 report.
6416
6417         * cs-tokenizer.cs: Add location for error 1038.
6418
6419 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
6420
6421         * cs-parser.jay: Add error 1016 report.
6422
6423 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
6424
6425         * cs-parser.jay: Add errors 1575,1611 report.
6426
6427 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
6428
6429         * cs-parser.jay: Add error 1001 report.
6430
6431 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
6432
6433         Fix #68850
6434         * attribute.cs (GetMarshal): Add method argument for
6435         caller identification.
6436
6437         * class.cs, codegen.cs, enum.cs, parameter.cs: Added
6438         agument for GetMarshal and RuntimeMissingSupport.
6439
6440 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
6441
6442         * attribute.cs (ExtractSecurityPermissionSet): Removed
6443         TypeManager.code_access_permission_type.
6444
6445         * typemanager.cs: Removed TypeManager.code_access_permission_type.
6446
6447 2004-10-27  Miguel de Icaza  <miguel@ximian.com>
6448
6449         * expression.cs (LocalVariableReference.DoResolveLValue): Check
6450         for obsolete use of a variable here.   Fixes regression on errors
6451         cs0619-25 and cs0619-26.
6452
6453 2004-10-27  Marek Safar  <marek.safar@seznam.cz>
6454
6455         Fix #62358, implemented security attribute encoding.
6456
6457         * attribute.cs (Attribute.CheckSecurityActionValididy): New method.
6458         Tests permitted SecurityAction for assembly or other types.
6459         (Assembly.ExtractSecurityPermissionSet): New method. Transforms
6460         data from SecurityPermissionAttribute to PermisionSet class.
6461
6462         * class.cs (ApplyAttributeBuilder): Added special handling
6463         for System.Security.Permissions.SecurityAttribute based types.
6464
6465         * codegen.cs (AssemblyClass.ApplyAttributeBuilder): Added
6466         special handling for System.Security.Permissions.SecurityAttribute
6467         based types.
6468
6469         * enum.cs (ApplyAttributeBuilder): Added special handling
6470         for System.Security.Permissions.SecurityAttribute based types.
6471
6472         * parameter.cs (ApplyAttributeBuilder): Added special handling
6473         for System.Security.Permissions.SecurityAttribute based types.
6474
6475         * rootcontext.cs: Next 2 core types.
6476
6477         * typemanager.cs (TypeManager.security_permission_attr_type):
6478         Built in type for the SecurityPermission Attribute.
6479         (code_access_permission_type): Build in type.
6480
6481 2004-10-17  Miguel de Icaza  <miguel@ximian.com>
6482
6483         * expression.cs (LocalVariableReference.DoResolveBase, Emit):
6484         Remove the tests for `ec.RemapToProxy' from here, and encapsulate
6485         all of this information into
6486         EmitContext.EmitCapturedVariableInstance.
6487         
6488         * codegen.cs (EmitCapturedVariableInstance): move here the
6489         funcionality of emitting an ldarg.0 in the presence of a
6490         remapping.   This centralizes the instance emit code.
6491
6492         (EmitContext.EmitThis): If the ScopeInfo contains a THIS field,
6493         then emit a load of this: it means that we have reached the
6494         topmost ScopeInfo: the one that contains the pointer to the
6495         instance of the class hosting the anonymous method.
6496
6497         * anonymous.cs (AddField, HaveCapturedFields): Propagate field
6498         captures to the topmost CaptureContext.
6499
6500 2004-10-12  Miguel de Icaza  <miguel@ximian.com>
6501
6502         * expression.cs (LocalVariableReference): Move the knowledge about
6503         the iterators into codegen's EmitCapturedVariableInstance.
6504
6505 2004-10-11  Miguel de Icaza  <miguel@ximian.com>
6506
6507         * codegen.cs (EmitContext.ResolveTopBlock): Emit a 1643 when not
6508         all code paths return a value from an anonymous method (it is the
6509         same as the 161 error, but for anonymous methods).
6510
6511 2004-10-08  Miguel de Icaza  <miguel@ximian.com>
6512
6513         The introduction of anonymous methods in the compiler changed
6514         various ways of doing things in the compiler.  The most
6515         significant one is the hard split between the resolution phase
6516         and the emission phases of the compiler.
6517
6518         For instance, routines that referenced local variables no
6519         longer can safely create temporary variables during the
6520         resolution phase: they must do so from the emission phase,
6521         since the variable might have been "captured", hence access to
6522         it can not be done with the local-variable operations from the runtime.
6523         
6524         * statement.cs 
6525
6526         (Block.Flags): New flag `IsTopLevel' to indicate that this block
6527         is a toplevel block.
6528
6529         (ToplevelBlock): A new kind of Block, these are the blocks that
6530         are created by the parser for all toplevel method bodies.  These
6531         include methods, accessors and anonymous methods.
6532
6533         These contain some extra information not found in regular blocks:
6534         A pointer to an optional CaptureContext (for tracking captured
6535         local variables and parameters).  A pointer to the parent
6536         ToplevelBlock.
6537         
6538         (Return.Resolve): Catch missmatches when returning a value from an
6539         anonymous method (error 1662).
6540         Invoke NeedReturnLabel from the Resolve phase instead of the emit
6541         phase.
6542
6543         (Break.Resolve): ditto.
6544
6545         (SwitchLabel): instead of defining the labels during the
6546         resolution phase, we now turned the public ILLabel and ILLabelCode
6547         labels into methods called GetILLabelCode() and GetILLabel() that
6548         only define the label during the Emit phase.
6549
6550         (GotoCase): Track the SwitchLabel instead of the computed label
6551         (its contained therein).  Emit the code by using
6552         SwitchLabel.GetILLabelCode ().
6553
6554         (LocalInfo.Flags.Captured): A new flag has been introduce to track
6555         whether the Local has been captured or not.
6556
6557         (LocalInfo.IsCaptured): New property, used to tell whether the
6558         local has been captured.
6559         
6560         * anonymous.cs: Vastly updated to contain the anonymous method
6561         support.
6562
6563         The main classes here are: CaptureContext which tracks any
6564         captured information for a toplevel block and ScopeInfo used to
6565         track the activation frames for various local variables.   
6566
6567         Each toplevel block has an optional capture context associated
6568         with it.  When a method contains an anonymous method both the
6569         toplevel method and the anonymous method will create a capture
6570         context.   When variables or parameters are captured, they are
6571         recorded on the CaptureContext that owns them, for example:
6572
6573         void Demo () {
6574              int a;
6575              MyDelegate d = delegate {
6576                  a = 1;
6577              }
6578         }
6579
6580         Here `a' will be recorded as captured on the toplevel
6581         CapturedContext, the inner captured context will not have anything
6582         (it will only have data if local variables or parameters from it
6583         are captured in a nested anonymous method.
6584
6585         The ScopeInfo is used to track the activation frames for local
6586         variables, for example:
6587
6588         for (int i = 0; i < 10; i++)
6589                 for (int j = 0; j < 10; j++){
6590                    MyDelegate d = delegate {
6591                         call (i, j);
6592                    }
6593                 }
6594
6595         At runtime this captures a single captured variable `i', but it
6596         captures 10 different versions of the variable `j'.  The variable
6597         `i' will be recorded on the toplevel ScopeInfo, while `j' will be
6598         recorded on a child.  
6599
6600         The toplevel ScopeInfo will also track information like the `this'
6601         pointer if instance variables were referenced (this is necessary
6602         as the anonymous method lives inside a nested class in the host
6603         type of the method). 
6604
6605         (AnonymousMethod): Expanded to track the Toplevel, implement
6606         `AnonymousMethod.Compatible' to tell whether an anonymous method
6607         can be converted to a target delegate type. 
6608
6609         The routine now also produces the anonymous method content
6610
6611         (AnonymousDelegate): A helper class that derives from
6612         DelegateCreation, this is used to generate the code necessary to
6613         produce the delegate for the anonymous method that was created. 
6614
6615         * assign.cs: API adjustments for new changes in
6616         Convert.ImplicitStandardConversionExists.
6617
6618         * class.cs: Adjustments to cope with the fact that now toplevel
6619         blocks are of type `ToplevelBlock'. 
6620
6621         * cs-parser.jay: Now we produce ToplevelBlocks for toplevel blocks
6622         insteda of standard blocks.
6623
6624         Flag errors if params arguments are passed to anonymous methods.
6625
6626         * codegen.cs (EmitContext): Replace `InAnonymousMethod' with
6627         `CurrentAnonymousMethod' which points to the current Anonymous
6628         Method.  The variable points to the AnonymousMethod class that
6629         holds the code being compiled.  It is set in the new EmitContext
6630         created for the anonymous method.
6631
6632         (EmitContext.Phase): Introduce a variable and an enumeration to
6633         assist in enforcing some rules about when and where we are allowed
6634         to invoke certain methods (EmitContext.NeedsReturnLabel is the
6635         only one that enfonces this right now).
6636
6637         (EmitContext.HaveCaptureInfo): new helper method that returns
6638         whether we have a CapturedContext initialized.
6639
6640         (EmitContext.CaptureVariable): New method used to register that a
6641         LocalInfo must be flagged for capturing. 
6642
6643         (EmitContext.CapturedParameter): New method used to register that a
6644         parameters must be flagged for capturing. 
6645         
6646         (EmitContext.CapturedField): New method used to register that a
6647         field must be flagged for capturing. 
6648
6649         (EmitContext.HaveCapturedVariables,
6650         EmitContext.HaveCapturedFields): Return whether there are captured
6651         variables or fields. 
6652
6653         (EmitContext.EmitMethodHostInstance): This is used to emit the
6654         instance for the anonymous method.  The instance might be null
6655         (static methods), this (for anonymous methods that capture nothing
6656         and happen to live side-by-side with the current method body) or a
6657         more complicated expression if the method has a CaptureContext.
6658
6659         (EmitContext.EmitTopBlock): Routine that drives the emission of
6660         code: it will first resolve the top block, then emit any metadata
6661         and then emit the code.  The split is done so that we can extract
6662         any anonymous methods and flag any captured variables/parameters.
6663         
6664         (EmitContext.ResolveTopBlock): Triggers the resolution phase,
6665         during this phase, the ILGenerator should not be used as labels
6666         and local variables declared here might not be accessible to any
6667         code that is part of an anonymous method.  
6668
6669         Exceptions to this include the temporary variables that are
6670         created by some statements internally for holding temporary
6671         variables. 
6672         
6673         (EmitContext.EmitMeta): New routine, in charge of emitting all the
6674         metadata for a cb
6675
6676         (EmitContext.TemporaryReturn): This method is typically called
6677         from the Emit phase, and its the only place where we allow the
6678         ReturnLabel to be defined other than the EmitMeta.  The reason is
6679         that otherwise we would have to duplicate a lot of logic in the
6680         Resolve phases of various methods that today is on the Emit
6681         phase. 
6682
6683         (EmitContext.NeedReturnLabel): This no longer creates the label,
6684         as the ILGenerator is not valid during the resolve phase.
6685
6686         (EmitContext.EmitThis): Extended the knowledge in this class to
6687         work in anonymous methods in addition to iterators. 
6688
6689         (EmitContext.EmitCapturedVariableInstance): This emits whatever
6690         code is necessary on the stack to access the instance to a local
6691         variable (the variable will be accessed as a field).
6692
6693         (EmitContext.EmitParameter, EmitContext.EmitAssignParameter,
6694         EmitContext.EmitAddressOfParameter): Routines to support
6695         parameters (not completed at this point). 
6696         
6697         Removals: Removed RemapLocal and RemapLocalLValue.  We probably
6698         will also remove the parameters.
6699
6700         * convert.cs (Convert): Define a `ConstantEC' which points to a
6701         null.  This is just to prefity some code that uses
6702         ImplicitStandardConversion code and do not have an EmitContext
6703         handy.
6704
6705         The idea is to flag explicitly that at that point in time, it is
6706         known that the conversion will not trigger the delegate checking
6707         code in implicit conversions (which requires a valid
6708         EmitContext). 
6709
6710         Everywhere: pass new EmitContext parameter since
6711         ImplicitStandardConversionExists now requires it to check for
6712         anonymous method conversions. 
6713
6714         (Convert.ImplicitStandardConversionExists): If the type of an
6715         expression is the anonymous_method_type, and the type is a
6716         delegate, we invoke the AnonymousMethod.Compatible method to check
6717         whether an implicit conversion is possible. 
6718
6719         (Convert.ImplicitConversionStandard): Only do implicit method
6720         group conversions if the language level is not ISO_1.
6721
6722         * delegate.cs (Delegate.GetInvokeMethod): Common method to get the
6723         MethodInfo for the Invoke method.  used by Delegate and
6724         AnonymousDelegate.
6725
6726         * expression.cs (Binary.DoNumericPromotions): only allow anonymous
6727         method conversions if the target type is a delegate.
6728
6729         Removed extra debugging nops.
6730
6731         (LocalVariableReference): Turn the `local_info' into a public
6732         field. 
6733
6734         Add `prepared' field, the same hack used for FieldExprs to cope
6735         with composed assignments, as Local variables do not necessarily
6736         operate purely on the stack as they used to: they can be captured
6737         fields. 
6738
6739         Add `temp' for a temporary result, like fields.
6740
6741         Refactor DoResolve and DoResolveLValue into DoResolveBase.
6742
6743         It now copes with Local variables that are captured and emits the
6744         proper instance variable to load it from a field in the captured
6745         case. 
6746
6747         (ParameterReference.DoResolveBase): During the resolve phase,
6748         capture parameters if we are in an anonymous method.
6749
6750         (ParameterReference.Emit, ParameterReference.AddressOf): If in an
6751         anonymous method, use the EmitContext helper routines to emit the
6752         parameter reference.
6753
6754         * iterators.cs: Set RemapToProxy to true/false during the
6755         EmitDispose class.
6756
6757         * parameters.cs (GetParameterByName): New helper method. 
6758
6759         * typemanager.cs (anonymous_method_type) a new type that
6760         represents an anonyous method.  This is always an internal type,
6761         used as a fencepost to test against the anonymous-methodness of an
6762         expression. 
6763         
6764 2004-10-20  Marek Safar  <marek.safar@seznam.cz>
6765
6766         * class.cs (MethodCore.CheckBase): Add errors 505, 533, 544,
6767         561 report.
6768         (PropertyBase.FindOutParentMethod): Add errors 545, 546 report.
6769
6770 2004-11-10  Martin Baulig  <martin@ximian.com>
6771
6772         * expression.cs (Invocation.BetterFunction): If two methods have
6773         equal parameter types, but only one of them is generic, the
6774         non-generic one wins.
6775         (New.DoResolve): Don't set `is_struct' to false if we're a generic
6776         instance; just use `Type.IsValueType' to determine whether
6777         something is a struct or not.
6778         (MemberAccess.DoResolveAsTypeStep): Don't modify the `args' field,
6779         so we can be called multiple times.
6780
6781 2004-11-10  Martin Baulig  <martin@ximian.com>
6782
6783         * generic.cs (TypeParameter.DefineConstraints): New public method.
6784         (TypeParameter.CheckAccessLevel): Override this and return true.
6785         (ConstructedType.ResolveType): Renamed to DoResolveType(), don't
6786         override ResolveType() anymore.
6787         (ConstructedType.DoResolveAsTypeStep): Call DoResolveType() here.
6788
6789 2004-11-10  Martin Baulig  <martin@ximian.com>
6790
6791         * rootcontext.cs (RootContext.LookupType): If we're a nested type,
6792         call DeclSpace.ResolveNestedType() on it.
6793
6794 2004-11-10  Martin Baulig  <martin@ximian.com>
6795
6796         * support.cs (ReflectionParameters.ParameterModifier): If `gpd' is
6797         non-null, call ParameterModifier() on it.
6798
6799 2004-11-10  Martin Baulig  <martin@ximian.com>
6800
6801         * iterators.cs
6802         (Iterators): Added `current_type' and `this_type' fields.
6803         (Iterators.DefineIterator): Create a new EmitContext and store it
6804         in `ec'; compute `this_type'.
6805
6806 2004-11-10  Martin Baulig  <martin@ximian.com>
6807
6808         * typemanager.cs
6809         (TypeManager.IsPrivateAccessible): New public method.
6810         (Closure.Filter): Use IsPrivateAccessible() instead of IsEqual().
6811
6812 2004-11-10  Martin Baulig  <martin@ximian.com>
6813
6814         * class.cs (TypeContainer.DefineType): Call
6815         TypeBuilder.DefineGenericParameters() before resolving the type
6816         parameters.
6817         (MethodData.parent_method): New protected field.
6818         (MethodData..ctor): Added `MethodInfo parent_method' argument.
6819         (MethodData.Define): Compute `parent_method'.
6820
6821         * decl.cs
6822         (MemberCore.GetObsoleteAttribute): Don't create a new EmitContext.
6823         (MemberCore.GetClsCompliantAttributeValue): Likewise.
6824         (DeclSpace.ec): New protected field; store the EmitContext here.
6825         (DeclSpace.EmitContext): New public property.
6826         (DeclSpace.ResolveType): Un-comment from the [Obsolte] attribute.
6827         (DeclSpace.ResolveNestedType): New public method.
6828         (DeclSpace.ResolveTypeExpr): Just call ResolveAsTypeTerminal() here.
6829         (DeclSpace.NestedAccessible): Added `Type tb' argument.
6830         (DeclSpace.FamilyAccessible): Likewise.
6831         (DeclSpace.FindType): Call ResolveNestedType() for nested types.
6832         (DeclSpace.GetClsCompliantAttributeValue): Don't create a new
6833         EmitContext.
6834
6835         * delegate.cs (Delegate.Define): Store the EmitContext in the `ec'
6836         field.
6837
6838         * enum.cs (Enum.Define): Store the EmitContext in the `ec' field.
6839         (Enum.Emit): Don't create a new EmitContext.
6840
6841 2004-10-18  Martin Baulig  <martin@ximian.com>
6842
6843         * statement.cs (Fixed.Resolve): Don't access the TypeExpr's
6844         `Type' directly, but call ResolveType() on it.
6845         (Catch.Resolve): Likewise.
6846         (Foreach.Resolve): Likewise.
6847
6848 2004-10-18  Martin Baulig  <martin@ximian.com>
6849
6850         * expression.cs (Cast.DoResolve): Don't access the TypeExpr's
6851         `Type' directly, but call ResolveType() on it.
6852         (Probe.DoResolve): Likewise.
6853         (ArrayCreation.LookupType): Likewise.
6854         (TypeOf.DoResolve): Likewise.
6855         (SizeOf.DoResolve): Likewise.
6856
6857 2004-10-18  Raja R Harinath  <rharinath@novell.com>
6858
6859         * class.cs (FieldMember.DoDefine): Reset ec.InUnsafe after doing
6860         the ResolveType.
6861
6862 2004-10-17  John Luke  <john.luke@gmail.com>
6863
6864         * class.cs (Operator.GetSignatureForError): use CSharpName
6865
6866         * parameter.cs (Parameter.GetSignatureForError): Returns
6867         correct name even if was not defined.
6868
6869 2004-10-13  Raja R Harinath  <rharinath@novell.com>
6870
6871         Fix #65816.
6872         * class.cs (TypeContainer.EmitContext): New property.
6873         (DefineNestedTypes): Create an emitcontext for each part.
6874         (MethodCore.DoDefineParameters): Use container's emitcontext.
6875         Pass type array to InternalParameters.
6876         (MemberBase.DoDefine): Use container's emitcontext.
6877         (FieldMember.Define): Likewise.
6878         (Event.Define): Likewise.
6879         (SetMethod.GetParameterInfo): Change argument to EmitContext.
6880         Pass type array to InternalParameters.
6881         (SetIndexerMethod.GetParameterInfo): Likewise.
6882         (SetMethod.Define): Pass emitcontext to GetParameterInfo.
6883         * delegate.cs (Define): Pass emitcontext to
6884         ComputeAndDefineParameterTypes and GetParameterInfo.  Pass type
6885         array to InternalParameters.
6886         * expression.cs (ParameterReference.DoResolveBase): Pass
6887         emitcontext to GetParameterInfo.
6888         (ComposedCast.DoResolveAsTypeStep): Remove check on
6889         ec.ResolvingTypeTree.
6890         * parameter.cs (Parameter.Resolve): Change argument to
6891         EmitContext.  Use ResolveAsTypeTerminal.
6892         (Parameter.GetSignature): Change argument to EmitContext.
6893         (Parameters.ComputeSignature): Likewise.
6894         (Parameters.ComputeParameterTypes): Likewise.
6895         (Parameters.GetParameterInfo): Likewise.
6896         (Parameters.ComputeAndDefineParameterTypes): Likewise.
6897         Re-use ComputeParameterTypes.  Set ec.ResolvingTypeTree.
6898         * support.cs (InternalParameters..ctor): Remove variant that takes
6899         a DeclSpace.
6900         * typemanager.cs (system_intptr_expr): New.
6901         (InitExpressionTypes): Initialize it.
6902
6903 2004-10-12  Chris Toshok  <toshok@ximian.com>
6904
6905         * cs-parser.jay: fix location for try_statement and catch_clause.
6906
6907 2004-10-18  Martin Baulig  <martin@ximian.com>
6908
6909         * class.cs (FieldMember.Define): Don't access the TypeExpr's
6910         `Type' directly, but call ResolveType() on it.
6911         (MemberBase.DoDefine): Likewise.
6912
6913         * expression.cs (New.DoResolve): Don't access the TypeExpr's
6914         `Type' directly, but call ResolveType() on it.
6915         (ComposedCast.DoResolveAsTypeStep): Likewise.
6916
6917         * statement.cs (LocalInfo.Resolve): Don't access the TypeExpr's
6918         `Type' directly, but call ResolveType() on it.
6919
6920 2004-10-17  John Luke  <john.luke@gmail.com>
6921
6922         * class.cs (Operator.GetSignatureForError): use CSharpName
6923
6924         * parameter.cs (Parameter.GetSignatureForError): Returns
6925         correct name even if was not defined.
6926
6927 2004-10-13  Raja R Harinath  <rharinath@novell.com>
6928
6929         Fix #65816.
6930         * class.cs (TypeContainer.EmitContext): New property.
6931         (DefineNestedTypes): Create an emitcontext for each part.
6932         (MethodCore.DoDefineParameters): Use container's emitcontext.
6933         Pass type array to InternalParameters.
6934         (MemberBase.DoDefine): Use container's emitcontext.
6935         (FieldMember.Define): Likewise.
6936         (Event.Define): Likewise.
6937         (SetMethod.GetParameterInfo): Change argument to EmitContext.
6938         Pass type array to InternalParameters.
6939         (SetIndexerMethod.GetParameterInfo): Likewise.
6940         (SetMethod.Define): Pass emitcontext to GetParameterInfo.
6941         * delegate.cs (Define): Pass emitcontext to
6942         ComputeAndDefineParameterTypes and GetParameterInfo.  Pass type
6943         array to InternalParameters.
6944         * expression.cs (ParameterReference.DoResolveBase): Pass
6945         emitcontext to GetParameterInfo.
6946         (ComposedCast.DoResolveAsTypeStep): Remove check on
6947         ec.ResolvingTypeTree.
6948         * parameter.cs (Parameter.Resolve): Change argument to
6949         EmitContext.  Use ResolveAsTypeTerminal.
6950         (Parameter.GetSignature): Change argument to EmitContext.
6951         (Parameters.ComputeSignature): Likewise.
6952         (Parameters.ComputeParameterTypes): Likewise.
6953         (Parameters.GetParameterInfo): Likewise.
6954         (Parameters.ComputeAndDefineParameterTypes): Likewise.
6955         Re-use ComputeParameterTypes.  Set ec.ResolvingTypeTree.
6956         * support.cs (InternalParameters..ctor): Remove variant that takes
6957         a DeclSpace.
6958         * typemanager.cs (system_intptr_expr): New.
6959         (InitExpressionTypes): Initialize it.
6960
6961 2004-10-12  Chris Toshok  <toshok@ximian.com>
6962
6963         * cs-parser.jay: fix location for try_statement and catch_clause.
6964
6965 2004-10-07  Raja R Harinath  <rharinath@novell.com>
6966
6967         More DeclSpace.ResolveType avoidance.
6968         * decl.cs (MemberCore.InUnsafe): New property.
6969         * class.cs (MemberBase.DoDefine): Use ResolveAsTypeTerminal 
6970         with newly created EmitContext.
6971         (FieldMember.Define): Likewise.
6972         * delegate.cs (Delegate.Define): Likewise.
6973         * ecore.cs (SimpleName.ResolveAsTypeStep): Lookup with alias
6974         only if normal name-lookup fails.
6975         (TypeExpr.DoResolve): Enable error-checking.
6976         * expression.cs (ArrayCreation.DoResolve): Use ResolveAsTypeTerminal.
6977         (SizeOf.DoResolve): Likewise.
6978         (ComposedCast.DoResolveAsTypeStep): Likewise.
6979         (StackAlloc.DoResolve): Likewise.
6980         * statement.cs (Block.Flags): Add new flag 'Unsafe'.
6981         (Block.Unsafe): New property.
6982         (Block.EmitMeta): Set ec.InUnsafe as appropriate.
6983         (Unsafe): Set 'unsafe' flag of contained block.
6984         (LocalInfo.Resolve): Use ResolveAsTypeTerminal.
6985         (Fixed.Resolve): Likewise.
6986         (Catch.Resolve): Likewise.
6987         (Using.ResolveLocalVariableDecls): Likewise.
6988         (Foreach.Resolve): Likewise.
6989
6990 2004-10-05  John Luke <john.luke@gmail.com>
6991
6992         * cs-parser.jay: add location to error CS0175
6993
6994 2004-10-04  Miguel de Icaza  <miguel@ximian.com>
6995
6996         * ecore.cs (Expression.Constantity): Add support for turning null
6997         into a constant.
6998
6999         * const.cs (Const.Define): Allow constants to be reference types
7000         as long as the value is Null.
7001
7002 2004-10-04  Juraj Skripsky  <js@hotfeet.ch>
7003
7004         * namespace.cs (NamespaceEntry.Using): No matter which warning
7005         level is set, check if this namespace name has already been added.
7006
7007 2004-10-03 Ben Maurer  <bmaurer@ximian.com>
7008
7009         * expression.cs: reftype [!=]= null should always use br[true,false].
7010         # 67410
7011
7012 2004-10-03  Marek Safar  <marek.safar@seznam.cz>
7013
7014         Fix #67108
7015         * attribute.cs: Enum conversion moved to 
7016         GetAttributeArgumentExpression to be applied to the all
7017         expressions.
7018
7019 2004-10-01  Raja R Harinath  <rharinath@novell.com>
7020
7021         Fix #65833, test-300.cs, cs0122-5.cs, cs0122-6.cs.
7022         * class.c (TypeContainer.DefineType): Flag error if
7023         base types aren't accessible due to access permissions.
7024         * decl.cs (DeclSpace.ResolveType): Move logic to
7025         Expression.ResolveAsTypeTerminal.
7026         (DeclSpace.ResolveTypeExpr): Thin layer over
7027         Expression.ResolveAsTypeTerminal.
7028         (DeclSpace.CheckAccessLevel, DeclSpace.FamilyAccess):
7029         Refactor code into NestedAccess.  Use it.
7030         (DeclSpace.NestedAccess): New.
7031         * ecore.cs (Expression.ResolveAsTypeTerminal): Add new
7032         argument to silence errors.  Check access permissions.
7033         (TypeExpr.DoResolve, TypeExpr.ResolveType): Update.
7034         * expression.cs (ProbeExpr.DoResolve): Use ResolveAsTypeTerminal.
7035         (Cast.DoResolve): Likewise.
7036         (New.DoResolve): Likewise.
7037         (InvocationOrCast.DoResolve,ResolveStatement): Likewise.
7038         (TypeOf.DoResolve): Likewise.
7039
7040         * expression.cs (Invocation.BetterConversion): Return the Type of
7041         the better conversion.  Implement section 14.4.2.3 more faithfully.
7042         (Invocation.BetterFunction): Make boolean.  Make correspondence to
7043         section 14.4.2.2 explicit.
7044         (Invocation.OverloadResolve): Update.
7045         (Invocation): Remove is_base field.
7046         (Invocation.DoResolve): Don't use is_base.  Use mg.IsBase.
7047         (Invocation.Emit): Likewise.
7048
7049 2004-09-24  Marek Safar  <marek.safar@seznam.cz>
7050
7051         * cs-parser.jay: Reverted 642 warning fix.
7052
7053 2004-09-23  Marek Safar  <marek.safar@seznam.cz>
7054
7055         Fix bug #66615
7056         * decl.cs (FindMemberWithSameName): Indexer can have more than
7057         1 argument.
7058
7059 2004-09-23  Marek Safar  <marek.safar@seznam.cz>
7060
7061         * expression.cs (LocalVariableReference.DoResolveLValue):
7062         Do not report warning 219 for out values.
7063         (EmptyExpression.Null): New member to avoid extra allocations.
7064
7065 2004-09-23  Marek Safar  <marek.safar@seznam.cz>
7066
7067         * cs-parser.jay: Fix wrong warning 642 report.
7068
7069         * cs-tokenizer.cs (CheckNextToken): New helper;
7070         Inspect next character if is same as expected.
7071
7072 2004-09-23  Martin Baulig  <martin@ximian.com>
7073
7074         * convert.cs (Convert.ImplicitReferenceConversion): Some code cleanup.
7075         (Convert.ImplicitReferenceConversionExists): Likewise.
7076
7077 2004-11-09  Raja R Harinath  <rharinath@novell.com>
7078
7079         * Makefile (DISTFILES): Comment out a few missing files.
7080
7081 2004-10-29  Raja R Harinath  <rharinath@novell.com>
7082
7083         * Makefile (bootstrap_libs,bootstrap_libfiles): New.
7084         (bootstrap-libs): New target.  Invokes the net_2_0_bootstrap profile.
7085         (gmcs.exe): Invoke bootstrap-libs.
7086         (clean-local): Clean the net_2_0_bootstrap profile too.
7087         (PROGRAM_INSTALL_DIR): New.
7088         (install-local): Use it.
7089
7090 2004-10-13  Martin Baulig  <martin@ximian.com>
7091
7092         * generic.cs (TypeManager.InflatedConstraints): New nested class.
7093         (TypeParameter.DefineType): If we're a method type parameter and
7094         that method is overriding something, "inflate" its constraints.
7095
7096 2004-10-12  Martin Baulig  <martin@ximian.com>
7097
7098         * expression.cs (MemberAccess.DoResolve): If we're a SimpleName
7099         and have type arguments, create and resolve a ConstructedType.
7100
7101 2004-10-12  Martin Baulig  <martin@ximian.com>
7102
7103         * decl.cs (MemberCache.FindMemberToOverride): Use
7104         TypeManager.IsEqual() to compare the parameters and Type.Equals()
7105         to compare the invocationType.
7106
7107         * typemanager.cs (TypeManager.IsEqual): Added support for arrays.
7108         When comparing two type parameters, only do the signature-only
7109         comparision for method type parameters.
7110
7111 2004-10-11  Martin Baulig  <martin@ximian.com>
7112
7113         * report.cs: Don't make --fatal abort on warnings, we have
7114         -warnaserror for that.
7115
7116 2004-10-11  Martin Baulig  <martin@ximian.com>
7117
7118         * typemanager.cs
7119         (TypeManager.IsEqualGenericType): Removed, use IsEqual() instead.
7120         (TypeManager.IsEqual): Call ourself recursively instead of using
7121         Type.IsEqual(). 
7122
7123 2004-10-11  Martin Baulig  <martin@ximian.com>
7124
7125         * class.cs (TypeContainer.DefineType): Only call TypeParameter.Define()
7126         on our own type parameters, not on the ones we inherit from a containing
7127         class.
7128
7129         * expression.cs (Invocation.InferType): Use `==', not `Equals()' for
7130         the comparision.
7131
7132         * generic.cs (TypeParameter.Define): We may only be called once.
7133
7134         * pending.cs (Pending.InterfaceMethod): Call TypeManager.Real_IsEqual()
7135         instead of TypeManager.IsEqual().
7136
7137 2004-09-28  Martin Baulig  <martin@ximian.com>
7138
7139         * generic.cs
7140         (GenericConstraints.EffectiveBaseClass): New public property.
7141         (TypeParameter.GenericConstraints): New public property.
7142         (ConstructedType.CheckConstraints): Improved.
7143
7144         * convert.cs (Convert.TypeParam_EffectiveBaseType): New private method.
7145         (Convert.TypeParameterConversion): New private method; use this in
7146         ImplicitReferenceConversion() and ImplicitReferenceConversionExists()
7147         for all conversions related to type parameters.
7148
7149 2004-09-24  Martin Baulig  <martin@ximian.com>
7150
7151         * convert.cs (Convert.ImplicitReferenceConversion): Added implicit
7152         type parameter conversions for type parameters which are known to
7153         be reference types.
7154
7155 2004-09-24  Martin Baulig  <martin@ximian.com>
7156
7157         * generic.cs (GenericConstraints): Added `IsReferenceType' and
7158         `IsValueType' properties.
7159
7160         * support.cs (ReflectionConstraints): Use
7161         Type.GetGenericParameterConstraints() instead of the old hack.
7162
7163 2004-09-24  Martin Baulig  <martin@ximian.com>
7164
7165         * generic.cs (GenericConstraints): Moved here and made it an
7166         abstract class.
7167
7168         * support.cs (GenericConstraints): Moved to generic.cs.
7169
7170 2004-09-24  Martin Baulig  <martin@ximian.com>
7171
7172         * support.cs
7173         (ReflectionConstraints): Un-nested this class and made it public.
7174
7175         * typemanager.cs
7176         (TypeManager.GetTypeParameterConstraints): New public method.
7177         (TypeManager.HasConstructorConstraint): Use the attributes.
7178
7179 2004-09-24  Martin Baulig  <martin@ximian.com>
7180
7181         * support.cs (GenericConstraints): Replaced `HasConstructor',
7182         `IsReferenceType' and `IsValueType' with `Attributes'.
7183         (ReflectionParameters.ReflectionConstraints): Removed the Create()
7184         method and made the .ctor public.
7185
7186         * generic.cs (Constraints.Attributes): New public property.
7187         (Constraints): Renamed `HasConstructor' -> `HasConstructorConstraint',
7188         `IsReferenceType' -> `HasReferenceTypeConstraint' and
7189         `IsValueType' -> `HasValueTypeConstraint'.
7190
7191 2004-09-23  Martin Baulig  <martin@ximian.com>
7192
7193         * generic.cs (Constraints): Reflect latest runtime changes.
7194
7195 2004-09-23  Martin Baulig  <martin@ximian.com>
7196
7197         * convert.cs (Convert.ImplicitReferenceConversion): Some code cleanup.
7198         (Convert.ImplicitReferenceConversionExists): Likewise.
7199
7200 2004-09-23  Marek Safar  <marek.safar@seznam.cz>
7201
7202         * class.cs (Operator.Define): Add error 448 and 559 report.
7203         
7204 2004-09-22  Marek Safar  <marek.safar@seznam.cz>
7205
7206         * class.cs (MemberBase.IsTypePermitted): New protected
7207         method for checking error CS0610.
7208
7209 2004-09-22  Marek Safar  <marek.safar@seznam.cz>
7210
7211         * class.cs (TypeContainer.HasExplicitLayout): New property
7212         Returns whether container has StructLayout attribute set Explicit.
7213         (FieldMember): New abstract class for consts and fields.
7214         (FieldMember.ApplyAttributeBuilder): Add error 636 and 637 report.
7215         (Field): Reuse FieldMember.
7216
7217         * const.cs (Const): Reuse FieldMember.
7218
7219         * rootcontext.cs: EmitConstants call moved to class.
7220
7221 2004-09-22  Martin Baulig  <martin@ximian.com>
7222
7223         Marek and me just fixed one of our oldest bugs: #28562 :-)
7224
7225         * ecore.cs (EnumConstant.GetValueAsEnumType): New public method.
7226
7227         * attribute.cs (Attribute.GetAttributeArgumentExpression): If
7228         we're an EnumConstant, just return that.
7229         (Attribute.Resolve): GetAttributeArgumentExpression() may give us
7230         an EnumConstant.  In this case, we need to use GetValueAsEnumType()
7231         to get the value which'll actually be written into the attribute.
7232         However, we have to use GetValue() to access the attribute's value
7233         in the compiler.        
7234
7235 2004-09-22  Marek Safar  <marek.safar@seznam.cz>
7236
7237         * constant.cs (Constant.IsNegative): New abstract property
7238         IsNegative.
7239
7240         * expression.cs (ArrayAccess.DoResolve): Add warning 251.
7241         (StackAlloc.DoResolve): Reused IsNegative.
7242
7243 2004-09-22  Martin Baulig  <martin@ximian.com>
7244
7245         * typemanager.cs (TypeManager.LookupGenericTypeContainer): New
7246         public method; like LookupTypeContainer, but also works for
7247         generic instances.
7248
7249         * report.cs (Report.SymbolRelatedToPreviousError): Use
7250         TypeManager.LookupGenericTypeContainer().       
7251
7252 2004-09-22  Martin Baulig  <martin@ximian.com>
7253
7254         Thanks to Peter Sestoft for this bug report.
7255
7256         * expression.cs (Conditional): If both the `trueExpr' and the
7257         `falseExpr' is a NullLiteral, return a NullLiteral.
7258
7259 2004-09-22  Martin Baulig  <martin@ximian.com>
7260
7261         * statement.cs (Foreach.EmitCollectionForeach): If we're in an
7262         iterator, use `enumerator.EmitThis()' instead of `ec.EmitThis()'
7263         for the "get_Current" call.
7264
7265 2004-09-21  Martin Baulig  <martin@ximian.com>
7266
7267         * convert.cs (Convert.ImplicitReferenceConversion): When
7268         converting to an interface type, first check whether we're
7269         converting from a reference type.
7270
7271 2004-09-14  Martin Baulig  <martin@ximian.com>
7272
7273         * decl.cs (MemberCore.Emit): Always call VerifyObsoleteAttribute().
7274
7275 2004-09-14  Marek Safar  <marek.safar@seznam.cz>
7276
7277         Fixed bug #61902
7278         * codegen.cs (TestObsoleteMethodUsage): Trace when method is
7279         called and is obsolete then this member suppress message
7280         when call is inside next [Obsolete] method or type.
7281
7282         * expression.cs: Use TestObsoleteMethodUsage member.
7283
7284 2004-09-14  Martin Baulig  <martin@ximian.com>
7285
7286         * genericparser.cs: Removed.
7287
7288 2004-09-13  Marek Safar  <marek.safar@seznam.cz>
7289
7290         * class.cs (MethodCore.CheckBase): Fix bug #65757.
7291
7292 2004-09-12  Marek Safar  <marek.safar@seznam.cz>
7293
7294         * attribute.cs (Attribute.Resolve): Add error 653 report.
7295
7296         * class.cs (Class.ApplyAttributeBuilder): Add error 641
7297         report.
7298         (Method.ApplyAttributeBuilder): Add error 685 report.
7299         (Operator.Define): Add error 564 report.
7300
7301         * cs-tokenizer.cs (handle_hex): Add error 1013 report.
7302
7303         * expression.cs (Invocation.DoResolve): Add error
7304         245 and 250 report.
7305
7306         * parameter.cs (Parameter.ApplyAttributeBuilder): Add
7307         error 674 report.
7308
7309 2004-09-11  Marek Safar  <marek.safar@seznam.cz>
7310
7311         * class.cs (ConstructorInitializer.Resolve):
7312         Wrong error number (515->516).
7313
7314 2004-09-11  Marek Safar  <marek.safar@seznam.cz>
7315
7316         * class.cs (Indexer.Define): Add error 631 report.
7317
7318 2004-09-11  Marek Safar  <marek.safar@seznam.cz>
7319
7320         * ecore.cs (Error_NegativeArrayIndex): Fix 248 error.
7321
7322 2004-09-11  Marek Safar  <marek.safar@seznam.cz>
7323
7324         * expression.cs (Probe.DoResolve): Add error CS0241 report.
7325
7326 2004-09-10  Marek Safar  <marek.safar@seznam.cz>
7327
7328         * cs-parser.jay: Added error CS0241 report.
7329
7330 2004-09-10  Raja R Harinath  <rharinath@novell.com>
7331
7332         * cs-parser.jay (fixed_statement): Introduce a scope for the
7333         declaration in the 'fixed' statement.
7334
7335 2004-09-09  Marek Safar  <marek.safar@seznam.cz>
7336
7337         * cs-parser.jay: Added CS0230 error report.
7338
7339 2004-09-09  Marek Safar  <marek.safar@seznam.cz>
7340
7341         * cs-parser.jay: Added errors CS0231 and CS0257 report.
7342
7343 2004-09-09  Marek Safar  <marek.safar@seznam.cz>
7344
7345         * expression.cs (Argument.Resolve): Added error CS0192 and
7346         CS0199 report.
7347
7348 2004-09-09  Marek Safar  <marek.safar@seznam.cz>
7349
7350         C# 2.0 #pragma warning feature
7351
7352         * cs-tokenizer.cs (PreProcessPragma): New method; 
7353         Handles #pragma directive.
7354
7355         * report.cs (WarningRegions): New class; Support
7356         class for #pragma warning directive. It tests whether
7357         warning is enabled for a given line.
7358
7359 2004-09-08  Miguel de Icaza  <miguel@ximian.com>
7360
7361         * const.cs: Add more descriptive error report, tahnks to
7362         Sebastien. 
7363
7364 2004-09-08  Marek Safar  <marek.safar@seznam.cz>
7365
7366         * ecore.cs (FieldExpr.DoResolveLValue): Fixed CS0198 report.
7367
7368 2004-09-07  Miguel de Icaza  <miguel@ximian.com>
7369
7370         * expression.cs: Apply patch from Ben: Remove dead code from
7371         ArrayCreation, and remove the TurnintoConstant call in const.cs,
7372         as that code just threw an exception anwyays.
7373
7374         * const.cs: Remove the call to the turnintoconstant, for details
7375         see bug: #63144
7376         
7377         * literal.cs: The type of the null-literal is the null type;  So
7378         we use a placeholder type (literal.cs:System.Null, defined here)
7379         for it.
7380
7381         * expression.cs (Conditional.DoResolve): Remove some old code that
7382         is no longer needed, conversions have been fixed.
7383
7384         (ArrayCreationExpression.DoResolve): Return false if we fail to
7385         resolve the inner expression.
7386
7387 2004-09-07  Raja R Harinath  <rharinath@novell.com>
7388
7389         Fix test-290.cs.
7390         * cs-parser.jay (delegate_declaration): Record a delegate
7391         declaration as a type declaration.
7392         Reported by Jo Vermeulen <jo@lumumba.luc.ac.be>.
7393
7394 2004-09-06  Miguel de Icaza  <miguel@ximian.com>
7395
7396         * parameter.cs: Do not crash if the type can not be resolved. 
7397
7398         * expression.cs: Report errors with unsafe pointers, fixes #64896
7399
7400 2004-09-06 Ben Maurer  <bmaurer@users.sourceforge.net>
7401
7402         * expression.cs: Pointer arith always needs to do a conv.i
7403         if the operand is a long. fix 65320
7404
7405 2004-09-04  Marek Safar  <marek.safar@seznam.cz>
7406
7407         Fixed cs0619-37.cs, cs0619-38.cs
7408
7409         * enum.cs (GetObsoleteAttribute): Removed.
7410
7411         * expression.cs (MemberAccess.DoResolve): Test for [Obsolete]
7412         on Enum member is double staged. The first is tested member
7413         and then enum.
7414
7415 2004-09-04  Marek Safar  <marek.safar@seznam.cz>
7416
7417         Fixed #56986, #63631, #65231
7418
7419         * class.cs: (TypeContainer.AddToMemberContainer): New method,
7420         adds member to name container.
7421         (TypeContainer.AddToTypeContainer): New method, adds type to
7422         name container.
7423         (AddConstant, AddEnum, AddClassOrStruct, AddDelegate, AddMethod,
7424         AddConstructor, AddInterface, AddField, AddProperty, AddEvent,
7425         AddOperator): Simplified by reusing AddToMemberContainer.
7426         (TypeContainer.UserDefinedStaticConstructor): Changed to property
7427         instead of field.
7428         (Method.CheckForDuplications): Fixed implementation to test all
7429         possibilities.
7430         (MemberBase): Detection whether member is explicit interface
7431         implementation is now in constructor.
7432         (MemberBase.UpdateMemberName): Handles IndexerName.
7433         (Accessor): Changed to keep also location information.
7434         (AbstractPropertyEventMethod): Is derived from MemberCore.
7435         (AbstractPropertyEventMethod.IsDummy): Says whether accessor
7436         will be emited or not.
7437         (PropertyBase.AreAccessorsDuplicateImplementation):
7438         Tests whether accessors are not in collision with some method.
7439         (Operator): Is derived from MethodCore to simplify common
7440         operations.
7441
7442         * decl.cs (Flags.TestMethodDuplication): Test for duplication
7443         must be performed.
7444         (DeclSpace.AddToContainer): Adds the member to defined_names
7445         table. It tests for duplications and enclosing name conflicts.
7446
7447         * enum.cs (EnumMember): Clean up to reuse the base structures
7448
7449 2004-09-03  Martin Baulig  <martin@ximian.com>
7450
7451         Merged latest changes into gmcs.  Please keep this comment in
7452         here, it makes it easier for me to see what changed in MCS since
7453         the last time I merged.
7454
7455 2004-09-03  Martin Baulig  <martin@ximian.com>
7456
7457         * class.cs (TypeContainer.DefineDefaultConstructor): Put this back
7458         into TypeContainer, to make partial classes work again.
7459
7460 2004-09-03  Martin Baulig  <martin@ximian.com>
7461
7462         * rootcontext.cs (RootContext.V2): Removed.
7463
7464 2004-03-23  Martin Baulig  <martin@ximian.com>
7465
7466         * expression.cs (Invocation.OverloadResolve): Added `bool
7467         may_fail' argument and use it instead of the Location.IsNull() hack.
7468
7469 2004-09-09  Martin Baulig  <martin@ximian.com>
7470
7471         * cs-parser.jay (namespace_declaration): Fixed CS0134 reporting.
7472
7473 2004-09-09  Martin Baulig  <martin@ximian.com>
7474
7475         * generic.cs (TypeParameter.DefineType): Added support for
7476         explicit interface methods.
7477
7478 2004-09-09  Martin Baulig  <martin@ximian.com>
7479
7480         * README.Changes: New document.  Started to list important changes
7481         between MCS and GMCS here.
7482
7483 2004-09-08  Martin Baulig  <martin@ximian.com>
7484
7485         * class.cs
7486         (TypeContainer.CheckRecursiveDefinition): New protected method.
7487         (TypeContainer.DefineType): Move the CS0146 check into
7488         CheckRecursiveDefinition().     
7489
7490 2004-09-06  Martin Baulig  <martin@ximian.com>
7491
7492         * generic.cs (ConstructedType.CheckConstraints): Allow builtin
7493         types for the constructor constraint.
7494
7495 2004-09-03  Martin Baulig  <martin@ximian.com>
7496
7497         * class.cs (TypeContainer.DefineDefaultConstructor): Put this back
7498         into TypeContainer, to make partial classes work again.
7499
7500 2004-09-03  Martin Baulig  <martin@ximian.com>
7501
7502         * rootcontext.cs (RootContext.V2): Removed.
7503
7504 2004-03-23  Martin Baulig  <martin@ximian.com>
7505
7506         * expression.cs (Invocation.OverloadResolve): Added `bool
7507         may_fail' argument and use it instead of the Location.IsNull() hack.
7508
7509 2004-09-03  Martin Baulig  <martin@ximian.com>
7510
7511         Merged latest changes into gmcs.  Please keep this comment in
7512         here, it makes it easier for me to see what changed in MCS since
7513         the last time I merged.
7514
7515 2004-09-03  Raja R Harinath  <rharinath@novell.com>
7516
7517         Fix #61128.
7518         * expression.cs (BetterConversion): Don't allow either conversion 
7519         to be null.  Remove redundant implicit conversion test when 'q ==
7520         null' -- when this function is invoked, we already know that the
7521         implicit conversion exists.
7522         (BetterFunction): Assume that 'best' is non-null.  Remove
7523         redundant reimplementation of IsApplicable when 'best' is null.
7524         (IsParamsMethodApplicable, IsApplicable): Add new parameter for
7525         number of arguments.
7526         (IsAncestralType): Extract from OverloadResolve.
7527         (OverloadResolve): Make robust to the MethodGroupExpr being
7528         unsorted.  Implement all the logic of Section 14.5.5.1, and
7529         support overloading of methods from multiple applicable types.
7530         Clean up logic somewhat.  Don't pass null methods to BetterFunction.
7531
7532         * report.cs (SymbolRelatedToPreviousError): Cleanup output.
7533         (RealError, Warning): Append type of report to related symbol.
7534
7535 2004-09-03  Marek Safar  <marek.safar@seznam.cz>
7536
7537         * enum.cs: Fixed CLS-Compliance checks for enum members.
7538         Error tests cs3008-8.cs, cs3014-8.cs
7539
7540 2004-09-02  Marek Safar  <marek.safar@seznam.cz>
7541
7542         Fixed bug #62342, #63102
7543         * class.cs: ImplementIndexer uses member.IsExplicitImpl
7544         like ImplementMethod.
7545
7546 2004-09-02  Marek Safar  <marek.safar@seznam.cz>
7547
7548         * attribute.cs (Attribute.GetAttributeArgumentExpression):
7549         Fixed bug #65170.
7550
7551 2004-09-02  Martin Baulig  <martin@ximian.com>
7552
7553         * statement.cs (Using.EmitLocalVariableDeclFinally): Use
7554         TypeManager.GetArgumentTypes() rather than calling GetParameters()
7555         on the MethodBase.
7556
7557 2004-09-01  Marek Safar  <marek.safar@seznam.cz>
7558
7559         C# 2.0 Static classes implemented
7560
7561         * class.cs (TypeContainer): instance_constructors,
7562         initialized_fields, initialized_static_fields,
7563         default_constructor, base_inteface_types are protected to be
7564         accessible from StaticClass.
7565         (TypeContainer.DefineDefaultConstructor): New virtual method
7566         for custom default constructor generating
7567         (StaticClass): New class to handle "Static classes" feature.
7568
7569         * cs-parser.jay: Handle static keyword on class like instance
7570         of StaticClass.
7571
7572         * driver.cs: Added "/langversion" command line switch with two
7573         options (iso-1, default).
7574
7575 2004-08-31  Marek Safar  <marek.safar@seznam.cz>
7576
7577         * ecore.cs (FieldExpr.Resolve): Fixed bug #64689.
7578
7579 2004-08-31  Miguel de Icaza  <miguel@ximian.com>
7580
7581         * delegate.cs: Style.
7582
7583 2004-08-31 Ben Maurer  <bmaurer@users.sourceforge.net>
7584
7585         * delegate.cs: Add seperate instance expr field for miguel.
7586
7587 2004-08-29 Ben Maurer  <bmaurer@users.sourceforge.net>
7588
7589         * PointerArithmetic (Resolve): make sure we are not doing
7590         pointer arith on void*. Also, make sure we are resolved
7591         by not setting eclass until resolve.
7592
7593         All callers: Make sure that PointerArithmetic gets resolved.
7594
7595 2004-08-29 Ben Maurer  <bmaurer@users.sourceforge.net>
7596
7597         * ArrayCreation (LookupType): If the type does not resolve 
7598         to an array, give an error.
7599
7600 2004-08-27  Marek Safar  <marek.safar@seznam.cz>
7601
7602         * statement.cs (Try.Resolve): Fixed bug #64222
7603
7604 2004-08-27  Martin Baulig  <martin@ximian.com>
7605
7606         * class.cs
7607         (TC.OperatorArrayList.OperatorEntry.CheckPairedOperators): Don't
7608         crash here.     
7609
7610 2004-08-26  Marek Safar  <marek.safar@seznam.cz>
7611
7612         * ecore.cs (Constantify): Get underlying type via
7613         System.Enum.GetUnderlyingType to avoid StackOverflow on the
7614         Windows in special cases.
7615
7616 2004-08-26  Marek Safar  <marek.safar@seznam.cz>
7617
7618         * typemanager.cs (GetAddMethod): Used GetAddMethod (true)
7619         for obtaining also private methods.
7620         (GetRemoveMethod): Used GetRemoveMethod (true)
7621         for obtaining also private methods.
7622
7623 2004-09-02  Martin Baulig  <martin@ximian.com>
7624
7625         * statement.cs (Using.EmitLocalVariableDeclFinally): Use
7626         TypeManager.GetArgumentTypes() rather than calling GetParameters()
7627         on the MethodBase.
7628
7629 2004-08-27  Martin Baulig  <martin@ximian.com>
7630
7631         * class.cs
7632         (TC.OperatorArrayList.OperatorEntry.CheckPairedOperators): Don't
7633         crash here.     
7634
7635 2004-08-25  Martin Baulig  <martin@ximian.com>
7636
7637         * support.cs (ReflectionParameters..ctor): If this is a generic
7638         method, retrieve and store its type parameters.
7639         (InternalParameters..ctor): Added `TypeParameter[]' argument.
7640         (ReflectionParameters.GenericConstraints): The argument specifies
7641         the type parameter, not the method parameter.
7642         (InternalParameters.GenericConstraints): Likewise.
7643
7644         * generic.cs (TypeParameter.DefineType): Correctly handle
7645         constraints wrt. generic methods in interfaces and their
7646         implementations.        
7647
7648 2004-08-24  Martin Baulig  <martin@ximian.com>
7649
7650         * generic.cs (TypeParameter.IsSubclassOf): New public method.
7651         (Constraints.IsSubclassOf): New internal method.
7652
7653         * typemanager.cs (TypeManager.FindMembers): Added special support
7654         for GenericTypeParameterBuilder's.      
7655         (TypeManager.IsSubclassOf, IsFamilyAccessible): Added support for
7656         type parameters.
7657
7658 2004-08-24  Martin Baulig  <martin@ximian.com>
7659
7660         * typemanager.cs
7661         (TypeManager.IsSubclassOf): Renamed to IsFamilyAccessible; use
7662         this for accessibility checks.
7663         (TypeManager.IsSubclassOrNestedChildOf): Renamed to
7664         IsNestedFamilyAccessible.
7665         (TypeManager.IsSubclassOf): New method, do what the name actually
7666         says.   
7667
7668 2004-08-24  Martin Baulig  <martin@ximian.com>
7669
7670         * expression.cs (MemberAccess.DoResolve): When resolving ourselves
7671         as a SimpleName, include the generic arity.
7672
7673 2004-08-24  Martin Baulig  <martin@ximian.com>
7674
7675         * class.cs (Method.Define): Set MethodAttributes.SpecialName and
7676         MethodAttributes.HideBySig for operators.
7677
7678 2004-08-23  Martin Baulig  <martin@ximian.com>
7679
7680         Back to the old error reporting system :-)
7681
7682         * report.cs (Message): Removed.
7683         (Report.MessageData, ErrorData, WarningData): Removed.
7684         (Report.Error, Warning): Back to the old system.
7685
7686 2004-08-23  Martin Baulig  <martin@ximian.com>
7687
7688         * decl.cs (IMemberContainer.Parent): Renamed to ParentContainer.
7689
7690         * class.cs (TypeContainer.ParentContainer): New public virtual
7691         method; replaces the explicit interface implementation.
7692         (ClassPart.ParentContainer): Override.
7693
7694 2004-08-23  Martin Baulig  <martin@ximian.com>
7695
7696         * statement.cs (Switch): Added support for constant switches; see
7697         #59428 or test-285.cs.
7698
7699 2004-08-22  Marek Safar  <marek.safar@seznam.cz>
7700
7701         Fixed bug #62740.
7702         * statement.cs (GetEnumeratorFilter): Removed useless
7703         logic because C# specs is strict. GetEnumerator must be
7704         public.
7705
7706 2004-08-22  Martin Baulig  <martin@ximian.com>
7707
7708         * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
7709         a switch and may break, reset the barrier.  Fixes #59867.
7710
7711 2004-08-22  Marek Safar  <marek.safar@seznam.cz>
7712
7713         CLS-Compliance speed up (~5% for corlib)
7714
7715         * attribute.cs (AttributeTester.VerifyTopLevelNameClsCompliance):
7716         New method. Tests container for CLS-Compliant names
7717
7718         * class.cs (TypeContainer.VerifyClsName): New method.
7719         Checks whether container name is CLS Compliant.
7720         (Constructor): Implements IMethodData.
7721
7722         * decl.cs (MemberCache.GetPublicMembers ): New method. Builds
7723         low-case table for CLS Compliance test.
7724         (MemberCache.VerifyClsParameterConflict): New method.
7725         Checks method parameters for CS3006 error.
7726
7727         * enum.cs (EnumMember): Is derived from MemberCore.
7728         (Enum.VerifyClsName): Optimized for better performance.
7729
7730 2004-08-06  Marek Safar  <marek.safar@seznam.cz>
7731
7732         * report.cs: Renamed Error_T to Error and changed all
7733         references.
7734
7735 2004-08-06  Marek Safar  <marek.safar@seznam.cz>
7736
7737         * class.cs (TypeContainer.IndexerArrayList): New inner class
7738         container for indexers.
7739         (TypeContainer.DefaultIndexerName): New constant for default
7740         indexer name. Replaced all "Item" with this constant.
7741         (TypeContainer.DefineIndexers): Moved to IndexerArrayList class.
7742
7743         * typemanager.cs (TypeManager.default_member_ctor): Cache here
7744         DefaultMemberAttribute constructor.
7745
7746 2004-08-05  Martin Baulig  <martin@ximian.com>
7747
7748         * flowanalysis.cs (FlowBranching.UsageVector.MergeJumpOrigins):
7749         Fix bug #59429.
7750
7751 2004-08-05  Marek Safar  <marek.safar@seznam.cz>
7752
7753         * mcs.exe.sources: $(EXTRA_SOURCES) are now here to avoid
7754         multi platforms problem.
7755
7756         * compiler.csproj: Included shared files.
7757
7758 2004-08-04  Marek Safar  <marek.safar@seznam.cz>
7759
7760         Fix bug 60333, 55971 in the more general way
7761         * attribute.cs (Attribute.GetAttributeArgumentExpression):
7762         Added arg_type argument for constant conversion.
7763         (Attribute.Resolve): Reuse GetAttributeArgumentExpression.
7764
7765 2004-08-04  Marek Safar  <marek.safar@seznam.cz>
7766
7767         Fix bug #59760
7768         * class.cs (TypeContainer ): New inner classes MethodArrayList, 
7769         OperatorArrayList, MethodCoreArrayList for typecontainer
7770         containers. Changed class member types to these new types.
7771         (MethodArrayList.DefineMembers): Added test for CS0659.
7772
7773 2004-08-04  Miguel de Icaza  <miguel@ximian.com>
7774
7775         * cfold.cs: Synchronize the folding with the code in expression.cs
7776         Binary.DoNumericPromotions for uint operands.
7777
7778         * attribute.cs: Revert patch from Raja, it introduced a regression
7779         while building Blam-1.2.1 (hard to isolate a test case).
7780
7781 2004-08-04  Marek Safar  <marek.safar@seznam.cz>
7782
7783         Fix for #55382
7784         * class.cs:
7785         (TypeContainer.Define): Renamed to DefineContainerMembers because of
7786         name collision.
7787         (MethodCore.parent_method): New member. The method we're overriding
7788         if this is an override method.
7789         (MethodCore.CheckBase): Moved from Method class and made common.
7790         (MethodCore.CheckMethodAgainstBase): Moved from MemberBase and made
7791         private.
7792         (MethodCore.CheckForDuplications): New abstract method. For custom
7793         member duplication search in a container
7794         (MethodCore.FindOutParentMethod): New abstract method. Gets parent
7795         method and its return type.
7796         (Event.conflict_symbol): New member. Symbol with same name in the
7797         parent class.
7798
7799         * decl.cs:
7800         (MemberCache.FindMemberWithSameName): New method. The method
7801         is looking for conflict with inherited symbols.
7802
7803 2004-08-04  Martin Baulig  <martin@ximian.com>
7804
7805         * codegen.cs (VariableStorage.EmitLoadAddress): New public method.
7806
7807         * statement.cs (Foreach.EmitFinally): Make this work for valuetypes.
7808
7809 2004-08-03  Marek Safar  <marek.safar@seznam.cz>
7810
7811         * report.cs (Message): New enum for better error, warning reference in
7812         the code.
7813         (MessageData): New inner abstract class. It generally handles printing of
7814         error and warning messages.
7815         Removed unused Error, Warning, Message methods.
7816
7817 2004-08-03  Marek Safar  <marek.safar@seznam.cz>
7818
7819         Fix for cs0592-8.cs test
7820         * attribute.cs
7821         (Attributable.ValidAttributeTargets): Made public.
7822         (Attribute.ExplicitTarget): New member for explicit target value.
7823         (Attribute.CheckTargets): Now we translate explicit attribute
7824         target to Target here.
7825
7826 2004-08-03  Ben Maurer  <bmaurer@ximian.com>
7827
7828         * ecore.cs (MethodGroupExpr): new IsBase property.
7829
7830         * expression.cs (BaseAccess): Set IsBase on MethodGroupExpr.
7831
7832         * delegate.cs (DelegateCreation): store a MethodGroupExpr
7833         rather than an instance expr.
7834
7835         (DelegateCreation.Emit): Use the method group rather than
7836         the instance expression. Also, if you have base.Foo as the
7837         method for a delegate, make sure to emit ldftn, not ldftnvirt.
7838
7839         (ResolveMethodGroupExpr): Use the MethodGroupExpr. 
7840
7841         (NewDelegate.DoResolve): Only check for the existance of Invoke
7842         if the method is going to be needed. Use MethodGroupExpr.
7843
7844         (NewDelegate.Emit): Remove, DelegateCreation implements this.   
7845
7846         * expression.cs: For pointer arith., make sure to use
7847         the size of the type, not the size of the pointer to
7848         the type.
7849
7850 2004-08-03  Marek Safar  <marek.safar@seznam.cz>
7851
7852         Fix for #60722
7853         * class.cs (Class): Added error CS0502 test.
7854
7855 2004-08-03  John Luke  <jluke@cfl.rr.com>
7856             Raja R Harinath  <rharinath@novell.com>
7857
7858         Fix for #60997.
7859         * attribute.cs (Attribute.complained_before): New flag.
7860         (Attribute.ResolveType, Attribute.Resolve),
7861         (Attribute.DefinePInvokeMethod): Set it.
7862         (Attributes.Search): Pass 'complain' to Attribute.ResolveType.
7863         
7864 2004-08-03  Martin Baulig  <martin@ximian.com>
7865
7866         * expression.cs (Binary.ResolveOperator): Don't abort if we can't
7867         use a user-defined operator; we still need to do numeric
7868         promotions in case one argument is a builtin type and the other
7869         one has an implicit conversion to that type.  Fixes #62322.
7870
7871 2004-08-18  Martin Baulig  <martin@ximian.com>
7872
7873         * class.cs (Method.Define): Use the correct method name when
7874         creating the MethodBuilder for a generic method.
7875
7876 2004-08-17  Martin Baulig  <martin@ximian.com>
7877
7878         * generic.cs (Constraints): Support type parameter constraints.
7879
7880 2004-08-16  Martin Baulig  <martin@ximian.com>
7881
7882         * cs-tokenizer.cs (Tokenizer.TypeOfParsing): New public property.
7883         (Token.GENERIC_DIMENSION): New token; this is returned if we
7884         encounter an unbound generic type in a typeof() expression.
7885
7886         * cs-parser.jay (opt_type_argument_list): Added GENERIC_DIMENSION;
7887         this token is only generated while parsing a typeof() expression.
7888         (typeof_expression): Removed the old unbound_type hack.
7889
7890         * generic.cs (TypeArguments.IsUnbound): New public property.
7891
7892         * decl.cs (MemberName): Added support for unbound types.
7893
7894 2004-08-14  Martin Baulig  <martin@ximian.com>
7895
7896         * typemanager.cs
7897         (TypeManager.IsEqualGenericInstance): New static method.
7898         (TypeManager.IsSubclassOrNestedChildOf, IsSubclassOf): This is
7899         just used to check accessibility, so follow the rules of 26.1.6.        
7900
7901         * expression.cs (MemberAccess.ResolveAsTypeStep): Return a
7902         ConstructedType instead of a TypeExpression if we have type arguments.
7903
7904         * cs-parser.jay (typeof_expression): Support unbound generic types.
7905
7906         * ecore.cs (UnboundTypeExpression): New public class.
7907
7908 2004-08-12  Martin Baulig  <martin@ximian.com>
7909
7910         * typemanager.cs (TypeManager.IsNestedChildOf): Use
7911         TypeManager.IsEqual() rather than `=='.
7912
7913         * decl.cs (DeclSpace.CheckAccessLevel): Use `tb.FullName' for
7914         generic instances as well.
7915
7916 2004-08-12  Martin Baulig  <martin@ximian.com>
7917
7918         * expression.cs (Invocation.InferType): We can only infer method
7919         type parameters.  Fixes #62647.
7920
7921 2004-08-11  Martin Baulig  <martin@ximian.com>
7922
7923         * class.cs (TypeContainer.DefineType): Create the TypeBuilder
7924         before resolving the base classes.
7925
7926 2004-08-06 Gonzalo Paniagua Javier <gonzalo@ximian.com>
7927
7928         * Makefile: install .mdb file too.
7929
7930 2004-08-05  Martin Baulig  <martin@ximian.com>
7931
7932         * ecore.cs (FieldExpr.DoResolveLValue): If we're resolving a field
7933         initializer, the current type is just the TypeBuilder, not the
7934         instantiated generic type.
7935         (FieldExpr.IsFieldInitializer): New public property.
7936
7937 2004-08-04  Martin Baulig  <martin@ximian.com>
7938
7939         * codegen.cs (VariableStorage.EmitLoadAddress): New public method.
7940
7941         * statement.cs (Foreach.EmitFinally): Make this work for valuetypes.
7942
7943 2004-08-03  Martin Baulig  <martin@ximian.com>
7944
7945         * class.cs (MethodData.Define): If we're an explicit
7946         implementation, remove the generic arity from the type name.
7947
7948 2004-08-03  Martin Baulig  <martin@ximian.com>
7949
7950         * expression.cs (Binary.ResolveOperator): Don't abort if we can't
7951         use a user-defined operator; we still need to do numeric
7952         promotions in case one argument is a builtin type and the other
7953         one has an implicit conversion to that type.  Fixes #62322.
7954
7955 2004-08-02  Martin Baulig  <martin@ximian.com>
7956
7957         * class.cs (TypeContainer.ifaces): Make this a `Type[]', not a
7958         `TypeExpr[]' array.
7959         (TypeContainer.GetClassBases): Return the unexpanded list of
7960         interfaces; we expand them later.
7961         (TypeContainer.DefineType): After creating the TypeBuilder, call
7962         TypeManager.ExpandInterfaces() to get an expanded and resolved
7963         list of interfaces.
7964
7965         * ecore.cs (TypeExpr.GetInterfaces): Removed
7966
7967         * generics.cs (Constraints.InterfaceConstraints): Remove.
7968         (TypeParameter.DefineType): Call TypeManager.RegisterBuilder() to
7969         register the interface constraints.
7970
7971         * typemanager.cs
7972         (TypeManager.AddUserType): Removed the `ifaces' argument.
7973         (TypeManager.AddTypeParameter): Likewise.
7974         (TypeManager.AddUserInterface): Removed, was unused.
7975         (TypeManager.RegisterBuilder): Take a `Type[]' instead of a
7976         `TypeExpr[]' array for the interfaces.
7977         (TypeManager.ExpandInterfaces): Call this after the TypeBuilder
7978         has been defined, returns a list of the resolved interfaces types.
7979         (TypeManager.GetInterfaces): Return a `Type[]', not a `TypeExpr[]'.
7980         (TypeManager.GetExplicitInterfaces): Likewise.  
7981
7982 2004-08-02  Martin Baulig  <martin@ximian.com>
7983
7984         * expression.cs (Invocation.EmitCall): If we're invoking a method
7985         on a type parameter, use the new `Constrained' prefix opcode.
7986
7987 2004-08-02  Martin Baulig  <martin@ximian.com>
7988
7989         * statement.cs (LocalInfo.Flags): Added `IsThis'.
7990         (LocalInfo.IsThis): New public property.
7991         (Block.EmitMeta): Don't create a LocalBuilder for `this'.
7992
7993 2004-08-01  Martin Baulig  <martin@ximian.com>
7994
7995         * class.cs (TypeContainer.GetClassBases): Don't set the default
7996         here since we may get called from GetPartialBases().
7997         (TypeContainer.DefineType): If GetClassBases() didn't return a
7998         parent, use the default one.
7999
8000 2004-07-30  Martin Baulig  <martin@ximian.com>
8001
8002         * Makefile (EXTRA_SOURCES): List the symbol writer's sources here.
8003
8004         * class.cs (SourceMethod): New public class, derive from the
8005         symbol writer's ISourceMethod.
8006         (Method): Use the new symbol writer API.
8007
8008         * codegen.cs (CodeGen.InitializeSymbolWriter): Take the filename
8009         as argument and use the new symbol writer.
8010
8011         * location.cs
8012         (SourceFile): Implement the symbol writer's ISourceFile.
8013         (Location.SymbolDocument): Removed.
8014         (Location.SourceFile): New public property.
8015
8016         * symbolwriter.cs: Use the new symbol writer API.
8017
8018 2004-07-30  Raja R Harinath  <rharinath@novell.com>
8019
8020         * Makefile (install-local): Remove.  Functionality moved to
8021         executable.make.
8022
8023 2004-07-28  Lluis Sanchez Gual  <lluis@novell.com>
8024
8025         * Makefile: Install mcs.exe.config file together with mcs.exe.
8026         * mcs.exe.config: Added supportedRuntime entry to make sure it runs in the
8027         correct runtime version.
8028         
8029 2004-07-25  Martin Baulig  <martin@ximian.com>
8030
8031         * class.cs
8032         (TypeContainer.RegisterOrder): Removed, this was unused.
8033         (TypeContainer, interface_order): Removed.
8034         (TypeContainer.AddClass, AddStruct, AddInterface): Take a
8035         TypeContainer as argument since we can also be called with a
8036         `PartialContainer' for a partial class/struct/interface.
8037         (TypeContainer.IsInterface): Use `Kind == Kind.Interface' instead
8038         of checking whether we're an `Interface' - we could be a
8039         `PartialContainer'.
8040         (PartialContainer.Register): Override; call
8041         AddClass()/AddStruct()/AddInterface() on our parent.
8042
8043         * cs-parser.jay (interface_member_declaration): Add things to the
8044         `current_container', not the `current_class'.
8045
8046         * rootcontext.cs (RegisterOrder): The overloaded version which
8047         takes an `Interface' was unused, removed.
8048
8049         * typemanager.cs (TypeManager.LookupInterface): Return a
8050         `TypeContainer', not an `Interface'.
8051         (TypeManager.IsInterfaceType): The `builder_to_declspace' may
8052         contain a `PartialContainer' for an interface, so check it's
8053         `Kind' to figure out what it is.
8054
8055 2004-07-25  Martin Baulig  <martin@ximian.com>
8056
8057         * class.cs (Class.DefaultTypeAttributes): New public constant.
8058         (Struct.DefaultTypeAttributes): Likewise.
8059         (Interface.DefaultTypeAttributes): Likewise.
8060         (PartialContainer.TypeAttr): Override this and add the
8061         DefaultTypeAttributes.
8062
8063 2004-07-25  Martin Baulig  <martin@ximian.com>
8064
8065         * decl.cs (DeclSpace.Emit): Removed the `TypeContainer' argument,
8066         we can just use the `Parent' field instead.
8067
8068 2004-07-25  Martin Baulig  <martin@ximian.com>
8069
8070         * class.cs (TypeContainer.Emit): Renamed to EmitType().
8071
8072 2004-07-25  Martin Baulig  <martin@ximian.com>
8073
8074         * class.cs (TypeContainer.DefineMembers): Call DefineMembers() on
8075         our parts before defining any methods.
8076         (TypeContainer.VerifyImplements): Make this virtual.
8077         (ClassPart.VerifyImplements): Override and call VerifyImplements()
8078         on our PartialContainer.
8079
8080 2004-07-25  Martin Baulig  <martin@ximian.com>
8081
8082         * iterators.cs (Iterator.Define): Renamed to DefineIterator().
8083
8084         * decl.cs (DeclSpace.Define): Removed the `TypeContainer'
8085         argument, we can just use the `Parent' field instead.
8086
8087         * class.cs
8088         (MemberBase.CheckBase): Removed the `TypeContainer' argument.   
8089         (MemberBase.DoDefine): Likewise.
8090
8091 2004-07-24  Martin Baulig  <martin@ximian.com>
8092
8093         * decl.cs (MemberCore.Parent): New public field.
8094         (DeclSpace.Parent): Moved to MemberCore.
8095
8096         * class.cs (MethodCore.ds): Removed; use `Parent' instead.
8097         (MemberBase.ctor): Added TypeContainer argument, pass it to our
8098         parent's .ctor.
8099         (FieldBase, Field, Operator): Likewise.
8100         (EventProperty.ctor): Take a TypeContainer instead of a DeclSpace.
8101         (EventField, Event): Likewise.
8102
8103 2004-07-23  Martin Baulig  <martin@ximian.com>
8104
8105         * class.cs (PartialContainer): New public class.
8106         (ClassPart): New public class.
8107         (TypeContainer): Added support for partial classes.
8108         (TypeContainer.GetClassBases): Splitted some of the functionality
8109         out into GetNormalBases() and GetPartialBases().
8110
8111         * cs-tokenizer.cs (Token.PARTIAL): New token.
8112         (Tokenizer.consume_identifier): Added some hacks to recognize
8113         `partial', but only if it's immediately followed by `class',
8114         `struct' or `interface'.
8115
8116         * cs-parser.jay: Added support for partial clases.
8117
8118 2004-07-23  Martin Baulig  <martin@ximian.com>
8119
8120         * class.cs (MethodCore.ds): Made this a `TypeContainer' instead of
8121         a `DeclSpace' and also made it readonly.
8122         (MethodCore.ctor): Take a TypeContainer instead of a DeclSpace.
8123         (Method.ctor, Constructor.ctor, Destruktor.ctor): Likewise.
8124         (PropertyBase.ctor, Property.ctor, Indexer.ctor): Likewise.
8125
8126         * cs-parser.jay: Pass the `current_class', not the
8127         `current_container' (at the moment, this is still the same thing)
8128         to a new Method, Property, Event, Indexer or Constructor.
8129
8130 2004-07-23  Martin Baulig  <martin@ximian.com>
8131
8132         * cs-parser.jay (CSharpParser): Added a new `current_class' field
8133         and removed the `current_interface' one.
8134         (struct_declaration, class_declaration, interface_declaration):
8135         Set `current_class' to the newly created class/struct/interface;
8136         set their `Bases' and call Register() before parsing their body.
8137
8138 2004-07-23  Martin Baulig  <martin@ximian.com>
8139
8140         * class.cs (Kind): New public enum.
8141         (TypeContainer): Made this class abstract.
8142         (TypeContainer.Kind): New public readonly field.
8143         (TypeContainer.CheckDef): New public method; moved here from
8144         cs-parser.jay.
8145         (TypeContainer.Register): New public abstract method.
8146         (TypeContainer.GetPendingImplementations): New public abstract
8147         method.
8148         (TypeContainer.GetClassBases): Removed the `is_class' and
8149         `is_iface' parameters.
8150         (TypeContainer.DefineNestedTypes): Formerly known as
8151         DoDefineType().
8152         (ClassOrStruct): Made this class abstract.
8153
8154         * tree.cs (RootTypes): New public type. 
8155
8156 2004-07-20  Martin Baulig  <martin@ximian.com>
8157
8158         * tree.cs (Tree.RecordNamespace): Removed.
8159         (Tree.Namespaces): Removed.
8160
8161         * rootcontext.cs (RootContext.IsNamespace): Removed.
8162
8163         * cs-parser.jay (namespace_declaration): Just create a new
8164         NamespaceEntry here.
8165
8166 2004-07-21  Lluis Sanchez Gual  <lluis@novell.com>
8167
8168         * Makefile: Install gmcs.exe.config file together with gmcs.exe.
8169         * gmcs.exe.config: Renamed from mcs.exe.config. Added supportedRuntime
8170         entry to make sure it runs in the correct runtime version.
8171         
8172 2004-07-18  Martin Baulig  <martin@ximian.com>
8173
8174         * generic.cs (ConstructedType.CheckConstraints): Improved
8175         constraints checking.
8176
8177 2004-07-18  Martin Baulig  <martin@ximian.com>
8178
8179         * expression.cs (Invocation.BetterMethod): Call
8180         TypeManager.TypeToCoreType() on all types and removed my previous
8181         hack; we're already doig the right thing here.
8182
8183 2004-07-17  Martin Baulig  <martin@ximian.com>
8184
8185         * decl.cs (MemberName.MakeName): Create the "class`1" names here.
8186
8187 2004-07-16  Martin Baulig  <martin@ximian.com>
8188
8189         * iterators.cs: Added generics support.
8190
8191 2004-07-16  Martin Baulig  <martin@ximian.com>
8192
8193         * iterators.cs: Rewrote this.  We're now using one single Proxy
8194         class for both the IEnumerable and the IEnumerator interface and
8195         `Iterator' derives from Class so we can use the high-level API.
8196
8197         * class.cs (TypeContainer.AddIterator): New method.
8198         (TypeContainer.DoDefineType): New protected virtual method, which
8199         is called from DefineType().
8200         (TypeContainer.DoDefineMembers): Call DefineType() and
8201         DefineMembers() on all our iterators.
8202         (TypeContainer.Emit): Call Emit() on all our iterators.
8203         (TypeContainer.CloseType): Call CloseType() on all our iterators.
8204
8205         * codegen.cs (EmitContext.CurrentIterator): New public field.
8206
8207 2004-07-15  Martin Baulig  <martin@ximian.com>
8208
8209         * typemanager.cs
8210         (TypeManager.not_supported_exception_type): New type.   
8211
8212 2004-07-14  Martin Baulig  <martin@ximian.com>
8213
8214         * typemanager.cs
8215         (TypeManager.generic_ienumerable_type): New type.
8216         (TypeManager.generic_ienumerator_type): New type.
8217
8218         * rootcontext.cs
8219         (RootContext.interfaces_first_stage): Added
8220         "System.Collections.Generic.IEnumerator`1" and
8221         "System.Collections.Generic.IEnumerable`1".     
8222
8223 2004-07-14  Martin Baulig  <martin@ximian.com>
8224
8225         * iterators.cs: Use real error numbers.
8226
8227 2004-07-14  Martin Baulig  <martin@ximian.com>
8228
8229         * iterator.cs (IteratorHandle.IsIEnumerable): The spec explicitly
8230         requires this to be a System.Collection.IEnumerable and not a
8231         class implementing that interface.
8232         (IteratorHandle.IsIEnumerator): Likewise, for IEnumerator.      
8233
8234 2004-07-13  Marek Safar  <marek.safar@seznam.cz>
8235
8236         * class.cs: Fixed previous fix, it broke some error tests.
8237
8238 2004-07-12  Martin Baulig  <martin@ximian.com>
8239
8240         * enum.cs (Enum.Define): Call Emit() to emit the attributes.
8241         Fixes #61293.
8242
8243 2004-07-14  Martin Baulig  <martin@ximian.com>
8244
8245         * decl.cs, expression.cs, generic.cs: Use a backqoute (`) and not
8246         an exclamation mark (!) for the generic arity to reflect the
8247         latest spec changes; ie. use "System.Collections.Generic.IList`1".
8248
8249 2004-07-13  Martin Baulig  <martin@ximian.com>
8250
8251         * cs-tokenizer.cs (Tokenizer.parse_less_than): Allow array rank
8252         specifiers being part of a type argument.
8253
8254 2004-07-13  Martin Baulig  <martin@ximian.com>
8255
8256         * expression.cs (MemberAccess.ResolveAsTypeStep): Use the full `!'
8257         name for generic types.
8258
8259 2004-07-13  Martin Baulig  <martin@ximian.com>
8260
8261         * assign.cs (Assign.DoResolve): Moved the CS0131 check up a little
8262         bit to fix #60119.
8263
8264 2004-07-09  Miguel de Icaza  <miguel@ximian.com>
8265
8266         * assign.cs (LocalTemporary): Add new argument: is_address,If
8267         `is_address' is true, then the value that we store is the address
8268         to the real value, and not the value itself.
8269         
8270         * ecore.cs (PropertyExpr): use the new local temporary
8271         stuff to allow us to handle X.Y += z (where X is a struct)
8272
8273 2004-07-08  Martin Baulig  <martin@ximian.com>
8274
8275         * statement.cs (Lock.Resolve): Set ec.NeedReturnLabel() if we do
8276         not always return, just like we're doing in Using.Resolve().
8277
8278 2004-07-07  Miguel de Icaza  <miguel@ximian.com>
8279
8280         * cs-parser.jay (fixed_statement): flag this as Pinned.
8281
8282 2004-07-06  Miguel de Icaza  <miguel@ximian.com>
8283
8284         * typemanager.cs (TypeManager): Removed MakePinned method, this
8285         mechanism is replaced with the .NET 2.x compatible mechanism of
8286         calling `ILGenerator.DeclareLocal (Type t, bool pinned)'.
8287
8288         * statement.cs (LocalInfo): Remove MakePinned, add Pinned property 
8289         Rename `Fixed' to `Pinned' as a flag, to distinguish from the
8290         `IsFixed' property which has a different meaning.
8291
8292 2004-07-02  Raja R Harinath  <rharinath@novell.com>
8293
8294         * ecore.cs (DoSimpleNameResolve): Expand CS0038 check to all names
8295         visible from inside a nested class, not just the names of the
8296         immediately enclosing class.
8297         Fix for bug #60730.
8298
8299 2004-06-24  Raja R Harinath  <rharinath@novell.com>
8300
8301         * expression.cs (BetterConversion): Remove buggy special-case
8302         handling of "implicit constant expression conversions".  At this
8303         point, we already know that the conversion is possible -- we're
8304         only checking to see which is better.
8305
8306 2004-06-24  Marek Safar  <marek.safar@seznam.cz>
8307
8308         * cs-parser.jay: Added error CS0210 test.
8309
8310 2004-06-24  Marek Safar  <marek.safar@seznam.cz>
8311
8312         * cs-parser.jay: Added error CS0134 test.
8313
8314 2004-06-24  Marek Safar  <marek.safar@seznam.cz>
8315
8316         Fix bug #52507
8317         * cs-parser.jay: Added error CS0145 test.
8318
8319 2004-06-24  Marek Safar  <marek.safar@seznam.cz>
8320
8321         * class.cs (Operator.Define): Added test for errors CS0553, CS0554.
8322
8323 2004-06-23  Ben Maurer  <bmaurer@ximian.com>
8324         
8325         * expression.cs (StackAlloc.Resolve): The argument may not
8326         be a constant; deal with this case.
8327         
8328 2004-06-23  Marek Safar  <marek.safar@seznam.cz>
8329
8330         * attribute.cs (IndexerName_GetIndexerName): Renamed to
8331         GetIndexerAttributeValue.
8332         (ScanForIndexerName): Renamed to GetIndexerNameAttribute.
8333
8334         * class.cs (Indexer.Define): Added error tests for CS0415,
8335         CS0609.
8336
8337 2004-06-23  Miguel de Icaza  <miguel@ximian.com>
8338
8339         * attribute.cs (Attribute.Resolve): Keep field code in sync with
8340         property code.
8341
8342 2004-06-23  Martin Baulig  <martin@ximian.com>
8343
8344         * flowanalysis.cs (UsageVector.MergeChild): If we're a loop and we
8345         neither return nor throw, reset the barrier as well.  Fixes #60457.
8346
8347 2004-06-22  Atsushi Enomoto  <atsushi@ximian.com>
8348
8349         * class.cs : EventAttributes is now set to None by default.
8350           This fixes bug #60459.
8351
8352 2004-06-18  Marek Safar  <marek.safar@seznam.cz>
8353
8354         Fix bug #60219
8355         * class.cs (ConstructorInitializer.GetOverloadedConstructor):
8356         Don't throw exception but return null (it's sufficient now).
8357
8358 2004-06-18  Marek Safar  <marek.safar@seznam.cz>
8359
8360         * typemanager.cs (GetArgumentTypes): Faster implementation.
8361
8362 2004-06-18  Martin Baulig  <martin@ximian.com>
8363
8364         * attribute.cs (Attribute.Resolve): Check whether we're an
8365         EmptyCast which a Constant child.  Fixes #60333.
8366
8367 2004-06-17  Ben Maurer  <bmaurer@ximian.com>
8368
8369         * statement.cs (EmitCollectionForeach): Account for the fact that
8370         not all valuetypes are in areas which we can take the address of.
8371         For these variables, we store to a temporary variable. Also, make
8372         sure that we dont emit a `callvirt' on a valuetype method.
8373
8374 2004-06-15  Marek Safar  <marek.safar@seznam.cz>
8375
8376         * expression.cs (StackAlloc.DoReSolve): Added test for
8377         negative parameter (CS0247).
8378
8379 2004-06-15  Marek Safar  <marek.safar@seznam.cz>
8380
8381         Fix bug #59792
8382         * class.cs: (Event.DelegateMethod.Emit): Added synchronization flag.
8383
8384 2004-06-15  Marek Safar  <marek.safar@seznam.cz>
8385
8386         Fix bug #59781
8387         * expression.cs: (Binary.DoNumericPromotions): Added conversion for
8388         ulong.
8389
8390 2004-06-14  Marek Safar  <marek.safar@seznam.cz>
8391
8392         Fix bug #58254 & cs1555.cs, cs1556.cs
8393         * driver.cs (MainDriver): Added tests for errors CS1555, CS1556.
8394
8395 2004-06-14  Marek Safar  <marek.safar@seznam.cz>
8396
8397         * cs-parser.jay: Added error CS1669 test for indexers.
8398
8399 2004-06-18  Martin Baulig  <martin@ximian.com>
8400
8401         * generics.cs (GenericMethod.ctor): Don't take an Attributes
8402         argument.  Fixes #60441.
8403
8404 2004-06-16  Ben Maurer  <bmaurer@ximian.com>
8405         * ecore.cs (MethodGroupExpr.Name): Revert Martin's patch.
8406         The name needs to have the actual name of the method in order
8407         for other tests (such as the one in OverloadResolve for Invoke
8408         on a delegate) to work. As well, it does not really help
8409         error reporting because the method group had multiple methods.
8410         * Makefile: Remove MCS_DEBUG, you can enable with the DEBUG_FLAGS.
8411         Make profiling work.
8412         
8413 2004-06-13  Martin Baulig  <martin@ximian.com>
8414
8415         * cs-parser.jay: Don't allow generic attributes.
8416
8417 2004-06-13  Martin Baulig  <martin@ximian.com>
8418
8419         * class.cs (MemberBase.DoDefineBase): New protected method.
8420         (MemberBase.DoDefine): Compute the `flags' in the new
8421         DoDefineBase() which must be called first.
8422         (Method.Define): Call DoDefineBase() first so we have the flags
8423         when defining the generic method.
8424
8425         * cs-parser.jay (interface_method_declaration): Support generic methods.
8426
8427 2004-06-13  Martin Baulig  <martin@ximian.com>
8428
8429         * decl.cs (TypeName): Removed.
8430         (MemberName): Removed TypeName and MemberNow; now we just have
8431         MemberName.
8432
8433         * cs-parser.jay: Don't distinguish between type arguments and type
8434         parameters in the grammar and simplified the rules a bit.  The
8435         reduce/reduce conflicts are now gone (except the one we inherited
8436         from mcs).
8437
8438 2004-06-11  Martin Baulig  <martin@ximian.com>
8439
8440         * expression.cs (Invocation.IsParamsMethodApplicable): We need to
8441         call this twice: for params and varargs methods.
8442
8443 2004-06-11  Marek Safar  <marek.safar@seznam.cz>
8444
8445         * class.cs:
8446         (FieldBase.DoDefine, PropertyBase.DoDefine): Added error test CS0610.
8447
8448 2004-06-11  Marek Safar  <marek.safar@seznam.cz>
8449
8450         * attribute.cs (Attribute.GetValidTargets): Made public.
8451
8452         * class.cs: 
8453         (AbstractPropertyEventMethod): New class for better code sharing.
8454         (AbstractPropertyEventMethod.ApplyAttributeBuilder): Add error
8455         CS1667 report.
8456         (PropertyMethod, DelegateMethod): Derived from AbstractPropertyEventMethod
8457
8458 2004-06-09  Martin Baulig  <martin@ximian.com>
8459
8460         * cs-parser.jay: Removed a reduce/reduce conflict.
8461
8462 2004-06-03  Martin Baulig  <martin@ximian.com>
8463
8464         * generic.cs (ConstructedType.GetMemberAccess): Renamed to
8465         GetSimpleName() and return a SimpleName.
8466
8467         * ecore.cs (SimpleName.Arguments): New public field.
8468         (SimpleName): Added overloaded ctor which takes an additional
8469         TypeArguments argument.
8470         (SimpleName.SimpleNameResolve): Added support for generic methods.
8471         (MethodGroupExpr.ResolveGeneric): New public method.  The code was
8472         formerly in MemberAccess.DoResolve(), but we also need it in
8473         SimpleNameResolve().
8474
8475         * expression.cs (MemberAccess.DoResolve): Use the new
8476         MethodGroupExpr.ResolveGeneric().       
8477
8478 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
8479
8480         * decl.cs: If possible, use lookuptypedirect here. We can only do
8481         this if there is no `.' after the namespace. Avoids using
8482         LookupType, which does lots of slow processing.
8483         (FindNestedType) New method, does what it says :-).
8484         * namespace.cs: use LookupTypeDirect.
8485         * rootcontext.cs: use membercache, if possible.
8486         * typemanager.cs (LookupTypeDirect): Cache negative hits too.
8487
8488 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
8489
8490         * expression.cs:
8491         According to the spec, 
8492
8493         In a member access of the form E.I, if E is a single identifier,
8494         and if the meaning of E as a simple-name (§7.5.2) is a constant,
8495         field, property, localvariable, or parameter with the same type as
8496         the meaning of E as a type-name (§3.8), then both possible
8497         meanings of E are permitted.
8498
8499         We did not check that E as a simple-name had the same type as E as
8500         a type name.
8501
8502         This trivial check gives us 5-7% on bootstrap time.
8503
8504 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
8505
8506         * expression.cs (Invocation.OverloadResolve): Avoid the
8507         use of hashtables and boxing here by allocating on demand.
8508
8509 2004-05-30  Martin Baulig  <martin@ximian.com>
8510
8511         * rootcontext.cs (RootContext.LookupType): Don't cache things if
8512         we're doing a silent lookup.  Don't try to lookup nested types in
8513         TypeManager.object_type (thanks to Ben Maurer).
8514
8515 2004-05-30  Martin Baulig  <martin@ximian.com>
8516
8517         Committing a patch from Ben Maurer.
8518
8519         * rootcontext.cs (RootContext.LookupType): Cache negative results.
8520
8521 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
8522
8523         * convert.cs: add a trivial cache for overload operator resolution.
8524
8525 2004-05-31  Marek Safar  <marek.safar@seznam.cz>
8526
8527         * attribute.cs
8528         (AttributeTester.GetObsoleteAttribute): Returns instance of
8529         ObsoleteAttribute when type is obsolete.
8530
8531         * class.cs
8532         (TypeContainer.VerifyObsoleteAttribute): Override.
8533         (Method.GetSignatureForError): New method for usage when MethodBuilder is null.
8534         (MethodCode.VerifyObsoleteAttribute): Override.
8535         (MemberBase.VerifyObsoleteAttribute): Override.
8536
8537         * decl.cs
8538         (MemberCore.CheckUsageOfObsoleteAttribute): Tests presence of ObsoleteAttribute
8539         and report proper error.
8540
8541         *delegate.cs
8542         (Delegate.VerifyObsoleteAttribute): Override.
8543
8544         * ecore.cs
8545         (Expression.CheckObsoleteAttribute): Tests presence of ObsoleteAttribute
8546         and report proper error.
8547         (FieldExpr.DoResolve): Added tests for ObsoleteAttribute.
8548
8549         * enum.cs
8550         (Enum.GetObsoleteAttribute): Returns ObsoleteAttribute for both enum type
8551         and enum member.
8552
8553         * expression.cs
8554         (Probe.DoResolve, Cast.DoResolve, LocalVariableReference.DoResolve,
8555         New.DoResolve, SizeOf.DoResolve, TypeOf.DoResolce, MemberAccess.DoResolve):
8556         Added test for ObsoleteAttribute.
8557
8558         * statement.cs
8559         (Catch): Derived from Statement.
8560
8561 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
8562
8563         * decl.cs: If possible, use lookuptypedirect here. We can only do
8564         this if there is no `.' after the namespace. Avoids using
8565         LookupType, which does lots of slow processing.
8566         (FindNestedType) New method, does what it says :-).
8567         * namespace.cs: use LookupTypeDirect.
8568         * rootcontext.cs: use membercache, if possible.
8569         * typemanager.cs (LookupTypeDirect): Cache negative hits too.
8570
8571 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
8572
8573         * expression.cs:
8574         According to the spec, 
8575
8576         In a member access of the form E.I, if E is a single identifier,
8577         and if the meaning of E as a simple-name (§7.5.2) is a constant,
8578         field, property, localvariable, or parameter with the same type as
8579         the meaning of E as a type-name (§3.8), then both possible
8580         meanings of E are permitted.
8581
8582         We did not check that E as a simple-name had the same type as E as
8583         a type name.
8584
8585         This trivial check gives us 5-7% on bootstrap time.
8586
8587 2004-05-30  Marek Safar  <marek.safar@seznam.cz>
8588
8589         Fixed bug #59071 & cs0160.cs
8590         * statement.cs (Try.Resolve): Check here whether order of catch
8591         clauses matches their dependencies.
8592
8593 2004-05-30  Marek Safar  <marek.safar@seznam.cz>
8594
8595         Fixed bug #58624
8596         * ecore.cs (SimpleName.SimpleNameResolve): Added test for
8597         unsafe type.
8598
8599 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
8600
8601         * expression.cs (Invocation.OverloadResolve): Avoid the
8602         use of hashtables and boxing here by allocating on demand.
8603
8604 2004-05-30  Martin Baulig  <martin@ximian.com>
8605
8606         * rootcontext.cs (RootContext.LookupType): Don't cache things if
8607         we're doing a silent lookup.  Don't try to lookup nested types in
8608         TypeManager.object_type (thanks to Ben Maurer).
8609
8610 2004-05-30  Martin Baulig  <martin@ximian.com>
8611
8612         Committing a patch from Ben Maurer.
8613
8614         * rootcontext.cs (RootContext.LookupType): Cache negative results.      
8615
8616 2004-05-29  Martin Baulig  <martin@ximian.com>
8617
8618         * class.cs (IMethodData.ShouldIgnore): New method.
8619
8620         * typemanager.cs (TypeManager.MethodFlags): Don't take a
8621         `Location' argument, we don't need it anywhere.  Use
8622         `IMethodData.ShouldIgnore ()' instead of
8623         `MethodData.GetMethodFlags ()'.
8624         (TypeManager.AddMethod): Removed.
8625         (TypeManager.AddMethod2): Renamed to AddMethod.
8626
8627 2004-05-29  Martin Baulig  <martin@ximian.com>
8628
8629         Committing a patch from Benjamin Jemlich <pcgod@gmx.net>.
8630
8631         * convert.cs (Convert.ImplicitReferenceConversion): If we're
8632         converting from a class type S to an interface type and we already
8633         have an object on the stack, don't box it again.  Fixes #52578.
8634
8635 2004-05-29  Martin Baulig  <martin@ximian.com>
8636
8637         * class.cs (ConstructorInitializer.GetOverloadedConstructor):
8638         Added support for `params' parameters.  Fixes #59267.
8639
8640 2004-05-29  Martin Baulig  <martin@ximian.com>
8641
8642         * literal.cs (NullPointer): Provide a private .ctor which sets
8643         `type' to TypeManager.object_type.  Fixes #59048.
8644
8645 2004-05-29  Martin Baulig  <martin@ximian.com>
8646
8647         * expression.cs (MemberAccess.ResolveMemberAccess): If we're an
8648         EventExpr, set `ee.InstanceExpression = left'.  Fixes #59188.
8649
8650         * ecore.cs (EventExpr.instance_expr): Make the field private.
8651
8652 2004-05-26  Marek Safar  <marek.safar@seznam.cz>
8653
8654         Fixed bug #50080 & cs0214-2.cs
8655         * expression.cs (Cast.DoResolve): Check unsafe context here.
8656         
8657         * statement.cs (Resolve.DoResolve): Likewise.
8658
8659 2004-05-26  Martin Baulig  <martin@ximian.com>
8660
8661         * namespace.cs (NamespaceEntry.Lookup): Added `bool silent'.
8662
8663         * rootcontext.cs (RootContext.NamespaceLookup): Added `bool silent'.
8664         (RootContext.LookupType): Pass down the `silent' flag.
8665
8666 2004-05-25  Martin Baulig  <martin@ximian.com>
8667
8668         * expression.cs
8669         (MethodGroupExpr.IdenticalTypeName): New public property.
8670         (Invocation.DoResolve): Don't report a CS0176 if the "instance"
8671         expression actually refers to a type.
8672
8673 2004-05-25  Martin Baulig  <martin@ximian.com>
8674
8675         * expression.cs (Invocation.DoResolve): Applied Ben Maurer's patch
8676         for #56176 and made it actually work.
8677
8678 2004-05-25  Martin Baulig  <martin@ximian.com>
8679
8680         * ecore.cs (Expression.CacheTemporaries): Make this virtual.
8681         (FieldExpr, PropertyExpr): Override and implement
8682         CacheTemporaries.  Fixes #52279.
8683
8684 2004-05-25  Miguel de Icaza  <miguel@ximian.com>
8685
8686         * location.cs: In the new compiler listing a file twice is a
8687         warning, not an error.
8688
8689 2004-05-24  Martin Baulig  <martin@ximian.com>
8690
8691         * enum.cs (Enum.DefineType): For the `BaseType' to be a
8692         TypeLookupExpression; otherwise, report a CS1008.  Fixes #58571.
8693
8694 2004-05-24  Martin Baulig  <martin@ximian.com>
8695
8696         * decl.cs (DeclSpace.FindType): Try doing an alias lookup before
8697         walking the `using' list.  Fixes #53921.
8698
8699 2004-05-24  Martin Baulig  <martin@ximian.com>
8700
8701         * const.cs (Const.LookupConstantValue): Added support for
8702         EmptyCast's; fixes #55251.
8703
8704 2004-05-24  Martin Baulig  <martin@ximian.com>
8705
8706         * ecore.cs (SimpleName.SimpleNameResolve): Renamed to
8707         DoSimpleNameResolve() and provide a SimpleNameResolve() wrapper
8708         which does the CS0135 check.  The reason is that we first need to
8709         check whether the variable actually exists.
8710
8711 2004-05-24  Martin Baulig  <martin@ximian.com>
8712
8713         * class.cs (MemberBase.DoDefine): Use DeclSpace.FindType() rather
8714         than RootContext.LookupType() to find the explicit interface
8715         type.  Fixes #58584.
8716
8717 2004-05-24  Raja R Harinath  <rharinath@novell.com>
8718
8719         * Makefile: Simplify.  Use executable.make.
8720         * mcs.exe.sources: New file.  List of sources of mcs.exe.
8721
8722 2004-05-24  Anders Carlsson  <andersca@gnome.org>
8723
8724         * decl.cs:
8725         * enum.cs:
8726         Use the invariant culture when doing String.Compare for CLS case
8727         sensitivity.
8728         
8729 2004-05-23  Martin Baulig  <martin@ximian.com>
8730
8731         * decl.cs (DeclSpace.FindType): Only check the `using' list if we
8732         don't have any dots.  Fixes #52622, added cs0246-8.cs.
8733
8734         * namespace.cs (NamespaceEntry.Lookup): Likewise.
8735
8736 2004-05-23  Marek Safar  <marek.safar@seznam.cz>
8737
8738         * class.cs (MemberBase.Define): Reuse MemberType member for 
8739         resolved type. Other methods can use it too.
8740
8741 2004-05-23  Martin Baulig  <martin@ximian.com>
8742
8743         * ecore.cs (SimpleName.SimpleNameResolve): Only report a CS0135 if
8744         the variable also exists in the current block (otherwise, we need
8745         to report a CS0103).  Fixes #58670.
8746
8747 2004-05-23  Martin Baulig  <martin@ximian.com>
8748
8749         * flowanalysis.cs (Reachability.Reachable): Compute this
8750         on-the-fly rather than storing it as a field.
8751
8752 2004-05-23  Martin Baulig  <martin@ximian.com>
8753
8754         * flowanalysis.cs (Reachability.And): Manually compute the
8755         resulting `barrier' from the reachability.      
8756        
8757 2004-05-23  Marek Safar  <marek.safar@seznam.cz>
8758
8759         Fix bug #57835
8760         * attribute.cs (AttributeTester.GetMethodObsoleteAttribute): Returns
8761         instance of ObsoleteAttribute when symbol is obsolete.
8762
8763         * class.cs
8764         (IMethodData): Extended interface for ObsoleteAttribute support.
8765
8766 2004-05-22  Marek Safar  <marek.safar@seznam.cz>
8767
8768         * attribute.cs: Fix bug #55970
8769
8770 2004-05-22  Marek Safar  <marek.safar@seznam.cz>
8771
8772         Fix bug #52705
8773         * attribute.cs
8774         (GetObsoleteAttribute): New method. Creates the instance of
8775         ObsoleteAttribute.
8776         (AttributeTester.GetMemberObsoleteAttribute): Returns instance of
8777         ObsoleteAttribute when member is obsolete.
8778         (AttributeTester.Report_ObsoleteMessage): Common method for
8779         Obsolete error/warning reporting.
8780
8781         * class.cs
8782         (TypeContainer.base_classs_type): New member for storing parent type.
8783
8784         * decl.cs
8785         (MemberCore.GetObsoleteAttribute): Returns instance of ObsoleteAttribute
8786         for this MemberCore.
8787
8788 2004-05-21  Marek Safar  <marek.safar@seznam.cz>
8789
8790         * attribute.cs, const.cs: Fix bug #58590
8791
8792 2004-05-21  Martin Baulig  <martin@ximian.com>
8793
8794         * flowanalysis.cs (FlowBranching.MergeTopBlock): Don't check for
8795         out parameters if the end of the method is unreachable.  Fixes
8796         #58098. 
8797
8798 2004-05-21  Marek Safar  <marek.safar@seznam.cz>
8799
8800         * codegen.cs, cs-parser.jay: Removed SetAttributes method.
8801         Hari was right, why extra method.
8802
8803 2004-05-21  Marek Safar  <marek.safar@seznam.cz>
8804
8805         * attribute.cs, cs-parser.jay: Fix errors/cs0579-7.cs.
8806
8807 2004-05-20  Martin Baulig  <martin@ximian.com>
8808
8809         * delegate.cs: Convert this file to Unix mode - like the original
8810         version in mcs is.
8811
8812 2004-05-20  Martin Baulig  <martin@ximian.com>
8813
8814         * attribute.cs: Convert this file to Unix mode - like the original
8815         version in mcs is.
8816
8817 2004-05-19  Marek Safar  <marek.safar@seznam.cz>
8818
8819        Fix bug #58688 (MCS does not report error when the same attribute
8820        is assigned twice)
8821
8822        * attribute.cs (Attribute.Emit): Distinction between null and default.
8823
8824 2004-05-19  Raja R Harinath  <rharinath@novell.com>
8825
8826        * cs-parser.jay (attribute): Create a GlobalAttribute for the case
8827        of a top-level attribute without an attribute target.
8828        * attribute.cs (Attribute.Error_AttributeConstructorMismatch): 
8829        Make non-static.
8830        (Attribute.Conditional_GetConditionName), 
8831        (Attribute.Obsolete_GetObsoleteMessage): Update.
8832        (Attribute.IndexerName_GetIndexerName): New.  Attribute-specific
8833        part of ScanForIndexerName.
8834        (Attribute.CanIgnoreInvalidAttribute): New function.
8835        (Attribute.ScanForIndexerName): Move to ...
8836        (Attributes.ScanForIndexerName): ... here.
8837        (Attributes.Attrs): Rename from now-misnamed AttributeSections.
8838        (Attributes.Search): New internal variant that can choose not to
8839        complain if types aren't resolved.  The original signature now
8840        complains.
8841        (Attributes.GetClsCompliantAttribute): Use internal variant, with
8842        complaints suppressed.
8843        (GlobalAttribute.CheckAttributeType): Overwrite ds.NamespaceEntry
8844        only if it not useful.
8845        (CanIgnoreInvalidAttribute): Ignore assembly attribute errors at
8846        top-level for attributes that are shared between the assembly
8847        and a top-level class.
8848        * parameter.cs (ImplicitParameter): Rename from ParameterAtribute.
8849        * class.cs: Update to reflect changes.
8850        (DefineIndexers): Fuse loops.
8851        * codegen.cs (GetAssemblyName): Update to reflect changes.  Accept
8852        a couple more variants of attribute names.
8853
8854 2004-05-18  Marek Safar  <marek.safar@seznam.cz>
8855
8856         Fix bug #52585 (Implemented explicit attribute declaration)
8857
8858         * attribute.cs:
8859         (Attributable.ValidAttributeTargets): New abstract method. It gets
8860         list of valid attribute targets for explicit target declaration.
8861         (Attribute.Target): It holds target itself.
8862         (AttributeSection): Removed.
8863         (Attribute.CheckTargets): New method. It checks whether attribute
8864         target is valid for the current element.
8865
8866         * class.cs:
8867         (EventProperty): New class. For events that are declared like
8868         property (with add and remove accessors).
8869         (EventField): New class. For events that are declared like field.
8870         class.cs
8871
8872         * cs-parser.jay: Implemented explicit attribute target declaration.
8873
8874         * class.cs, decl.cs, delegate.cs, enum.cs, parameter.cs:        
8875         Override ValidAttributeTargets.
8876
8877         * parameter.cs:
8878         (ReturnParameter): Class for applying custom attributes on 
8879         the return type.
8880         (ParameterAtribute): New class. Class for applying custom
8881         attributes on the parameter type.
8882
8883 2004-05-17  Miguel de Icaza  <miguel@ximian.com>
8884
8885         * class.cs (MemberBase.DoDefine): Pass UNSAFE on interface
8886         definitions. 
8887
8888         (Method): Allow UNSAFE here.
8889
8890         * modifiers.cs: Support unsafe reporting.
8891
8892 2004-05-17  Marek Safar  <marek.safar@seznam.cz>
8893
8894         * decl.cs: Fix bug #58478.
8895
8896 2004-05-17  Gonzalo Paniagua Javier <gonzalo@ximian.com>
8897
8898         * statement.cs: When checking for unreachable code on an EmptyStatement,
8899         set the location. Fixes bug #58488.
8900
8901 2004-05-13  Miguel de Icaza  <miguel@ximian.com>
8902
8903         * driver.cs: Add -pkg handling.
8904
8905         From Gonzalo: UseShelLExecute=false
8906
8907 2004-05-12  Marek Safar  <marek.safar@seznam.cz>
8908
8909         * attribute.cs:
8910         (Attribute.GetAttributeTargets): New method. Gets AttributeTargets
8911         for attribute.
8912         (Attribute.IsClsCompliaceRequired): Moved to base for better
8913         accesibility.
8914         (Attribute.UsageAttribute): New property for AttributeUsageAttribute
8915         when attribute is AttributeUsageAttribute.
8916         (Attribute.GetValidTargets): Simplified.
8917         (Attribute.GetAttributeUsage): New method returns AttributeUsage
8918         attribute for this type.
8919         (Attribute.ApplyAttributes): Method renamed to Emit and make
8920         non-static.
8921         (GlobalAttributeSection): New class for special handling of global
8922         attributes (assembly, module).
8923         (AttributeSection.Emit): New method.
8924
8925         * class.cs: Implemented Attributable abstract methods.
8926         (MethodCore.LabelParameters): Moved to Parameter class.
8927         (Accessor): Is back simple class.
8928         (PropertyMethod): Implemented Attributable abstract class.
8929         (DelegateMethod): Implemented Attributable abstract class.
8930         (Event): New constructor for disctintion between normal Event
8931         and Event with accessors.
8932
8933         * cs-parser.jay: Used new Event ctor and GlobalAttributeSection.
8934
8935         * codegen.cs, const.cs, decl.cs, delegate.cs:
8936         (CommonAssemblyModulClass): Implemented Attributable abstract class
8937         and simplified.
8938
8939         * enum.cs: Implement IAttributeSupport interface.
8940         (EnumMember): New class for emum members. Implemented Attributable
8941         abstract class
8942
8943         * parameter.cs:
8944         (ParameterBase): Is abstract.
8945         (ReturnParameter): New class for easier [return:] attribute handling.
8946
8947         * typemanager.cs: Removed builder_to_attr.
8948
8949 2004-05-11  Raja R Harinath  <rharinath@novell.com>
8950
8951         Fix bug #57151.
8952         * attribute.cs (Attribute.GetPositionalValue): New function.
8953         * class.cs (TypeContainer.VerifyMembers): New function.
8954         (TypeContainer.Emit): Use it.
8955         (ClassOrStruct): New base class for Class and Struct.
8956         (ClassOrStruct.ApplyAttributeBuilder): New function.  Note if 
8957         StructLayout(LayoutKind.Explicit) was ascribed to the struct or
8958         class.
8959         (ClassOrStruct.VerifyMembers): If the struct is explicitly laid out,
8960         then each non-static field should have a FieldOffset attribute.
8961         Otherwise, none of the fields should have a FieldOffset attribute.
8962         * rootcontext.cs (RootContext.ResolveCore): Resolve StructLayout 
8963         and FieldOffset attributes.
8964         * typemanager.cs (TypeManager.struct_layout_attribute_type)
8965         (TypeManager.field_offset_attribute_type): New core types.
8966         (TypeManager.InitCoreTypes): Initialize them.
8967
8968 2004-05-11  Michal Moskal  <malekith@pld-linux.org>
8969
8970         * class.cs (Event.RemoveDelegateMethod.DelegateMethodInfo):
8971         Return correct type.
8972         From bug #58270.
8973
8974 2004-05-09  Miguel de Icaza  <miguel@ximian.com>
8975
8976         * expression.cs (Binary.DoNumericPromotions): 0 long constant can
8977         be implicitly converted to ulong.
8978         
8979         * expression.cs: The logic for allowing operator &, | and ^ worked
8980         was wrong, it worked before because we did not report an error in
8981         an else branch.  Fixes 57895.
8982
8983         * class.cs: Applied patch from iain@mccoy.id.au Iain McCoy to
8984         allow volatile fields to be reference types.
8985
8986 2004-05-07  Miguel de Icaza  <miguel@ximian.com>
8987
8988         * driver.cs: Add support for /debug-
8989
8990 2004-05-07  Raja R Harinath  <rharinath@novell.com>
8991
8992         * attribute.cs (Attribute.CheckAttributeType, Attribute.ResolveType): 
8993         Add a 'complain' parameter to silence errors.
8994         (Attribute.Resolve): Update to changes.  Put in sanity check to catch
8995         silently overlooked type-resolutions.
8996         (Attribute.ScanForIndexerName, Attribute.DefinePInvokeMethod): Update
8997         to reflect changes.
8998         (Attributes.Search): New function.
8999         (Attributes.Contains, Attributes.GetClsCompliantAttribute): Use Search.
9000         (Attributes.GetAttributeFullName): Remove hack.
9001         * class.cs (MethodCore.LabelParameters, MethodData.ApplyAttributes): 
9002         Update to reflect changes.
9003         * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
9004         Use Attributes.Search instead of nested loops.
9005
9006 2004-05-07  Marek Safar  <marek.safar@seznam.cz>
9007
9008         * decl.cs:
9009         (MemberCore.Flags): Extended for caching presence of CLSCompliantAttribute.
9010         (MemberCore.VerifyClsCompliance): Implemented CS3019 error report.
9011         (DeclSpace.GetClsCompliantAttributeValue): Returns simple bool.
9012
9013         * report.cs: (Report.Warning): Renamed to Warning_T because of
9014         parameter collision.
9015
9016 2004-05-05  Raja R Harinath  <rharinath@novell.com>
9017
9018         * expression.cs (MemberAccess.ResolveMemberAccess):
9019         Exit with non-zero status after Report.Error.
9020         * rootcontext.cs (RootContext.BootstrapCorlib_ResolveDelegate):
9021         Likewise.
9022         * typemanager.cs (TypeManager.CoreLookupType): Likewise.
9023
9024 2004-05-04  Lluis Sanchez Gual  <lluis@ximian.com>
9025
9026         * support.cs: Don't hang when the file is empty.
9027
9028 2004-05-04  Lluis Sanchez Gual  <lluis@ximian.com>
9029
9030         * support.cs: In SeekableStreamReader, compute the preamble size of the
9031           underlying stream. Position changes should take into account that initial
9032           count of bytes.
9033
9034 2004-05-03  Todd Berman  <tberman@sevenl.net>
9035
9036         * driver.cs: remove unused GetSysVersion function.
9037
9038 2004-05-03  Todd Berman  <tberman@sevenl.net>
9039
9040         * driver.cs: Remove the hack from saturday, as well as the hack
9041         from jackson (LoadAssemblyFromGac), also adds the CWD to the
9042         link_paths to get that bit proper.
9043
9044 2004-05-01  Todd Berman  <tberman@sevenl.net>
9045
9046         * driver.cs: Try a LoadFrom before a Load, this checks the current
9047         path. This is currently a bug in mono that is be fixed, however, this
9048         provides a workaround for now. This will be removed when the bug
9049         is fixed.
9050
9051 2004-05-01  Sebastien Pouliot  <sebastien@ximian.com>
9052
9053         * CryptoConvert.cs: Updated to latest version. Fix issue with 
9054         incomplete key pairs (#57941).
9055
9056 2004-05-01  Todd Berman  <tberman@sevenl.net>
9057
9058         * driver.cs: Remove '.' from path_chars, now System.* loads properly
9059         from the GAC
9060
9061 2004-04-30  Jackson Harper  <jackson@ximian.com>
9062
9063         * codegen.cs: Open keys readonly.
9064         
9065 2004-04-30  Gonzalo Paniagua Javier <gonzalo@ximian.com>
9066
9067         * typemanager.cs: don't report cyclic struct layout when a struct
9068         contains 2 or more fields of the same type. Failed for Pango.AttrShape
9069         which has 2 Pango.Rectangle fields.
9070
9071 2004-04-29 Ben Maurer  <bmaurer@users.sourceforge.net>
9072
9073         * expression.cs: Handle IntPtr comparisons with IL code
9074         rather than a method call.
9075
9076 2004-04-29  Martin Baulig  <martin@ximian.com>
9077
9078         * ecore.cs (PropertyExpr.FindAccessor): New private method.  Walk
9079         the list of PropertyInfo's in class hierarchy and find the
9080         accessor.  Fixes #56013.
9081
9082 2004-04-29  Martin Baulig  <martin@ximian.com>
9083
9084         * typemanager.cs (TypeManager.CheckStructCycles): Fixed.
9085
9086 2004-04-29  Martin Baulig  <martin@ximian.com>
9087
9088         Applying a patch from Benjamin Jemlich <pcgod@gmx.net>.
9089
9090         * ecore.cs (FieldExpr.AddressOf): Make this work for valuetypes.
9091
9092 2004-04-29  Martin Baulig  <martin@ximian.com>
9093
9094         * class.cs (ConstructorInitializer.Resolve): Check whether the
9095         parent .ctor is accessible.  Fixes #52146.
9096
9097 2004-04-29  Martin Baulig  <martin@ximian.com>
9098
9099         Applying a patch from Benjamin Jemlich <pcgod@gmx.net>.
9100
9101         * statement.cs (Using.EmitLocalVariableDecls): Use
9102         TypeManager.idisposable_type, not typeof (IDisposable).
9103         (Foreach.EmitCollectionForeach): Added support for valuetypes.
9104
9105 2004-04-29  Martin Baulig  <martin@ximian.com>
9106
9107         * class.cs (Event.Define): Don't emit the field and don't set
9108         RTSpecialName and SpecialName for events on interfaces.  Fixes
9109         #57703. 
9110
9111 2004-04-29  Raja R Harinath  <rharinath@novell.com>
9112
9113         Refactor Attribute.ApplyAttributes.
9114         * attribute.cs (Attributable): New base class for objects that can
9115         have Attributes applied on them.
9116         (Attribute): Make AttributeUsage fields public.
9117         (Attribute.GetFieldValue, Attribute.GetMarshal): Make non-static.
9118         (Attribute.IsInternalCall): New property.
9119         (Attribute.UsageAttr): Convert to a public read-only property.
9120         (Attribute.CheckAttributeType): Use a DeclSpace, not an EmitContext.
9121         (Attribute.ResolveType, Attribute.Resolve)
9122         (Attribute.ScanForIndexerName): Update to reflect changes.
9123         (Attribute.CheckAttributeTarget): Re-format.
9124         (Attribute.ApplyAttributes): Refactor, to various
9125         Attributable.ApplyAttributeBuilder methods.
9126         * decl.cs (MemberCore): Make Attributable.
9127         * class.cs (Accessor): Make Attributable.
9128         (MethodData.ApplyAttributes): Use proper attribute types, not
9129         attribute names.
9130         (TypeContainer.LabelParameters): Pass Parameter to ApplyAttributes.
9131         (TypeContainer.ApplyAttributeBuilder)
9132         (Method.ApplyAttributeBuilder, Constructor.ApplyAttributeBuilder)
9133         (Field.ApplyAttributeBuilder, Accessor.ApplyAttributeBuilder)   
9134         (PropertyBase.ApplyAttributeBuilder, Event.ApplyAttributeBuilder)
9135         (Operator.ApplyAttributeBuilder): New factored-out methods.
9136         * const.cs (Const.ApplyAttributeBuilder): Likewise.
9137         * delegate.cs (Delegate.ApplyAttributeBuilder): Likewise.
9138         * enum.cs (Enum.ApplyAttributeBuilder): Likewise.
9139         * parameter.cs (ParameterBase): New Attributable base class
9140         that can also represent Return types.
9141         (Parameter): Update to the changes.
9142
9143 2004-04-29  Jackson Harper  <jackson@ximian.com>
9144
9145         * driver.cs: Prefer the corlib system version when looking for
9146         assemblies in the GAC. This is still a hack, but its a better hack
9147         now.
9148         
9149 2004-04-29  Marek Safar  <marek.safar@seznam.cz>
9150
9151         * decl.cs, enum.cs: Improved error 3005 reporting.
9152   
9153         * report.cs (SymbolRelatedToPreviousError): New method for error reporting.
9154         (related_symbols): New private member for list of symbols
9155         related to reported error/warning.
9156         
9157         * tree.cs: Do not use now obsolete Report.LocationOfPreviousError.
9158
9159 2004-04-29  Martin Baulig  <martin@ximian.com>
9160
9161         * ecore.cs (Expression.Constantify): If we're an enum and
9162         TypeManager.TypeToCoreType() doesn't give us another type, use
9163         t.UnderlyingSystemType.  Fixes #56178.  
9164
9165 2004-04-29  Martin Baulig  <martin@ximian.com>
9166
9167         * decl.cs (MemberCache.SetupCacheForInterface): Look over all our
9168         interfaces and for each interface, only add members directly
9169         declared in that interface.  Fixes #53255.
9170
9171 2004-04-28  Martin Baulig  <martin@ximian.com>
9172
9173         * expression.cs (ConditionalLogicalOperator): Use a temporary
9174         variable for `left' to avoid that we evaluate it more than once;
9175         bug #52588.
9176
9177 2004-04-28  Martin Baulig  <martin@ximian.com>
9178
9179         * expression.cs (ComposedCast.DoResolveAsTypeStep): Don't allow
9180         `void[]' (CS1547).
9181
9182 2004-04-28  Martin Baulig  <martin@ximian.com>
9183
9184         * statement.cs (LocalInfo.Resolve): Check whether the type is not
9185         void (CS1547).
9186
9187         * class.cs (MemberBase.CheckParameters, FieldBase.DoDefine): Check
9188         whether the type is not void (CS1547).
9189
9190 2004-04-28  Martin Baulig  <martin@ximian.com>
9191
9192         * expression.cs (Unary.DoResolveLValue): Override this and report
9193         CS0131 for anything but Operator.Indirection.
9194
9195 2004-04-28  Martin Baulig  <martin@ximian.com>
9196
9197         Committing a patch from Ben Maurer; see bug #50820.
9198
9199         * typemanager.cs (TypeManager.FilterWithClosure): Added CS1540
9200         check for classes.
9201
9202         * ecore.cs (Expression.MemberLookupFailed): Added CS1540 check for
9203         classes.        
9204
9205 2004-04-28  Martin Baulig  <martin@ximian.com>
9206
9207         Committing a patch from Ben Maurer; see bug #50820.
9208
9209         * typemanager.cs (TypeManager.FilterWithClosure): Added CS1540
9210         check for classes.
9211
9212         * ecore.cs (Expression.MemberLookupFailed): Added CS1540 check for
9213         classes.        
9214
9215 2004-04-28  Martin Baulig  <martin@ximian.com>
9216
9217         * statement.cs (Block.LookupLabel): Also lookup in implicit child blocks.
9218         (Block.AddLabel): Call DoLookupLabel() to only search in the
9219         current block.
9220
9221 2004-04-28  Martin Baulig  <martin@ximian.com>
9222
9223         * cfold.cs (ConstantFold.BinaryFold): Added special support for
9224         comparing StringConstants and NullLiterals in Equality and Inequality.
9225
9226 2004-04-28  Jackson Harper  <jackson@ximian.com>
9227
9228         * driver.cs: Attempt to load referenced assemblies from the
9229         GAC. This is the quick and dirty version of this method that
9230         doesnt take into account versions and just takes the first
9231         canidate found. Will be good enough for now as we will not have more
9232         then one version installed into the GAC until I update this method.
9233
9234 2004-04-28  Martin Baulig  <martin@ximian.com>
9235
9236         * typemanager.cs (TypeManager.CheckStructCycles): New public
9237         static method to check for cycles in the struct layout.
9238
9239         * rootcontext.cs (RootContext.PopulateTypes): Call
9240         TypeManager.CheckStructCycles() for each TypeContainer.
9241         [Note: We only need to visit each type once.]
9242
9243 2004-04-28  Martin Baulig  <martin@ximian.com>
9244
9245         * constant.cs (StringConstant.Emit): Emit Ldnull if we're null.
9246
9247         * const.cs (Const.LookupConstantValue): Return a `bool' signalling
9248         success and added `out object value'.  Use a `bool resolved' field
9249         to check whether we've already been called rather than
9250         `ConstantValue != null' since this breaks for NullLiterals.
9251
9252 2004-04-28  Raja R Harinath  <rharinath@novell.com>
9253
9254         * driver.cs (Driver.MainDriver) [IsModuleOnly]: Open code the
9255         setting of this flag, since the 'set' method may be non-public.
9256
9257 2004-04-28  Raja R Harinath  <rharinath@novell.com>
9258
9259         * flowanalysis.cs (FlowBranchingException.LookupLabel): Add a null
9260         check on current_vector.Block.
9261
9262 2004-04-27  Martin Baulig  <martin@ximian.com>
9263
9264         * expression.cs (BaseAccess.CommonResolve): Don't allow `base' in
9265         a field initializer.  Fixes #56459.
9266
9267 2004-04-27  Martin Baulig  <martin@ximian.com>
9268
9269         * ecore.cs (PropertyExpr.DoResolve/DoResolveLValue): Check whether
9270         we're not attempting to use an indexer.  Fixes #52154.
9271
9272 2004-04-27  Martin Baulig  <martin@ximian.com>
9273
9274         * statement.cs (Return): Don't create a return label if we don't
9275         need it; reverts my change from January 20th.  Thanks to Ben
9276         Maurer for this.
9277
9278 2004-04-27  Martin Baulig  <martin@ximian.com>
9279
9280         According to the spec, `goto' can only leave a nested scope, but
9281         never enter it.
9282
9283         * statement.cs (Block.LookupLabel): Only lookup in the current
9284         block, don't recurse into parent or child blocks.
9285         (Block.AddLabel): Check in parent and child blocks, report
9286         CS0140/CS0158 if we find a duplicate.
9287         (Block): Removed this indexer for label lookups.
9288         (Goto.Resolve): Call LookupLabel() on our current FlowBranching;
9289         this already does the error reporting for us.
9290
9291         * flowanalysis.cs
9292         (FlowBranching.UsageVector.Block): New public variable; may be null.
9293         (FlowBranching.CreateSibling): Added `Block' argument.
9294         (FlowBranching.LookupLabel): New public virtual method.  Lookup a
9295         label for the target of a `goto' and check whether we're not
9296         leaving a `finally'.
9297
9298 2004-04-27  Martin Baulig  <martin@ximian.com>
9299
9300         * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
9301         a finite loop block, also do the ALWAYS->SOMETIMES for throws (not
9302         just for returns).
9303
9304 2004-04-27  Martin Baulig  <martin@ximian.com>
9305
9306         * statement.cs (Block.AddLabel): Also check for implicit blocks
9307         and added a CS0158 check.
9308
9309 2004-04-27  Martin Baulig  <martin@ximian.com>
9310
9311         * flowanalysis.cs (FlowBranchingLoop): New class.
9312         (FlowBranching.UsageVector.MergeJumpOrigins): Take a list of
9313         UsageVector's instead of an ArrayList.
9314         (FlowBranching.Label): Likewise.
9315         (FlowBranching.UsageVector.MergeBreakOrigins): New method.
9316         (FlowBranching.AddBreakVector): New method.
9317
9318 2004-04-27  Miguel de Icaza  <miguel@ximian.com>
9319
9320         * attribute.cs: Small regression fix: only convert the type if we
9321         the type is different, fixes System.Drawing build.
9322
9323 2004-04-27  Martin Baulig  <martin@ximian.com>
9324
9325         * attribute.cs (Attribute.Resolve): If we have a constant value
9326         for a named field or property, implicity convert it to the correct
9327         type.
9328
9329 2004-04-27  Raja R Harinath  <rharinath@novell.com>
9330
9331         * statement.cs (Block.Block): Implicit blocks share
9332         'child_variable_names' fields with parent blocks.
9333         (Block.AddChildVariableNames): Remove.
9334         (Block.AddVariable): Mark variable as "used by a child block" in
9335         every surrounding block.
9336         * ecore.cs (SimpleName.SimpleNameResolve): If the name has already
9337         been used in a child block, complain about violation of "Invariant
9338         meaning in blocks" rule.
9339         * cs-parser.jay (declare_local_variables): Don't use
9340         AddChildVariableNames.
9341         (foreach_statement): Don't create an implicit block: 'foreach'
9342         introduces a scope.
9343
9344 2004-04-23  Miguel de Icaza  <miguel@ximian.com>
9345
9346         * convert.cs (ImplicitNumericConversion): 0 is also positive when
9347         converting from 0L to ulong.  Fixes 57522.
9348
9349 2004-04-22  Marek Safar  <marek.safar@seznam.cz>
9350
9351         * decl.cs (FindMemberToOverride): Fix wrong warning for case when
9352         derived class hides via 'new' keyword field from base class (test-242.cs).
9353         TODO: Handle this in the more general way.
9354         
9355         * class.cs (CheckBase): Ditto.
9356
9357 2004-04-22  Marek Safar  <marek.safar@seznam.cz>
9358
9359         * decl.cs (caching_flags): New member for storing cached values
9360         as bit flags.
9361         (MemberCore.Flags): New enum where bit flags for caching_flags
9362         are defined.
9363         (MemberCore.cls_compliance): Moved to caching_flags.
9364         (DeclSpace.Created): Moved to caching_flags.
9365
9366         * class.cs: Use caching_flags instead of DeclSpace.Created
9367         
9368 2004-04-21  Miguel de Icaza  <miguel@ximian.com>
9369
9370         * ecore.cs (PropertyExpr.GetAccesor): Only perform the 1540 check
9371         if we are only a derived class, not a nested class.
9372
9373         * typemanager.cs: Same as above, but do this at the MemberLookup
9374         level (used by field and methods, properties are handled in
9375         PropertyExpr).   Allow for the qualified access if we are a nested
9376         method. 
9377
9378 2004-04-21  Marek Safar  <marek.safar@seznam.cz>
9379
9380         * class.cs: Refactoring.
9381         (IMethodData): New inteface; Holds links to parent members
9382         to avoid member duplication (reduced memory allocation).
9383         (Method): Implemented IMethodData interface.
9384         (PropertyBase): New inner classes for get/set methods.
9385         (PropertyBase.PropertyMethod): Implemented IMethodData interface
9386         (Event): New inner classes for add/remove methods.
9387         (Event.DelegateMethod): Implemented IMethodData interface.
9388
9389         * cs-parser.jay: Pass DeclSpace to Event class for creation of valid
9390         EmitContext (related to class.cs refactoring).
9391
9392 2004-04-21  Raja R Harinath  <rharinath@novell.com>
9393
9394         * delegate.cs (Delegate.VerifyApplicability): If the number of
9395         arguments are the same as the number of parameters, first try to
9396         verify applicability ignoring  any 'params' modifier on the last
9397         parameter.
9398         Fixes #56442.
9399
9400 2004-04-08  Martin Baulig  <martin@ximian.com>
9401
9402         Merged latest changes into gmcs.  Please keep this comment in
9403         here, it makes it easier for me to see what changed in MCS since
9404         the last time I merged.
9405
9406 2004-04-16  Raja R Harinath  <rharinath@novell.com>
9407
9408         * class.cs (TypeContainer.AddIndexer): Use
9409         'ExplicitInterfaceName' to determine if interface name was
9410         explicitly specified.  'InterfaceType' is not initialized at this time.
9411         (TypeContainer.DefineIndexers): Remove use of temporary list.  The
9412         Indexers array is already in the required order.  Initialize
9413         'IndexerName' only if there are normal indexers.
9414         (TypeContainer.DoDefineMembers): Don't initialize IndexerName.
9415         (TypeContainer.Emit): Emit DefaultMember attribute only if
9416         IndexerName is initialized.
9417         Fixes #56300.
9418
9419 2004-04-15  Benjamin Jemlich  <pcgod@gmx.net>
9420
9421         * enum.cs (Enum.DefineType): Don't allow char as type for enum.
9422         Fixes #57007
9423
9424 2004-04-15  Raja R Harinath  <rharinath@novell.com>
9425
9426         * attribute.cs (Attribute.CheckAttributeType): Check for ambiguous
9427         attributes.
9428         Fix for #56456.
9429
9430         * attribute.cs (Attribute.Resolve): Check for duplicate named
9431         attributes.
9432         Fix for #56463.
9433
9434 2004-04-15  Miguel de Icaza  <miguel@ximian.com>
9435
9436         * iterators.cs (MarkYield): track whether we are in an exception,
9437         and generate code accordingly.  Use a temporary value to store the
9438         result for our state.
9439
9440         I had ignored a bit the interaction of try/catch with iterators
9441         since their behavior was not entirely obvious, but now it is
9442         possible to verify that our behavior is the same as MS .NET 2.0
9443
9444         Fixes 54814
9445
9446 2004-04-14  Miguel de Icaza  <miguel@ximian.com>
9447
9448         * iterators.cs: Avoid creating temporaries if there is no work to
9449         do. 
9450
9451         * expression.cs (ArrayAccess.EmitLoadOpcode): If dealing with
9452         Enumerations, use TypeManager.EnumToUnderlying and call
9453         recursively. 
9454
9455         Based on the patch from Benjamin Jemlich (pcgod@gmx.net), fixes
9456         bug #57013
9457
9458         (This.Emit): Use EmitContext.EmitThis to emit our
9459         instance variable.
9460
9461         (This.EmitAssign): Ditto.
9462
9463         * ecore.cs (FieldExpr.Emit): Remove RemapToProxy special
9464         codepaths, we will move all the functionality into
9465         Mono.CSharp.This 
9466
9467         (FieldExpr.EmitAssign): Ditto.
9468
9469         This fixes several hidden bugs that I uncovered while doing a code
9470         review of this today.
9471
9472         * codegen.cs (EmitThis): reworked so the semantics are more clear
9473         and also support value types "this" instances.
9474
9475         * iterators.cs: Changed so that for iterators in value types, we
9476         do not pass the value type as a parameter.  
9477
9478         Initialization of the enumerator helpers is now done in the caller
9479         instead of passing the parameters to the constructors and having
9480         the constructor set the fields.
9481
9482         The fields have now `assembly' visibility instead of private.
9483
9484 2004-04-11  Miguel de Icaza  <miguel@ximian.com>
9485
9486         * expression.cs (Argument.Resolve): Check if fields passed as ref
9487         or out are contained in a MarshalByRefObject.
9488
9489         * typemanager.cs, rootcontext.cs: Add System.Marshalbyrefobject as
9490         another compiler type.
9491
9492 2004-04-06 Ben Maurer  <bmaurer@users.sourceforge.net>
9493
9494         * class.cs (Indexer.Define): use the new name checking method.
9495         Also, return false on an error.
9496         * cs-tokenizer.cs (IsValidIdentifier): Checks for a valid identifier.
9497         (is_identifier_[start/part]_character): make static.
9498
9499 2004-04-10  Miguel de Icaza  <miguel@ximian.com>
9500
9501         * expression.cs (Binary.ResolveOperator): Do no append strings
9502         twice: since we can be invoked more than once (array evaluation)
9503         on the same concatenation, take care of this here.  Based on a fix
9504         from Ben (bug #56454)
9505
9506 2004-04-08  Sebastien Pouliot  <sebastien@ximian.com>
9507
9508         * codegen.cs: Fix another case where CS1548 must be reported (when 
9509         delay-sign isn't specified and no private is available #56564). Fix
9510         loading the ECMA "key" to delay-sign an assembly. Report a CS1548 
9511         error when MCS is used on the MS runtime and we need to delay-sign 
9512         (which seems unsupported by AssemblyBuilder - see #56621).
9513
9514 2004-04-08  Marek Safar  <marek.safar@seznam.cz>
9515
9516         * typemanager.cs (TypeManager.TypeToCoreType): Handle IntPtr too.
9517         (TypeManager.ComputeNamespaces): Faster implementation for
9518         Microsoft runtime.
9519
9520         * compiler.csproj: Updated AssemblyName to mcs.
9521
9522 2004-05-11  Jackson Harper  <jackson@ximian.com>
9523
9524         * Makefile: Preserve MONO_PATH
9525         
9526 2004-05-11  Jackson Harper  <jackson@ximian.com>
9527
9528         * Makefile: Use mono and mcs to build gmcs
9529         
9530 2004-05-03  Miguel de Icaza  <miguel@ximian.com>
9531
9532         * codegen.cs: Add patch from Robert Shade
9533         <rshade@dvsconsulting.com>, use FileAccess.Read on the keyfile, to
9534         sync with mcs.
9535
9536 2004-05-02  Sebastien Pouliot  <sebastien@ximian.com>
9537
9538         * CryptoConvert.cs: Updated to latest version. Fix issue with 
9539         incomplete key pairs (#57941).
9540
9541 2004-04-08  Sebastien Pouliot  <sebastien@ximian.com>
9542
9543         * codegen.cs: Fix another case where CS1548 must be reported (when 
9544         delay-sign isn't specified and no private is available #56564). Fix
9545         loading the ECMA "key" to delay-sign an assembly. Report a CS1548 
9546         error when MCS is used on the MS runtime and we need to delay-sign 
9547         (which seems unsupported by AssemblyBuilder - see #56621).
9548
9549 2004-04-29  Jackson Harper  <jackson@ximian.com>
9550
9551         * Makefile: Set MONO_PATH to use the bootstrap corlib
9552         * driver.cs: Check the GAC for referenced assemblies.
9553                 
9554 2004-04-29  Martin Baulig  <martin@ximian.com>
9555
9556         * Makefile (gmcs.exe): Set MONO_PATH to use `../class/lib/net_2_0'.
9557
9558 2004-04-07  Martin Baulig  <martin@ximian.com>
9559
9560         * expression.cs (Binary.ResolveOperator): Added special case for
9561         Equality/Inequality between a type parameter and a null literal.
9562
9563 2004-04-07  Martin Baulig  <martin@ximian.com>
9564
9565         * convert.cs: Check null literal -> type parameter conversions.
9566
9567 2004-04-07  Martin Baulig  <martin@ximian.com>
9568
9569         * generic.cs (ConstructedType.CheckConstraints): Enforce the
9570         `class' and `struct' constraints.
9571
9572 2004-04-07  Martin Baulig  <martin@ximian.com>
9573
9574         * generic.cs (SpecialConstraint): New public enum.
9575         (Constraints.Resolve): Added support for the `class' and `struct'
9576         constraints.
9577
9578         * cs-parser.jay (type_parameter_constraint): Added support for the
9579         `class' and `struct' constraints.
9580
9581 2004-04-07  Martin Baulig  <martin@ximian.com>
9582
9583         * support.cs (GenericConstraints): Replaced `Types' by
9584         `ClassConstraint' and `InterfaceConstraints'; added
9585         `HasClassConstraint'.   
9586
9587 2004-04-07  Martin Baulig  <martin@ximian.com>
9588
9589         * generic.cs
9590         (Constraints.InterfaceConstraints): New public property.
9591         (Constraints.Types): Make this property public
9592         (TypeParameter): Implement IMemberContainer.
9593         (TypeParameter.Define): Take a `GenericTypeParameterBuilder'
9594         instead of a TypeBuilder/MethodBuilder; pass the interface
9595         constraints to TypeManager.AddTypeParameter().
9596         (TypeParameter.DefineType): Just take an EmitContext and no
9597         TypeBuilder/MethodBuilder.  Use the new public API.
9598
9599         * typemanager.cs (TypeManager.AddTypeParameter): Added
9600         `TypeExpr[]' argument; add the interfaces to the
9601         `builder_to_ifaces' hash.
9602         (TypeManager.LookupMemberContainer): For
9603         GenericTypeParameterBuilders, get the TypeParameter from the
9604         `builder_to_type_param'.
9605         (TypeManager.FindMembers): For GenericTypeParameterBuilders, get
9606         the TypeParameter and call FindMembers on it.
9607
9608 2004-04-07  Martin Baulig  <martin@ximian.com>
9609
9610         * class.cs
9611         (MethodCore.GenericMethod): Moved this field here from Method.
9612         (MethodCore.IsDuplicateImplementation): Take the number of type
9613         parameters into account if we're a generic method.
9614
9615         * expression.cs (Invocation.InferTypeArguments): Don't return true
9616         if `arguments' is null; we still need to check whether we actually
9617         don't need to infer anything in this case.
9618         (MemberAccess): Merged the functionality from GenericMemberAccess
9619         into this class.
9620
9621         * generic.cs (GenericMemberAccess): Removed.
9622
9623 2004-04-05  Martin Baulig  <martin@ximian.com>
9624
9625         * decl.cs (MemberCore): For generic classes, interfaces and
9626         structs, `Name' now includes the number of type parameters
9627         ("Stack!1.Node!1").
9628         (DeclSpace.FindType): Removed the `num_type_args' argument; we now
9629         encode the number of type arguments in the type name.
9630
9631         * expression.cs (Expression.MemberLookup): Removed the
9632         `num_type_args' argument; we now encode the number of type
9633         arguments in the type name.
9634
9635         * ecore.cs (SimpleName): Encode the number of type arguments in
9636         the type name itself.
9637
9638         * generic.cs (ConstructedType): Likewise.
9639
9640         * tree.cs (Tree.RecordDecl): Take a `string' instead of a
9641         `MemberName'; we now include the number of type parameters in the
9642         type name.
9643
9644         * typemanager.cs (TypeManager.CheckGeneric): Removed.
9645         (TypeManager.MemberLookup): Removed the
9646         `num_type_args' argument; we now encode the number of type
9647         arguments in the type name.     
9648
9649 2004-04-03  Martin Baulig  <martin@ximian.com>
9650
9651         * decl.cs (MemberCore.ctor): Take a MemberName instead of a sting.
9652         (MemberCore.MemberName): Moved here from MemberBase.
9653         (DeclSpace.SetParameterInfo): Just take the constraints as an
9654         ArrayList; we already have the type parameters in our
9655         `MemberName'; also do the CS0080 reporting here.
9656
9657         * cs-parser.jay (struct_declaration): Use `member_name' instead of
9658         `IDENTIFIER opt_type_parameter_list'; when constructing our
9659         `MemberName', it'll already include our type parameters.
9660         (class_declaration, interface_declaration): Likewise.
9661         (delegate_declaration): Likewise.
9662         (MakeName): Take a MemberName and return a MemberName.
9663         The following two changes are required to avoid shift/reduce conflicts:
9664         (member_name): Don't include a TypeName anymore; ie. this is now
9665         just 'IDENTIFIER opt_type_parameter_list'.
9666         (property_declaration, event_declaration): Use a
9667         `namespace_or_type_name' instead of a `member_name'.            
9668
9669 2004-04-03  Martin Baulig  <martin@ximian.com>
9670
9671         * decl.cs (MemberName): Renamed to `TypeName' and created a new
9672         `MemberName' class.
9673         (TypeName): Formerly known as MemberName.
9674
9675         * namespace.cs (NamespaceEntry.UsingAlias): Take a `TypeName'
9676         instead of a `MemberName'.
9677
9678         * cs-parser.jay (namespace_or_type_name): Create a TypeName.
9679         (member_name): New rule; create a MemberName.
9680
9681 2004-04-02  Martin Baulig  <martin@ximian.com>
9682
9683         * namespace.cs (NamespaceEntry.VerifyUsing): Added error checking
9684         (CS0305 and CS0308).
9685
9686 2004-04-02  Martin Baulig  <martin@ximian.com>
9687
9688         * generic.cs (GenericMemberAccess.ResolveAsTypeStep): Added
9689         support for nested types.
9690
9691 2004-04-02  Martin Baulig  <martin@ximian.com>
9692
9693         * ecore.cs (IAlias): New public interface.
9694         (TypeExpr, TypeExpression): Implement IAlias.
9695         (TypeAliasExpression): New public class.
9696
9697         * namespace.cs (Namespace): Implement IAlias.
9698         (Namespace.Lookup): Return an IAlias instead on an object.
9699         (Namespace.DefineName): Take an IAlias instead of an object.
9700         (NamespaceEntry.AliasEntry.Resolve): Return an IAlias instead of
9701         an object.
9702         (NamespaceEntry.UsingAlias): Take a Membername instead of an
9703         Expression.
9704         (NamespaceEntry.LookupAlias): Return an IAlias instead on an
9705         object.
9706         (NamespaceEntry.Lookup): Likewise.
9707
9708         * rootcontext.cs (RootContext.LookupType): Return a TypeExpr
9709         instead of a Type.      
9710
9711         * decl.cs (DeclSpace): Implement IAlias.
9712         (DeclSpace.LookupAlias): Return an IAlias instead of a string.
9713
9714         * generic.cs (ConstructedType): Improved error checking.
9715
9716 2004-04-02  Martin Baulig  <martin@ximian.com>
9717
9718         * convert.cs: Added type parameter conversions.
9719
9720         * ecore.cs
9721         (UnboxCast.Emit): Emit an `unbox.any' for type params.
9722         (ClassCast.Emit): If the source type is a type parameter, box it.
9723         If the target type is a type parameter, emit an `unbox.any'
9724         instead of a `classcast'.1      
9725
9726 2004-04-01  Martin Baulig  <martin@ximian.com>
9727
9728         * cs-tokenizer.cs (parse_less_than): Allow Token.DOT.
9729
9730 2004-04-01  Martin Baulig  <martin@ximian.com>
9731
9732         * generic.cs (ConstructedType.CheckConstraints): Use
9733         Convert.ImplicitStandardConversionExists(); user-defined implicit
9734         conversions are not allowed according to the spec.
9735
9736 2004-03-30  Martin Baulig  <martin@ximian.com>
9737
9738         * expression.cs (New): Added support for type parameters.
9739
9740         * typemanager.cs
9741         (TypeManager.activator_type): New public static field.
9742         (TypeManager.activator_create_instance): Likewise.
9743
9744 2004-03-30  Martin Baulig  <martin@ximian.com>
9745
9746         * typemanager.cs (TypeManager.HasConstructorConstraint): New
9747         public method.
9748
9749 2004-03-30  Martin Baulig  <martin@ximian.com>
9750
9751         * generic.cs (ConstructedType.CheckConstraints): Actually follow
9752         the spec here: the argument type must be convertible to the
9753         constraints.
9754
9755 2004-03-30  Martin Baulig  <martin@ximian.com>
9756
9757         * generic.cs
9758         (TypeParameter.Define, TypeParameter.DefineMethod): Call
9759         TypeManager.AddTypeParameter().
9760         (ConstructedType.CheckConstraints): Re-enable this and actually
9761         check whether we have a constructor constraint.
9762
9763         * typemanager.cs
9764         (TypeManager.builder_to_type_param): New static field.
9765         (TypeManager.AddTypeParameter): New static method.
9766         (TypeManager.LookupTypeParameter): New public method.
9767
9768 2004-03-30  Martin Baulig  <martin@ximian.com>
9769
9770         * generic.cs (TypeParameter.DefineType): Return a boolean and use
9771         the new API to actually define the constructor constraint.
9772
9773         * typemanager.cs
9774         (TypeManager.new_constraint_attr_type): New static field.
9775         (TypeManager.InitCoreTypes): Initialize it.
9776
9777 2004-03-30  Martin Baulig  <martin@ximian.com>
9778
9779         * generic.cs (Constraints): Completed error checking, use correct
9780         error numbers.
9781
9782 2004-03-29  Martin Baulig  <martin@ximian.com>
9783
9784         * delegate.cs (Delegate.VerifyMethod): Infer type arguments.
9785
9786         * expression.cs (Invocation.InferTypeArguments): Added overloaded
9787         public version which takes a `ParameterData pd' instead of an
9788         `ArrayList args'.
9789
9790 2004-03-29  Martin Baulig  <martin@ximian.com>
9791
9792         * typemanager.cs (TypeManager.IsGenericMethod): Take a MethodBase,
9793         not a MethodInfo.       
9794
9795 2004-03-29  Martin Baulig  <martin@ximian.com>
9796
9797         * expression.cs (Argument.ResolveMethodGroup): If we're a
9798         ConstructedType, call GetMemberAccess() on it.  
9799
9800 2004-03-29  Martin Baulig  <martin@ximian.com>
9801
9802         * class.cs (MethodBase.CheckGenericOverride): New abstract method.
9803         (MethodCore.CheckGenericOverride): When overriding a generic
9804         method, check whether the constraints match.
9805
9806         * support.cs (GenericConstraints): New public interface.
9807         (ParameterData.GenericConstraints): New public method.
9808
9809         * parameter.cs (Parameter.Resolve): Check whether we're a generic
9810         method parameter and compute our constraints if appropriate.
9811         (Parameter.GenericConstraints): New public property.
9812
9813         * generic.cs (Constraints): Implement GenericConstraints.
9814
9815 2004-03-29  Martin Baulig  <martin@ximian.com>
9816
9817         * decl.cs (MemberCache.FindMemberToOverride): Use
9818         `paramTypes [j].Equals (cmpAttrs [j])' instead of `=='.
9819
9820 2004-03-29  Martin Baulig  <martin@ximian.com>
9821
9822         * generic.cs (GenericMethod.Define): Resolve our type parameters.
9823
9824 2004-03-29  Martin Baulig  <martin@ximian.com>
9825
9826         * cs-parser.jay: Report CS0080 instead of -200 ("Constraints are
9827         not allowed on non-generic declarations").
9828
9829 2004-03-29  Martin Baulig  <martin@ximian.com>
9830
9831         * expression.cs (Invocation.InferTypeArguments): Added overloaded
9832         public version of this method.
9833
9834         * class.cs (MethodCore.IsDuplicateImplementation): Use
9835         Invocation.InferTypeArguments() to check this.
9836
9837 2004-03-29  Martin Baulig  <martin@ximian.com>
9838
9839         * convert.cs: Use TypeManager.IsDelegateType() instead of
9840         comparing types correctly.
9841
9842 2004-03-29  Martin Baulig  <martin@ximian.com>
9843
9844         * convert.cs: Use TypeManager.IsSubclassOf() instead of comparing
9845         types directly to make it work for generic instances.
9846
9847         * typemanager.cs (TypeManager.IsSubclassOf): New static method.
9848
9849 2004-03-29  Martin Baulig  <martin@ximian.com>
9850
9851         * typemanager.cs (TypeManager.MayBecomeEqualGenericTypes): Added
9852         support for arrays.     
9853
9854 2004-03-24  Martin Baulig  <martin@ximian.com>
9855
9856         * decl.cs (DeclSpace.FindType): Also use
9857         TypeManager.CheckGeneric() for types from the using clauses.
9858
9859 2004-03-23  Martin Baulig  <martin@ximian.com>
9860
9861         * expression.cs (Invocation.OverloadResolve): Added `bool
9862         may_fail' argument and use it instead of the Location.IsNull() hack.
9863
9864 2004-03-23  Martin Baulig  <martin@ximian.com>
9865
9866         * expression.cs (Invocation.InferType): Use correct type inference
9867         rules here.     
9868
9869 2004-03-23  Martin Baulig  <martin@ximian.com>
9870
9871         * ecore.cs (MethodGroupExpr.Name): Use
9872         TypeManager.CSharpSignature() instead of just the name.
9873
9874         * expression.cs (Invocation.OverloadResolve): Provide better error
9875         reporting.
9876         (Invocation.DoResolve): OverloadResolve() never returns null
9877         without reporting an error, so removed the error -6 reporting here.
9878
9879 2004-03-23  Martin Baulig  <martin@ximian.com>
9880
9881         * typemanager.cs (TypeManager.GetMethodFlags): Fixed the FIXME for
9882         generic methods.
9883
9884         * cs-parser.jay (delegate_declaration): Support generic delegates.
9885
9886         * delegate.cs: Support generic delegates.
9887
9888 2004-03-22  Martin Baulig  <martin@ximian.com>
9889
9890         * expression.cs (Invocation.InferParamsTypeArguments): New static
9891         method; does type inference for params arguments.
9892
9893 2004-03-21  Martin Baulig  <martin@ximian.com>
9894
9895         * typemanager.cs (TypeManager.IsGenericMethod): New public static
9896         method; checks whether a method is a generic method.    
9897
9898         * expression.cs (Invocation.InferTypeArguments): New static method;
9899         infer type arguments for generic method invocation.
9900
9901         * ecore.cs (MethodGroupExpr.HasTypeArguments): New public
9902         property; we set this to true if we're resolving a generic method
9903         invocation and the user specified type arguments, ie. we're not
9904         doing type inference.
9905
9906 2004-03-20  Martin Baulig  <martin@ximian.com>
9907
9908         * class.cs (MethodData.DeclaringType): New public property.
9909         (MethodData.Define): Set DeclaringType here.
9910         (Operator.Define): Use OperatorMethod.MethodData.DeclaringType
9911         instead of OperatorMethodBuilder.DeclaringType.
9912
9913 2004-03-20  Martin Baulig  <martin@ximian.com>
9914
9915         * cs-tokenizer.cs (xtoken): Return a special
9916         Token.DEFAULT_OPEN_PARENS for "`default' followed by open parens".
9917
9918         * cs-parser.jay (default_value_expression): Switch to the new
9919         syntax (14.5.13).
9920
9921 2004-03-19  Martin Baulig  <martin@ximian.com>
9922
9923         * decl.cs (MemberName): New class.  We use this to "construct"
9924         namespace_or_type_name's.
9925
9926         * generics.cs (TypeArguments.GetDeclarations): New public method;
9927         returns the type arguments as a string[] and reports a CS0081 if
9928         one of them is not an identifier.
9929
9930         * class.cs (MemberBase): The .ctor now takes the name as a
9931         MemberName instead of a string.
9932         (MemberBase.ExplicitInterfaceName): Changed type from string to
9933         Expression.
9934         (MemberBase.DoDefine): If we're an explicit implementation, the
9935         InterfaceType may be a generic instance.
9936
9937         * cs-parser.jay (namespace_or_type_name): Return a MemberName.
9938         (namespace_name): Call MemberName.GetName () to transform the
9939         MemberName into a string and ensure we don't have any type
9940         arguments.
9941         (type_name): Call MemberName.GetTypeExpression() to transfrom the
9942         MemberName into an expression.
9943         (method_header): Use namespace_or_type_name instead of member_name.     
9944
9945 2004-04-07  Miguel de Icaza  <miguel@ximian.com>
9946
9947         * rootcontext.cs: Add new types to the boot resolution.
9948
9949         * ecore.cs (TypeExpr.CanInheritFrom): Inheriting from
9950         MulticastDelegate is not allowed.
9951
9952         * typemanager.cs: Add new types to lookup: System.TypedReference
9953         and ArgIterator.
9954
9955         * paramter.cs (Parameter.Resolve): if we are an out/ref parameter,
9956         check for TypedReference or ArgIterator, they are not allowed. 
9957
9958         * ecore.cs (BoxedCast): Set the eclass to ExprClass.Value, this
9959         makes us properly catch 1510 in some conditions (see bug 56016 for
9960         details). 
9961
9962 2004-04-06  Bernie Solomon  <bernard@ugsolutions.com>
9963
9964         * CryptoConvert.cs: update from corlib version
9965         with endian fixes.
9966
9967 2004-04-05  Miguel de Icaza  <miguel@ximian.com>
9968
9969         * class.cs (Indexer.Define): Check indexername declaration
9970
9971 2004-04-05  Marek Safar  <marek.safar@seznam.cz>
9972
9973         * attribute.cs (IsClsCompliant): Fixed problem with handling
9974         all three states (compliant, not-compliant, undetected).
9975
9976 2004-03-30  Marek Safar  <marek.safar@seznam.cz>
9977
9978         * attribute.cs (Attribute): Location is now public.
9979         (Resolve): Store resolved arguments (pos_values) in attribute class.
9980         Attribute extractors (now GetClsCompliantAttributeValue) can reuse them.
9981         (GetClsCompliantAttributeValue): New method that gets
9982         CLSCompliantAttribute value.
9983         (GetClsCompliantAttribute): Returns CLSCompliantAttribute for DeclSpace
9984         if exists else null.
9985         (AttributeTester): New class for CLS-Compliant verification routines.
9986
9987         * class.cs (Emit): Add CLS-Compliant verification.
9988         (Method.GetSignatureForError): Implemented.
9989         (Constructor.GetSignatureForError): Implemented
9990         (Constructor.HasCompliantArgs): Returns if constructor has
9991         CLS-Compliant arguments.
9992         (Constructor.Emit): Override.
9993         (Construcor.IsIdentifierClsCompliant): New method; For constructors
9994         is needed to test only parameters.
9995         (FieldBase.GetSignatureForError): Implemented.
9996         (TypeContainer): New member for storing base interfaces.
9997         (TypeContainer.FindMembers): Search in base interfaces too.
9998
9999         * codegen.cs (GetClsComplianceAttribute): New method that gets
10000         assembly or module CLSCompliantAttribute value.
10001         (ResolveClsCompliance): New method that resolve CLSCompliantAttribute
10002         for assembly.
10003         (ModuleClass.Emit): Add error 3012 test.
10004
10005         * const.cs (Emit): Override and call base for CLS-Compliant tests.
10006
10007         * decl.cs (ClsComplianceValue): New enum that holds CLS-Compliant
10008         state for all decl types.
10009         (MemberCore.Emit): Emit is now virtual and call VerifyClsCompliance
10010         if CLS-Compliant tests are required.
10011         (IsClsCompliaceRequired): New method. Analyze whether code
10012         must be CLS-Compliant.
10013         (IsExposedFromAssembly): New method. Returns true when MemberCore
10014         is exposed from assembly.
10015         (GetClsCompliantAttributeValue): New method. Resolve CLSCompliantAttribute
10016         value or gets cached value.
10017         (HasClsCompliantAttribute): New method. Returns true if MemberCore
10018         is explicitly marked with CLSCompliantAttribute.
10019         (IsIdentifierClsCompliant): New abstract method. This method is
10020         used to testing error 3005.
10021         (IsIdentifierAndParamClsCompliant): New method. Common helper method
10022         for identifier and parameters CLS-Compliant testing.
10023         (VerifyClsCompliance): New method. The main virtual method for
10024         CLS-Compliant verifications.
10025         (CheckAccessLevel): In one special case (System.Drawing) was TypeBuilder
10026         null. I don't know why is null (too many public members !).
10027         (GetClsCompliantAttributeValue). New method. Goes through class hierarchy
10028         and get value of first CLSCompliantAttribute that found.
10029
10030         * delegate.cs (Emit): Override and call base for CLS-Compliant tests.
10031         (VerifyClsCompliance): Override and add extra tests.
10032
10033         * driver.cs (CSCParseOption): New command line options (clscheck[+|-]).
10034         clscheck- disable CLS-Compliant verification event if assembly is has
10035         CLSCompliantAttribute(true).
10036
10037         * enum.cs (Emit): Override and call base for CLS-Compliant tests.
10038         ApllyAttribute is now called in emit section as in the other cases.
10039         Possible future Emit integration.
10040         (IsIdentifierClsCompliant): New override.
10041         (VerifyClsCompliance): New override.
10042         (GetEnumeratorName): Returns full enum name.
10043
10044         * parameter.cs (GetSignatureForError): Implemented.
10045
10046         * report.cs (WarningData): New struct for Warning message information.
10047         (LocationOfPreviousError): New method.
10048         (Warning): New method. Reports warning based on the warning table.
10049         (Error_T): New method. Reports error based on the error table.
10050
10051         * rootcontext.cs (EmitCode): Added new Emit(s) because CLS-Compliant
10052         verifications are done here.
10053
10054         * tree.cs (RecordDecl): Used new LocationOfPreviousError method.
10055
10056         * typemanager.cs (cls_compliant_attribute_type): New member thath holds
10057         CLSCompliantAttribute.
10058         (all_imported_types): New member holds all imported types from other
10059         assemblies.
10060         (LoadAllImportedTypes): New method fills static table with exported types
10061         from all referenced assemblies.
10062         (Modules): New property returns all assembly modules.
10063
10064 2004-03-30  Miguel de Icaza  <miguel@ximian.com>
10065
10066         * cs-parser.jay: Add a rule to catch wrong event syntax instead of
10067         throwing a parser error.
10068
10069         * ecore.cs (PropertyExpr.GetAccessor): Apply patch from Patrik Reali
10070         which removes the hardcoded get_/set_ prefixes for properties, as
10071         IL allows for the properties to be named something else.  
10072
10073         Bug #56013
10074
10075         * expression.cs: Do not override operand before we know if it is
10076         non-null.  Fix 56207
10077
10078 2004-03-29 Ben Maurer  <bmaurer@users.sourceforge.net>
10079
10080         * typemanager.cs: support for pinned variables.
10081
10082 2004-03-29 Ben Maurer  <bmaurer@users.sourceforge.net>
10083
10084         * decl.cs, typemanager.cs: Avoid using an arraylist
10085         as a buffer if there is only one result set.
10086
10087 2004-03-29 Ben Maurer  <bmaurer@users.sourceforge.net>
10088
10089         * expression.cs: Make sure you cant call a static method
10090         with an instance expression, bug #56174.
10091
10092 2004-03-29  Miguel de Icaza  <miguel@ximian.com>
10093
10094         * class.cs (IsDuplicateImplementation): Improve error reporting to
10095         flag 663 (method only differs in parameter modifier).
10096
10097         * cs-tokenizer.cs: Do not require whitespace when a ( or " will do
10098         in preprocessor directives.
10099
10100         * location.cs (LookupFile): Allow for the empty path.
10101
10102         * attribute.cs (DefinePInvokeMethod): Fix 56148;  I would like a
10103         better approach for some of that patch, but its failing with the
10104         CharSet enumeration.  For now try/catch will do.
10105
10106         * typemanager.cs: Do not crash if a struct does not have fields.
10107         Fixes 56150.
10108
10109 2004-03-28 Ben Maurer  <bmaurer@users.sourceforge.net>
10110
10111         * expression.cs: cs0213, cant fix a fixed expression.
10112         fixes 50231.
10113
10114 2004-03-28 Ben Maurer  <bmaurer@users.sourceforge.net>
10115
10116         * cs-parser.jay: detect invalid embeded statements gracefully.
10117         bug #51113.
10118
10119 2004-03-28 Ben Maurer  <bmaurer@users.sourceforge.net>
10120
10121         * ecore.cs, typemanager.cs: Correct impl of cs1540 check.
10122         As a regex:
10123         s/
10124         the invocation type may not be a subclass of the tye of the item/
10125         The type of the item must be a subclass of the invocation item.
10126         /g
10127
10128         Fixes bug #50820.
10129
10130 2004-03-25  Sebastien Pouliot  <sebastien@ximian.com>
10131
10132         * attribute.cs: Added methods to get a string and a bool from an
10133         attribute. Required to information from AssemblyKeyFileAttribute,
10134         AttributeKeyNameAttribute (string) and AssemblyDelaySign (bool).
10135         * codegen.cs: Modified AssemblyName creation to include support for
10136         strongnames. Catch additional exceptions to report them as CS1548.
10137         * compiler.csproj: Updated include CryptoConvert.cs.
10138         * compiler.csproj.user: Removed file - user specific configuration.
10139         * CryptoConvert.cs: New. A COPY of the class CryptoConvert from 
10140         Mono.Security assembly. The original class is maintained and tested in
10141         /mcs/class/Mono.Security/Mono.Security.Cryptography/CryptoConvert.cs.
10142         * drivers.cs: Added support for /keyfile, /keycontainer and /delaysign
10143         like CSC 8.0 (C# v2) supports.
10144         * Makefile: Added CryptoConvert.cs to mcs sources.
10145         * rootcontext.cs: Added new options for strongnames.
10146
10147 2004-03-24 Ben Maurer  <bmaurer@users.sourceforge.net>
10148
10149         * driver.cs: For --expect-error, report error code `2'
10150         if the program compiled with no errors, error code `1' if
10151         it compiled with an error other than the one expected.
10152
10153 2004-03-24  Sebastien Pouliot  <sebastien@ximian.com>
10154
10155         * compiler.csproj: Updated for Visual Studio .NET 2003.
10156         * compiler.csproj.user: Updated for Visual Studio .NET 2003.
10157         * compiler.sln: Updated for Visual Studio .NET 2003.
10158
10159 2004-03-24  Ravi Pratap M  <ravi@ximian.com>
10160
10161         * expression.cs: Fix bug #47234. We basically need to apply the
10162         rule that we prefer the conversion of null to a reference type
10163         when faced with a conversion to 'object' (csc behaviour).
10164
10165 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
10166
10167         * statement.cs: Shorter form for foreach, eliminates
10168         a local variable. r=Martin.
10169
10170 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
10171
10172         * constant.cs, ecore.cs, literal.cs: New prop IsZeroInteger that
10173         checks if we can use brtrue/brfalse to test for 0.
10174         * expression.cs: use the above in the test for using brtrue/brfalse.
10175         cleanup code a bit.
10176
10177 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
10178
10179         * expression.cs: Rewrite string concat stuff. Benefits:
10180
10181         - "a" + foo + "b" + "c" becomes "a" + foo + "bc"
10182         - "a" + foo + "b" + bar + "c" + baz ... uses concat (string []).
10183         rather than a concat chain.
10184
10185         * typemanager.cs: Add lookups for more concat overloads.
10186
10187 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
10188
10189         * expression.cs: Emit shorter il code for array init.
10190
10191         newarr
10192         dup
10193         // set 1
10194
10195         // set 2
10196
10197         newarr
10198         stloc.x
10199
10200         ldloc.x
10201         // set 1
10202
10203         ldloc.x
10204         // set 2
10205
10206 2004-03-22 Ben Maurer  <bmaurer@users.sourceforge.net>
10207
10208         * statement.cs: Before, two switch blocks would be merged if the
10209         total size of the blocks (end_item - begin_item + 1) was less than
10210         two times the combined sizes of the blocks.
10211
10212         Now, it will only merge if after the merge at least half of the
10213         slots are filled.
10214
10215         fixes 55885.
10216
10217 2004-03-20  Atsushi Enomoto  <atsushi@ximian.com>
10218
10219         * class.cs : csc build fix for GetMethods(). See bug #52503.
10220
10221 2004-03-20 Ben Maurer  <bmaurer@users.sourceforge.net>
10222
10223         * expression.cs: Make sure fp comparisons work with NaN.
10224         This fixes bug #54303. Mig approved this patch a long
10225         time ago, but we were not able to test b/c the runtime
10226         had a related bug.
10227
10228 2004-03-19  Miguel de Icaza  <miguel@ximian.com>
10229
10230         * ecore.cs (TypExpr.GetHashCode): implement this overload. 
10231
10232 2004-03-19  Martin Baulig  <martin@ximian.com>
10233
10234         * class.cs (MemberCore.IsDuplicateImplementation): Check whether
10235         two overloads may unify for some type parameter substitutions and
10236         report a CS0408 if appropriate.
10237
10238 2004-03-19  Martin Baulig  <martin@ximian.com>
10239
10240         * class.cs (MemberCore.IsDuplicateImplementation): Report the
10241         error here and not in our caller.
10242
10243 2004-03-19  Martin Baulig  <martin@ximian.com>
10244
10245         * interface.cs: Completely killed this file.
10246         (Interface): We're now a TypeContainer and live in class.cs.
10247
10248         * class.cs (TypeContainer.GetClassBases): Added `bool is_iface'
10249         argument; we're now also called for interfaces.
10250         (TypeContainer.DefineMembers): Allow this method being called
10251         multiple times.
10252         (TypeContainer.GetMethods): New public method; formerly known as
10253         Interface.GetMethod().  This is used by PendingImplementation.
10254         (TypeContainer.EmitDefaultMemberAttr): Moved here from Interface;
10255         it's now private and non-static.
10256         (Interface): Moved this here; it's now implemented similar to
10257         Class and Struct.
10258         (Method, Property, Event, Indexer): Added `bool is_interface'
10259         argument to their .ctor's.
10260         (MemberBase.IsInterface): New public field.
10261
10262         * cs-parser.jay: Create normal Method, Property, Event, Indexer
10263         instances instead of InterfaceMethod, InterfaceProperty, etc.
10264         (opt_interface_base): Removed; we now use `opt_class_base' instead.
10265         (InterfaceAccessorInfo): Create `Get' and `Set' Accessor's.
10266
10267 2004-03-19  Martin Baulig  <martin@ximian.com>
10268
10269         * class.cs (MethodCore.IsDuplicateImplementation): New private
10270         method which does the CS0111 checking.
10271         (Method.CheckBase, Constructor.CheckBase, PropertyBase.CheckBase):
10272         Use IsDuplicateImplementation().
10273
10274 2004-03-17 Ben Maurer  <bmaurer@users.sourceforge.net>
10275
10276         * decl.cs (FindMemberToOverride): New method to find the correct
10277         method or property to override in the base class.
10278         * class.cs
10279             - Make Method/Property use the above method to find the
10280               version in the base class.
10281             - Remove the InheritableMemberSignatureCompare as it is now
10282               dead code.
10283
10284         This patch makes large code bases much faster to compile, as it is
10285         O(n) rather than O(n^2) to do this validation.
10286
10287         Also, it fixes bug 52458 which is that nested classes are not
10288         taken into account when finding the base class member.
10289
10290         Reviewed/Approved by Martin.
10291
10292 2004-03-17  Martin Baulig  <martin@ximian.com>
10293
10294         * expression.cs (MemberAccess.DoResolve): Take the parent's number
10295         of type arguments into account; use the `real_num_type_args'
10296         approach like in DoResolveAsTypeStep().
10297
10298         * generic.cs (GenericMemberAccess.DoResolve): Make this work for
10299         nested types.
10300
10301 2004-03-17  Marek Safar  <marek.safar@seznam.cz>
10302
10303         * interface.cs: In all interface classes removed redundant
10304         member initialization.
10305
10306 2004-03-16  Martin Baulig  <martin@ximian.com>
10307
10308         * class.cs (TypeContainer.GetClassBases): Fix the CS0528 check.
10309
10310 2004-03-15  Miguel de Icaza  <miguel@ximian.com>
10311
10312         * decl.cs (DefineTypeAndParents): New helper method to define a
10313         type's containers before the type itself is defined;  This is a
10314         bug exposed by the recent changes to Windows.Forms when an
10315         implemented interface was defined inside a class that had not been
10316         built yet.   
10317
10318         * modifiers.cs (MethodAttr): All methods in C# are HideBySig.
10319
10320         (Check): Loop correctly to report errors modifiers
10321         (UNSAFE was not in the loop, since it was the same as TOP).
10322
10323         * interface.cs: Every interface member now takes a ModFlags,
10324         instead of a "is_new" bool, which we set on the base MemberCore. 
10325
10326         Every place where we called "UnsafeOk" in the interface, now we
10327         call the proper member (InterfaceMethod.UnsafeOK) instead to get
10328         the unsafe settings from the member declaration instead of the
10329         container interface. 
10330
10331         * cs-parser.jay (opt_new): Allow unsafe here per the spec. 
10332
10333         * pending.cs (TypeAndMethods): Add `get_indexer_name' and
10334         `set_indexer_name' to the pending bits (one per type).
10335
10336         We fixed a bug today that was picking the wrong method to
10337         override, since for properties the existing InterfaceMethod code
10338         basically ignored the method name.  Now we make sure that the
10339         method name is one of the valid indexer names.
10340
10341 2004-03-14  Gustavo Giráldez  <gustavo.giraldez@gmx.net>
10342  
10343         * support.cs (SeekableStreamReader): Keep track of stream byte
10344         positions and don't mix them with character offsets to the buffer.
10345
10346         Patch from Gustavo Giráldez
10347
10348 2004-03-15  Marek Safar  <marek.safar@seznam.cz>
10349
10350         * interface.cs (InterfaceSetGetBase): Removed double member
10351         initialization, base class does it as well.
10352
10353 2004-03-13  Martin Baulig  <martin@ximian.com>
10354
10355         * class.cs: Reverted Miguel's latest commit; it makes mcs crash
10356         when compiling corlib.
10357
10358 2004-03-13  Miguel de Icaza  <miguel@ximian.com>
10359
10360         * convert.cs (ExplicitConversion): We were reporting an error on
10361         certain conversions (object_type source to a value type, when the
10362         expression was `null') before we had a chance to pass it through
10363         the user defined conversions.
10364
10365         * driver.cs: Replace / and \ in resource specifications to dots.
10366         Fixes 50752
10367
10368         * class.cs: Add check for duplicate operators.  Fixes 52477
10369
10370 2004-03-11  Miguel de Icaza  <miguel@ximian.com>
10371
10372         * statement.cs (Switch.SimpleSwitchEmit): Deal with default labels
10373         that are in the middle of the statements, not only at the end.
10374         Fixes #54987
10375
10376         * class.cs (TypeContainer.AddField): No longer set the
10377         `HaveStaticConstructor' flag, now we call it
10378         `UserDefineStaticConstructor' to diferentiate the slightly
10379         semantic difference.
10380
10381         The situation is that we were not adding BeforeFieldInit (from
10382         Modifiers.TypeAttr) to classes that could have it.
10383         BeforeFieldInit should be set to classes that have no static
10384         constructor. 
10385
10386         See:
10387
10388         http://www.yoda.arachsys.com/csharp/beforefieldinit.html
10389
10390         And most importantly Zoltan's comment:
10391
10392         http://bugzilla.ximian.com/show_bug.cgi?id=44229
10393
10394         "I think beforefieldinit means 'it's ok to initialize the type sometime 
10395          before its static fields are used', i.e. initialization does not need
10396          to be triggered by the first access to the type. Setting this flag
10397          helps the JIT to compile better code, since it can run the static
10398          constructor at JIT time, and does not need to generate code to call it
10399          (possibly lots of times) at runtime. Unfortunately, mcs does not set
10400          this flag for lots of classes like String. 
10401          
10402          csc sets this flag if the type does not have an explicit static 
10403          constructor. The reasoning seems to be that if there are only static
10404          initalizers for a type, and no static constructor, then the programmer
10405          does not care when this initialization happens, so beforefieldinit
10406          can be used.
10407          
10408          This bug prevents the AOT compiler from being usable, since it 
10409          generates so many calls to mono_runtime_class_init that the AOT code
10410          is much slower than the JITted code. The JITted code is faster, 
10411          because it does not generate these calls if the vtable is type is
10412          already initialized, which is true in the majority of cases. But the
10413          AOT compiler can't do this."
10414
10415 2004-03-10  Miguel de Icaza  <miguel@ximian.com>
10416
10417         * class.cs (MethodData.Emit): Refactor the code so symbolic
10418         information is generated for destructors;  For some reasons we
10419         were taking a code path that did not generate symbolic information
10420         before. 
10421
10422 2004-03-11 Ben Maurer  <bmaurer@users.sourceforge.net>
10423
10424         * class.cs: Create a Constructor.CheckBase method that
10425         takes care of all validation type code. The method
10426         contains some code that was moved from Define.
10427
10428         It also includes new code that checks for duplicate ctors.
10429         This fixes bug #55148.
10430
10431 2004-03-09  Joshua Tauberer <tauberer@for.net>
10432
10433         * expression.cs (ArrayCreation): Fix: More than 6 nulls in
10434         a { ... }-style array creation invokes EmitStaticInitializers
10435         which is not good for reference-type arrays.  String, decimal
10436         and now null constants (NullCast) are not counted toward
10437         static initializers.
10438
10439 2004-03-05  Martin Baulig  <martin@ximian.com>
10440
10441         * location.cs (SourceFile.HasLineDirective): New public field;
10442         specifies whether the file contains or is referenced by a "#line"
10443         directive.
10444         (Location.DefineSymbolDocuments): Ignore source files which
10445         either contain or are referenced by a "#line" directive.        
10446
10447 2004-02-29  Ben Maurer <bmaurer@users.sourceforge.net>
10448
10449         * class.cs (Method.CheckBase): Avoid using FindMembers, we have
10450         direct access to our parent, so check the method inline there.
10451
10452 2004-02-27 Ben Maurer  <bmaurer@users.sourceforge.net>
10453
10454         * expression.cs (Invocation.EmitCall): Miguel's last commit
10455         caused a regression. If you had:
10456
10457             T t = null;
10458             t.Foo ();
10459
10460         In Foo the implict this would be null.
10461
10462 2004-02-27  Miguel de Icaza  <miguel@ximian.com>
10463
10464         * expression.cs (Invocation.EmitCall): If the method is not
10465         virtual, do not emit a CallVirt to it, use Call.
10466
10467         * typemanager.cs (GetFullNameSignature): Improve the method to
10468         cope with ".ctor" and replace it with the type name.
10469
10470         * class.cs (ConstructorInitializer.Resolve): Now the method takes
10471         as an argument the ConstructorBuilder where it is being defined,
10472         to catch the recursive constructor invocations.
10473
10474 2004-03-16  Martin Baulig  <martin@ximian.com>
10475
10476         * expression.cs (MemberAccess.DoResolve): If `expr' resolved to a
10477         ConstructedType, call ResolveType() on it to get the type rather
10478         than just using `expr.Type'.
10479
10480 2004-03-16  Martin Baulig  <martin@ximian.com>
10481
10482         * generics.cs (ConstructedType.GetMemberAccess): Take the
10483         EmitContext instead on the TypeExpr and use
10484         ec.TypeContainer.CurrentType/ec.ContainerType.
10485
10486 2004-03-16  Martin Baulig  <martin@ximian.com>
10487
10488         * ecore.cs (SimpleName.DoResolveAsTypeStep): Lookup type
10489         parameters before aliases.
10490
10491 2004-03-16  Martin Baulig  <martin@ximian.com>
10492
10493         * typemanager.cs (TypeManager.MayBecomeEqualGenericInstances):
10494         New oublic function; checks whether two generic instances may become
10495         equal under some instantiations (26.3.1).
10496
10497         * class.cs (TypeContainer.Define): Call
10498         TypeManager.MayBecomeEqualGenericInstances() and report CS0695 on
10499         error.
10500
10501 2004-03-16  Martin Baulig  <martin@ximian.com>
10502
10503         * class.cs (TypeContainer.GetClassBases): Moved
10504         Error_TypeParameterAsBase() here and also check whether the base
10505         class is not an attribute.
10506
10507 2004-03-16  Martin Baulig  <martin@ximian.com>
10508
10509         * class.cs (TypeContainer.GetClassBases): Fix the CS0528 check.
10510
10511 2004-03-16  Martin Baulig  <martin@ximian.com>
10512
10513         * class.cs (Error_TypeParameterAsBase): Use correct error number
10514         here (CS0689).  
10515
10516 2004-03-16  Martin Baulig  <martin@ximian.com>
10517
10518         * decl.cs (DeclSpace.ResolveTypeExpr): Added more error checking
10519         for generics.
10520
10521         * generics.cs (ConstructedType.DoResolveAsTypeStep): Added better
10522         error reporting.
10523
10524 2004-03-15  Martin Baulig  <martin@ximian.com>
10525
10526         * typemanager.cs (TypeManager.GetFullName): New public method.
10527         (TypeManager.MemberLookup): Added `int_num_type_arguments'
10528         argument; only return members with the correct number of type
10529         arguments.
10530         (TypeManager.CheckGeneric): Allow -1 to bypass the check.
10531         (TypeManager.FilterWithClosure): Call CheckGeneric() to check
10532         whether the number of type arguments matches.
10533
10534         * generic.cs (GenericMemberAccess.ResolveAsTypeStep): Allow `expr'
10535         not being a ConstructedType; we can now do "typeof (Foo.Bar<U>)".
10536
10537         * expression.cs (MemberAccess): Added public `NumTypeArguments'
10538         field; it's set by the protected .ctor when we're actually a
10539         GenericMemberAccess.
10540         (MemberAccess.ResolveAsTypeStep): Compute the total number of type
10541         arguments and pass it to MemberLookupFinal ().
10542
10543         * ecore.cs (Expression.MemberLookup): Added `int
10544         num_type_arguments' argument; only return members with the correct
10545         number of type arguments.
10546         (Expression.MemberLookupFailed): Check whether the MemberLookup
10547         failed because we did not have the correct number of type
10548         arguments; report CS0305 in this case.
10549
10550         * decl.cs (DeclSpace.ResolveTypeExpr): Don't report an error if
10551         `e.ResolveAsTypeTerminal()' already did so.
10552
10553 2004-03-15  Martin Baulig  <martin@ximian.com>
10554
10555         * ecore.cs (Expression.ResolveLValue): Allow e.type being null if
10556         we're a ConstructedType; in this case, the caller must report an
10557         error (for instance CS0131).
10558
10559         * generic.cs (TypeArguments): Added Location argument to the .ctor.
10560         (TypeArguments.Resolve): Actually report errors here.
10561
10562 2004-03-15  Miguel de Icaza  <miguel@ximian.com>
10563
10564         * pending.cs (TypeAndMethods): Add `get_indexer_name' and
10565         `set_indexer_name' to the pending bits (one per type).
10566
10567         We fixed a bug today that was picking the wrong method to
10568         override, since for properties the existing InterfaceMethod code
10569         basically ignored the method name.  Now we make sure that the
10570         method name is one of the valid indexer names.
10571
10572 2004-03-15  Martin Baulig  <martin@ximian.com>
10573
10574         * typemanager.cs (TypeManager.IndexerPropertyName): Added support
10575         for generic instances.
10576
10577 2004-03-13  Martin Baulig  <martin@ximian.com>
10578
10579         * class.cs (TypeContainer.DefineType): Call
10580         TypeManager.AddUserType() immediately after creating the
10581         TypeBuilder; pass all type parameters when creating the
10582         CurrentType.
10583
10584         * decl.cs (DeclSpace.FindNestedType): New public method.
10585         (DeclSpace.FindType): Added `int num_type_args' argument; only
10586         return types with the correct number of type parameters.
10587         (DeclSpace.CountTypeParams): New public property.
10588
10589         * ecore.cs (SimpleName.ctor): Added overloaded version which takes
10590         the number of type parameters; defaults to zero.
10591
10592         * generic.cs (TypeArguments.Count): New public property.
10593         (ConstructedType.DoResolveAsTypeStep): First call
10594         ds.FindNestedType() to find out whether we're nested in the
10595         current generic type; in this case, we inherit all type parameters
10596         from the current class.
10597
10598         * rootcontext.cs (RootContext.NamespaceLookup): Added `int
10599         num_type_args' argument.
10600         (RootContext.LookupType): Added overloaded version which takes the
10601         number of type arguments; only return types with the correct
10602         number of type arguments.
10603
10604         * typemanager.cs (TypeManager.CheckGeneric): New public function;
10605         checks whether `Type t' has `int num_type_args'.
10606
10607 2004-03-13  Martin Baulig  <martin@ximian.com>
10608
10609         * generic.cs (GenericMethod.DefineType): New method; calls
10610         DefineType() on all the type parameters.
10611
10612         * class.cs (MethodData.ctor): Added `GenericMethod generic' argument.
10613         (MethodData.Define): If we're a generic method, call
10614         GenericMethod.DefineType() to define the type parameters.       
10615
10616 2004-03-10  Martin Baulig  <martin@ximian.com>
10617
10618         * pending.cs (Pending.InterfaceMethod): Use TypeManager.IsEqual()
10619         instead of IsAssignableFrom.    
10620
10621 2004-03-10  Martin Baulig  <martin@ximian.com>
10622
10623         * ecore.cs (FieldExpr.ctor): Use TypeManager.TypeToCoreType().
10624
10625         * support.cs (ParameterData.HasArrayParameter): New property.
10626         (ReflectionParameters.ctor): Take a MethodBase instead of a
10627         ParameterInfo[].  If we have any type parameters, get the generic
10628         method definition and ask it whether we have variable arguments.
10629
10630 2004-02-26  Miguel de Icaza  <miguel@ximian.com>
10631
10632         * iterators.cs (IteratorHandler.IsIEnumerator, IsIEnumerable): New
10633         routines to check if a type is an enumerable/enumerator allow
10634         classes that implement the IEnumerable or IEnumerator interfaces.
10635
10636         * class.cs (Property, Operator): Implement IIteratorContainer, and
10637         implement SetYields.
10638
10639         (Property.Define): Do the block swapping for get_methods in the
10640         context of iterators.   We need to check if Properties also
10641         include indexers or not.
10642
10643         (Operator): Assign the Block before invoking the
10644         OperatorMethod.Define, so we can trigger the Iterator code
10645         replacement. 
10646
10647         * cs-parser.jay (SimpleIteratorContainer): new helper class.  Both
10648         Property and Operator classes are not created when we parse the
10649         declarator but until we have the block completed, so we use a
10650         singleton SimpleIteratorContainer.Simple to flag whether the
10651         SetYields has been invoked.
10652
10653         We propagate this setting then to the Property or the Operator to
10654         allow the `yield' to function.
10655
10656 2004-02-25  Marek Safar  <marek.safar@seznam.cz>
10657
10658         * codegen.cs: Implemented attribute support for modules.
10659         New AssemblyClass, ModuleClass and CommonAssemblyModulClass for
10660         Assembly/Module functionality.
10661
10662         * attribute.cs, class.cs, cs-parser.jay, delegate.cs, driver.cs, enum.cs
10663         interface.cs, rootcontext.cs, statement.cs, typemanager.cs:
10664         Updated dependencies on CodeGen.ModuleBuilder and CodeGen.AssemblyBuilder.
10665
10666 2004-02-16  Marek Safar  <marek.safar@seznam.cz>
10667
10668         * interface.cs (FindMembers): The operation is performed on all base
10669         interfaces and not only on the first. It is required for future CLS Compliance patch.
10670
10671 2004-02-12 Ben Maurer  <bmaurer@users.sourceforge.net>
10672
10673         * statement.cs, codegen.cs:
10674         This patch deals with patterns such as:
10675
10676         public class List : IEnumerable {
10677
10678                 public MyEnumerator GetEnumerator () {
10679                         return new MyEnumerator(this);
10680                 }
10681
10682                 IEnumerator IEnumerable.GetEnumerator () {
10683                         ...
10684                 }
10685                 
10686                 public struct MyEnumerator : IEnumerator {
10687                         ...
10688                 }
10689         }
10690
10691         Before, there were a few things we did wrong:
10692         1) we would emit callvirt on a struct, which is illegal
10693         2) we emited ldarg when we needed to emit ldarga
10694         3) we would mistakenly call the interface methods on an enumerator
10695         type that derived from IEnumerator and was in another assembly. For example:
10696
10697         public class MyEnumerator : IEnumerator
10698
10699         Would have the interface methods called, even if there were public impls of the
10700         method. In a struct, this lead to invalid IL code.
10701
10702 2004-02-11  Marek Safar  <marek.safar@seznam.cz>
10703
10704         * const.cs: Const is now derived from FieldBase. Method EmitConstant name
10705           renamed to Emit.
10706
10707         * delegate.cs (Define): Fixed crash when delegate type is undefined.
10708
10709 2004-02-11  Miguel de Icaza  <miguel@ximian.com>
10710
10711         * cs-parser.jay: Fix small regression: we were not testing V2
10712         compiler features correctly.
10713
10714         * interface.cs: If the emit context is null, then create one
10715
10716 2004-02-09  Marek Safar  <marek.safar@seznam.cz>
10717
10718         * decl.cs (GetSignatureForError): New virtual method to get full name
10719           for error messages.
10720
10721         * attribute.cs (IAttributeSupport): New interface for attribute setting.
10722           Now it is possible to rewrite ApplyAttributes method to be less if/else.
10723
10724         * interface.cs : All InterfaceXXX classes are now derived from MemberCore.
10725           Duplicated members and code in these classes has been removed.
10726           Better encapsulation in these classes.
10727
10728 2004-02-07  Miguel de Icaza  <miguel@ximian.com>
10729
10730         * assign.cs (Assign.DoResolve): When dealing with compound
10731         assignments, there is a new rule in ECMA C# 2.4 (might have been
10732         there before, but it is documented here) that states that in:
10733
10734         a op= b;
10735
10736         If b is of type int, and the `op' is a shift-operator, then the
10737         above is evaluated as:
10738
10739         a = (int) a op b 
10740
10741         * expression.cs (Binary.ResolveOperator): Instead of testing for
10742         int/uint/long/ulong, try to implicitly convert to any of those
10743         types and use that in pointer arithmetic.
10744
10745         * delegate.cs (Error_NoMatchingMethodForDelegate): Compute the
10746         method to print information for from the type, not from the
10747         null-method we were given.
10748
10749 2004-02-01  Duncan Mak  <duncan@ximian.com>
10750
10751         * cs-tokenizer.cs (get_cmd_arg): Skip over whitespace before
10752         parsing for cmd, fixes bug #53694.
10753
10754 2004-02-04  Marek Safar  <marek.safar@seznam.cz>
10755
10756         * class.cs, decl.cs: Fixed problem where IndexerName attribute was ignored
10757         in the member name duplication tests. Property and operator name duplication
10758         was missing too (error tests cs0102-{2,3,4,5}.cs, cs0111-{3,4}.cs).
10759
10760 2004-02-03  Marek Safar  <marek.safar@seznam.cz>
10761
10762         * interface.cs (PopulateMethod): Fixed crash when interface method
10763         returns not existing type (error test cs0246-3.cs).
10764
10765 2004-02-02  Ravi Pratap M <ravi@ximian.com>
10766
10767         * cs-parser.jay (interface_accessors): Re-write actions to also
10768         store attributes attached to get and set methods. Fix spelling
10769         while at it.
10770
10771         (inteface_property_declaration): Modify accordingly.
10772
10773         (InterfaceAccessorInfo): New helper class to store information to pass
10774         around between rules that use interface_accessors.
10775
10776         * interface.cs (Emit): Apply attributes on the get and set
10777         accessors of properties and indexers too.
10778
10779         * attribute.cs (ApplyAttributes): Modify accordingly to use the
10780         right MethodBuilder when applying attributes to the get and set accessors.
10781
10782 2004-01-31  Miguel de Icaza  <miguel@ximian.com>
10783
10784         * cs-tokenizer.cs: Applied patch from Marek Safar to fix bug 53386
10785
10786 2004-01-26  Miguel de Icaza  <miguel@ximian.com>
10787
10788         * cs-tokenizer.cs: Handle #line hidden from PDC bits.
10789
10790 2004-01-25  Miguel de Icaza  <miguel@ximian.com>
10791
10792         * cs-parser.jay: Remove YIELD token, instead use the new grammar
10793         changes that treat `yield' specially when present before `break'
10794         or `return' tokens.
10795
10796         * cs-tokenizer.cs: yield is no longer a keyword.
10797
10798 2004-01-23  Marek Safar  <marek.safar@seznam.cz>
10799
10800         * cs-parser.jay, class.cs (DefineDefaultConstructor): Fixed ModFlags
10801         setting for default constructors.
10802         For default constructors are almost every time set wrong Modifier. The
10803         generated IL code has been alright. But inside mcs this values was
10804         wrong and this was reason why several of my CLS Compliance tests
10805         failed.
10806
10807 2004-02-27  Martin Baulig  <martin@ximian.com>
10808
10809         * generics.cs (ConstructedType.ResolveType): Make the nested type
10810         stuff actually work.
10811
10812 2004-02-25  Martin Baulig  <martin@ximian.com>
10813
10814         * decl.cs (DeclSpace.CurrentTypeParameters): New protected
10815         property; returns the type parameters just from the current type,
10816         ie. with the ones from outer classes.
10817         (DeclSpace.LookupGeneric): First search in the current class, then
10818         in outer classes.
10819         (DeclSpace.initialize_type_params): When hiding a type parameter
10820         from an outer class, put it into the `type_param_list' anyways.
10821
10822         * expression.cs (MemberAccess.expr): Made this field protected.
10823
10824         * class.cs (TypeContainer.Define): The `CurrentType' just contains
10825         the type parameters from the current class.
10826
10827         * generic.cs (ConstructedType.ResolveType): Support nested generic
10828         types by taking the type parameters which we inherit from outer
10829         classes into account.
10830         (GenericMemberAccess.ResolveAsTypeStep): Override this and added
10831         support for nested generic types.
10832
10833 2004-02-23  Martin Baulig  <martin@ximian.com>
10834
10835         * decl.cs (DeclSpace.IsGeneric): Make this a property instead of a
10836         field and check whether we're nested inside a generic type.
10837         (DeclSpace.ResolveType): If we're resolving to a generic type
10838         definition, create a ConstructedType and return its resolved type.
10839         (DeclSpace.initialize_type_params): New private method;
10840         initializes the `type_param_list' field from the type parameters
10841         from this and all enclosing classes.
10842         (DeclSpace.TypeParameters): Call initialize_type_params() unless
10843         we're already initialized.
10844
10845 2004-02-23  Martin Baulig  <martin@ximian.com>
10846
10847         * class.cs (Method.Define): Create the generic method before
10848         calling DoDefine().
10849         (Memberbase.DoDefine): Added DeclSpace argument (in addition to
10850         the TypeContainer one); we use this for generic methods.
10851
10852         * decl.cs (CheckAccessLevel): If we're a GenericMethod, use our
10853         parent's TypeBuilder.
10854
10855 2004-02-18  Martin Baulig  <martin@ximian.com>
10856
10857         * ecore.cs (FieldExpr.DoResolveLValue): Use TypeManager.IsEqual()
10858         to check for equality.
10859
10860 2004-02-05  Martin Baulig  <martin@ximian.com>
10861
10862         * ecore.cs (FieldExpr.DoResolveLValue): If we have an
10863         `ec.TypeContainer.CurrentType', use it instead of
10864         `ec.ContainerType' to check whether we're in the type's ctor.
10865
10866 2004-01-29  Martin Baulig  <martin@ximian.com>
10867
10868         * expression.cs (Invocation.DoResolve): If we're a
10869         `ConstructedType', then we're actually a generic method, so
10870         rewrite the expr as a GenericMemberAccess.
10871
10872         * cs-parser.jay (member_name): Don't use `namespace_or_type_name'
10873         here; manually parse it into a string.
10874
10875 2004-01-28  Martin Baulig  <martin@ximian.com>
10876
10877         * typemanager.cs (TypeManager.IsEqual): New static method.
10878         (TypeManager.FilterWithClosure): Call TypeManager.IsEqual() to
10879         check for equality instead of using `=='.
10880
10881 2004-01-26  Martin Baulig  <martin@ximian.com>
10882
10883         * decl.cs (DeclSpace.CurrentType): New public field.
10884
10885         * expression.cs (This.ResolveBase): If we have an
10886         `ec.TypeContainer.CurrentType', use it instead of
10887         `ec.ContainerType'.
10888
10889         * class.cs (TypeContainer.DefineType): If we're a generic type,
10890         create the `CurrentType' (unresolved).
10891         (TypeContainer.GenericType): New private field.
10892         (TypeContainer.DefineMembers): If we have a `CurrentType', resolve
10893         it and store it in `GenericType' before creating the MemberCache.
10894         (TypeContainer.GetMembers): If we have a `GenericType', call
10895         TypeManager.FindMembers() on it.
10896
10897         * interface.cs (Interface.GenericType): New private field.
10898         (Interface.DefineType): If we're a generic type, create the
10899         `CurrentType' (unresolved).
10900         (Interface.DefineMembers): If we have a `CurrentType', resolve it
10901         and store it in `GenericType' before creating the MemberCache.
10902         (Interface.GetMembers): If we have a `GenericType', call
10903         TypeManager.FindMembers() on it.
10904
10905 2004-01-22  Martin Baulig  <martin@ximian.com>
10906
10907         * cs-parser.jay (namespace_or_type_name): Return an Expression,
10908         not a QualifiedIdentifier.  This is what `type_name_expression'
10909         was previously doing.
10910         (type_name_expression): Removed; the code is now in
10911         `namespace_or_type_name'.
10912         (qualified_identifier): Removed, use `namespace_or_type_name'
10913         instead.
10914         (QualifiedIdentifier): Removed this class.      
10915
10916 2004-01-22  Martin Baulig  <martin@ximian.com>
10917
10918         * namespace.cs (NamespaceEntry.UsingAlias): Take an Expression,
10919         not a string as alias name.
10920
10921 2004-01-21  Miguel de Icaza  <miguel@ximian.com>
10922
10923         * ecore.cs (FieldInfo.AddressOf): Revert patch from previous
10924         #52730 bug, and instead compute correctly the need to use a
10925         temporary variable when requesting an address based on the
10926         static/instace modified of the field and the constructor.
10927  
10928 2004-01-21  Martin Baulig  <martin@ximian.com>
10929
10930         * ecore.cs (SimpleName.ResolveAsTypeStep): Lookup in the current
10931         class and namespace before looking up aliases.  Fixes #52517.
10932
10933 2004-01-21  Martin Baulig  <martin@ximian.com>
10934
10935         * flowanalysis.cs (UsageVector.Merge): Allow variables being
10936         assinged in a 'try'; fixes exception4.cs.
10937
10938 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
10939         * class.cs : Implemented parameter-less constructor for TypeContainer
10940
10941         * decl.cs: Attributes are now stored here. New property OptAttributes
10942
10943         * delegate.cs, enum.cs, interface.cs: Removed attribute member.
10944
10945         * rootcontext.cs, tree.cs: Now use parameter-less constructor of TypeContainer
10946
10947 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
10948
10949         * typemanager.cs (CSharpSignature): Now reports also inner class name.
10950           (CSharpSignature): New method for indexer and property signature.
10951
10952 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
10953
10954         * pending.cs (IsVirtualFilter): Faster implementation.
10955
10956 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
10957
10958         * typemanager.cs: Avoid inclusion of same assembly more than once.
10959
10960 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
10961
10962         * cs-parser.jay: Fixed problem where the last assembly attribute
10963           has been applied also to following declaration (class, struct, etc.)
10964           
10965 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
10966
10967         * class.cs: Added error CS0538, CS0539 reporting.
10968         Fixed crash on Microsoft runtime when field type is void.
10969
10970         * cs-parser.jay: Added error CS0537 reporting.
10971
10972         * pending.cs: Added error CS0535 reporting.
10973         Improved error report for errors CS0536, CS0534.
10974
10975 2004-01-20  Miguel de Icaza  <miguel@ximian.com>
10976
10977         Merge a few bits from the Anonymous Method MCS tree.
10978
10979         * statement.cs (ToplevelBlock): New class for toplevel methods,
10980         will hold anonymous methods, lifted variables.
10981
10982         * cs-parser.jay: Create toplevel blocks for delegates and for
10983         regular blocks of code. 
10984
10985 2004-01-20  Martin Baulig  <martin@ximian.com>
10986
10987         * codegen.cs (EmitContext): Removed `InTry', `InCatch',
10988         `InFinally', `InLoop', `TryCatchLevel', `LoopBeginTryCatchLevel'
10989         and `NeedExplicitReturn'; added `IsLastStatement'.
10990         (EmitContext.EmitTopBlock): Emit the explicit "ret" if we either
10991         have a `ReturnLabel' or we're not unreachable.
10992
10993         * flowanalysis.cs (FlowBranching.MergeChild): Actually merge the
10994         child's reachability; don't just override ours with it.  Fixes
10995         #58058 (lluis's example).
10996         (FlowBranching): Added public InTryOrCatch(), InCatch(),
10997         InFinally(), InLoop(), InSwitch() and
10998         BreakCrossesTryCatchBoundary() methods.
10999
11000         * statement.cs (Return): Do all error checking in Resolve().
11001         Unless we are the last statement in a top-level block, always
11002         create a return label and jump to it.
11003         (Break, Continue): Do all error checking in Resolve(); also make
11004         sure we aren't leaving a `finally'.
11005         (Block.DoEmit): Set `ec.IsLastStatement' when emitting the last
11006         statement in a top-level block.
11007         (Block.Flags): Added `IsDestructor'.
11008         (Block.IsDestructor): New public property.
11009
11010 2004-01-20  Martin Baulig  <martin@ximian.com>
11011
11012         * statement.cs (Break.DoEmit): Set ec.NeedExplicitReturn; fixes #52427.
11013
11014 2004-01-20  Martin Baulig  <martin@ximian.com>
11015
11016         * statement.cs (Statement.ResolveUnreachable): New public method.
11017         (If, While): Do the dead-code elimination in Resolve(), not in Emit().
11018         (Block.Resolve): Resolve unreachable statements.
11019
11020 2004-01-19 Ben Maurer  <bmaurer@users.sourceforge.net>
11021
11022         * expression.cs: We need to fix the case where we do
11023         not have a temp variable here.
11024
11025         * assign.cs: Only expression compound assignments need
11026         temporary variables.
11027
11028 2004-01-19 Ben Maurer  <bmaurer@users.sourceforge.net>
11029
11030         * flowanalysis.cs: Reduce memory allocation in a few ways:
11031           - A block with no variables should not allocate a bit
11032             vector for itself.
11033           - A method with no out parameters does not need any tracking
11034             for assignment of the parameters, so we need not allocate
11035             any data for it.
11036           - The arrays:
11037                 public readonly Type[] VariableTypes;
11038                 public readonly string[] VariableNames;
11039             Are redundant. The data is already stored in the variable
11040             map, so we need not allocate another array for it.
11041           - We need to add alot of checks for if (params | locals) == null
11042             due to the first two changes.
11043
11044 2004-01-18  Miguel de Icaza  <miguel@ximian.com>
11045
11046         * ecore.cs (FieldExpr.AddressOf): For ValueTypes that do not
11047         implement IMemoryLocation, we store a copy on a local variable and
11048         take the address of it.  Patch from Benjamin Jemlich
11049
11050         * cs-parser.jay: Applied patch from Ben Maurer to the "type" rule
11051         to use a special "type_name_expression" rule which reduces the
11052         number of "QualifiedIdentifier" classes created, and instead
11053         directly creates MemberAccess expressions.
11054
11055 2004-01-17  Miguel de Icaza  <miguel@ximian.com>
11056
11057         * convert.cs: Applied patch from Benjamin Jemlich (pcgod@gmx.net)
11058         that fixes #52853.  Null literal assignment to ValueType
11059
11060         * class.cs (MethodData.Emit): Instead of checking the name of the
11061         method to determine if its a destructor, create a new derived
11062         class from Method called Destructor, and test for that.  
11063
11064         * cs-parser.jay: Create a Destructor object instead of a Method.  
11065
11066         Based on a fix from Benjamin Jemlich (pcgod@gmx.net)
11067
11068         Fixes: 52933
11069
11070 2004-01-16  Miguel de Icaza  <miguel@ximian.com>
11071
11072         * expression.cs (Binary.ResolveOperator): Perform an implicit
11073         conversion from MethodGroups to their delegate types on the
11074         Addition operation.
11075
11076         * delegate.cs: Introduce a new class DelegateCreation that is the
11077         base class for `NewDelegate' and `ImplicitDelegateCreation',
11078         factor some code in here.
11079
11080         * convert.cs (Convert.ImplicitConversionStandard): Add an implicit
11081         conversion from MethodGroups to compatible delegate types. 
11082
11083         * ecore.cs (Expression.Resolve): Do not flag error 654
11084         (Methodgroupd needs parenthesis) if running on the V2 compiler, as
11085         we allow conversions from MethodGroups to delegate types now.
11086
11087         * assign.cs (Assign.DoResolve): Do not flag errors on methodgroup
11088         assignments in v2 either.
11089
11090 2004-01-10  Miguel de Icaza  <miguel@ximian.com>
11091
11092         * ecore.cs (FieldExpr.AddressOf): Fix generated IL for accessing
11093         static read-only fields in ctors.
11094
11095         Applied patch from Benjamin Jemlich 
11096
11097         * expression.cs (UnaryMutator): Avoid leaking local variables. 
11098
11099 2004-01-09  Miguel de Icaza  <miguel@ximian.com>
11100
11101         * cs-tokenizer.cs (IsCastToken): Allow the various native types
11102         here to return true, as they can be used like this:
11103
11104                 (XXX) int.MEMBER ()
11105
11106         Fixed 49836 and all the other dups
11107
11108 2004-01-09  Zoltan Varga  <vargaz@freemail.hu>
11109
11110         * driver.cs: Implement /win32res and /win32icon.
11111
11112 2004-01-08  Miguel de Icaza  <miguel@ximian.com>
11113
11114         * cs-parser.jay: Add a rule to improve error handling for the
11115         common mistake of placing modifiers after the type.
11116
11117 2004-01-07  Miguel de Icaza  <miguel@ximian.com>
11118
11119         * cs-parser.jay (interface_event_declaration): Catch
11120         initialization of events on interfaces, and report cs0068
11121
11122         * cs-parser.jay (interface_event_declaration): Catch
11123         initialization of events. 
11124
11125         * ecore.cs: Better report missing constructors.
11126
11127         * expression.cs (Binary.ResolveOperator): My previous bug fix had
11128         the error reporting done in the wrong place.  Fix.
11129
11130         * expression.cs (Binary.ResolveOperator): Catch the 
11131         operator + (E x, E y) error earlier, and later allow for implicit
11132         conversions in operator +/- (E e, U x) from U to the underlying
11133         type of E.
11134
11135         * class.cs (TypeContainer.DefineDefaultConstructor): Fix bug
11136         52596, if the container class is abstract, the default constructor
11137         is protected otherwise its public (before, we were always public).
11138
11139         * statement.cs (Fixed.Resolve): Catch a couple more errors in the
11140         fixed statement.
11141
11142         (Using.EmitLocalVariableDecls): Applied patch from Benjamin
11143         Jemlich that fixes bug #52597, MCS was generating invalid code for
11144         idisposable structs.   Thanks to Ben for following up with this
11145         bug as well.
11146
11147 2004-01-06  Miguel de Icaza  <miguel@ximian.com>
11148
11149         * driver.cs: Allow assemblies without code to be generated, fixes
11150         52230.
11151
11152 2004-01-07  Nick Drochak <ndrochak@gol.com>
11153
11154         * attribute.cs: Remove unneeded catch variables. Eliminates a warning.
11155
11156 2004-01-05  Miguel de Icaza  <miguel@ximian.com>
11157
11158         * cs-parser.jay: Add rules to improve error reporting if fields or
11159         methods are declared at the namespace level (error 116)
11160
11161         * Add rules to catch event add/remove
11162
11163 2004-01-04  David Sheldon <dave-mono@earth.li>
11164
11165   * expression.cs: Added matching ")" to error message for 
11166   CS0077
11167
11168 2004-01-03 Todd Berman <tberman@gentoo.org>
11169
11170         * ecore.cs, attribute.cs:
11171         Applying fix from #52429.
11172
11173 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
11174
11175         * ecore.cs, expression.cs, statement.cs:
11176         Total rewrite of how we handle branching. We
11177         now handle complex boolean expressions with fewer
11178         jumps. As well if (x == 0) no longer emits a ceq.
11179
11180         if (x is Foo) is much faster now, because we generate
11181         better code.
11182
11183         Overall, we get a pretty big improvement on our benchmark
11184         tests. The code we generate is smaller and more readable.
11185
11186         I did a full two-stage bootstrap. The patch was reviewed
11187         by Martin and Miguel.
11188
11189 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
11190
11191         * cs-parser.jay: Make primary_expression not take a QI.
11192         we dont need this because the member_access rule covers
11193         us here. So we replace the rule with just IDENTIFIER.
11194
11195         This has two good effects. First, we remove a s/r conflict.
11196         Second, we allocate many fewer QualifiedIdentifier objects.
11197
11198 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
11199
11200         * attribute.cs: Handle MarshalAs attributes as pseudo, and
11201         set the correct information via SRE. This prevents
11202         hanging on the MS runtime. Fixes #29374.
11203
11204 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
11205
11206         * convert.cs: correctly handle conversions to value types
11207         from Enum and ValueType as unboxing conversions.
11208
11209         Fixes bug #52569. Patch by Benjamin Jemlich.
11210
11211 2004-01-02  Ravi Pratap  <ravi@ximian.com>
11212
11213         * expression.cs (BetterConversion): Prefer int -> uint
11214         over int -> ulong (csc's behaviour). This fixed bug #52046.
11215
11216 2004-01-02 Ben Maurer  <bmaurer@users.sourceforge.net>
11217
11218         * decl.cs (MemberCache.FindMembers): now returns a
11219         MemberInfo [].
11220
11221         * typemanager.cs: In general, go with with ^^.
11222         (CopyNewMethods): take an IList.
11223         (RealMemberLookup): Only allocate an arraylist
11224         if we copy from two sets of methods.
11225
11226         This change basically does two things:
11227         1) Fewer array lists allocated due to CopyNewMethods.
11228         2) the explicit cast in MemberList costed ALOT.
11229
11230 2004-01-02  Zoltan Varga  <vargaz@freemail.hu>
11231
11232         * cs-tokenizer.cs (consume_identifier) driver.cs: Cache identifiers in
11233         a hashtable to avoid needless string allocations when an identifier is
11234         used more than once (the common case).
11235
11236 2004-01-01 Ben Maurer  <bmaurer@users.sourceforge.net>
11237
11238         * pending.cs: MS's TypeBuilder.GetInterfaces ()
11239         is broken, it will not return anything. So, we
11240         have to use the information we have in mcs to
11241         do the task.
11242
11243         * typemanager.cs: Add a cache for GetInterfaces,
11244         since this will now be used more often (due to ^^)
11245
11246         (GetExplicitInterfaces) New method that gets the
11247         declared, not effective, interfaces on a type
11248         builder (eg, if you have interface IFoo, interface
11249         IBar, Foo : IFoo, Bar : Foo, IBar, GetExplInt (Bar) ==
11250         { IBar }.
11251
11252         This patch makes MCS able to bootstrap itself on
11253         Windows again.
11254
11255 2004-01-01 Ben Maurer  <bmaurer@users.sourceforge.net>
11256
11257         * expression.cs: Remove the Nop's that Miguel put
11258         in by mistake.
11259
11260 2003-12-31 Ben Maurer  <bmaurer@users.sourceforge.net>
11261
11262         * report.cs, codegen.cs: Give the real stack trace to
11263         the error when an exception is thrown.
11264
11265 2003-12-31 Ben Maurer  <bmaurer@users.sourceforge.net>
11266
11267         * decl.cs: only allocate hashtables for ifaces if 
11268         it is an iface!
11269
11270 2003-12-31 Ben Maurer  <bmaurer@users.sourceforge.net>
11271
11272         * expression.cs: fix the error from cs0121-2.cs
11273         (a parent interface has two child interfaces that
11274         have a function with the same name and 0 params
11275         and the function is called through the parent).
11276
11277 2003-12-30 Ben Maurer  <bmaurer@users.sourceforge.net>
11278
11279         * class.cs, rootcontext.cs, typmanager.cs: do not
11280         leak pointers.
11281
11282 2003-12-28 Ben Maurer  <bmaurer@users.sourceforge.net>
11283
11284         * codegen.cs: remove stack for the ec flow branching.
11285         It is already a linked list, so no need.
11286
11287 2003-12-27 Ben Maurer  <bmaurer@users.sourceforge.net>
11288
11289         * Makefile: Allow custom profiler here.
11290
11291 2003-12-26 Ben Maurer  <bmaurer@users.sourceforge.net>
11292
11293         * typemanager.cs (LookupType):
11294           - Use a static char [], because split takes
11295             a param array for args, so it was allocating
11296             every time.
11297           - Do not store true in a hashtable, it boxes.
11298
11299 2003-12-26 Ben Maurer  <bmaurer@users.sourceforge.net>
11300
11301         * flowanalysis.cs: bytify common enums.
11302
11303 2003-12-25 Ben Maurer  <bmaurer@users.sourceforge.net>
11304
11305         * modifiers.cs: Add a new set of flags for the
11306         flags allowed on explicit interface impls.
11307         * cs-parser.jay: catch the use of modifiers in
11308         interfaces correctly.
11309         * class.cs: catch private void IFoo.Blah ().
11310
11311         All related to bug #50572.
11312
11313 2003-12-25 Ben Maurer  <bmaurer@users.sourceforge.net>
11314
11315         * decl.cs: Rewrite the consistant accessability checking.
11316         Accessability is not linear, it must be implemented in
11317         a tableish way. Fixes #49704.
11318
11319 2003-12-25 Ben Maurer  <bmaurer@users.sourceforge.net>
11320
11321         * expression.cs: Handle negation in a checked context.
11322         We must use subtraction from zero. Fixes #38674.
11323
11324 2003-12-23 Ben Maurer  <bmaurer@users.sourceforge.net>
11325
11326         * class.cs: Ignore static void main in DLLs.
11327         * rootcontext.cs: Handle the target type here,
11328         since we are have to access it from class.cs
11329         * driver.cs: account for the above.
11330
11331 2003-12-23 Ben Maurer  <bmaurer@users.sourceforge.net>
11332
11333         * report.cs: Give line numbers and files if available.
11334
11335 2003-12-20  Zoltan Varga  <vargaz@freemail.hu>
11336
11337         * driver.cs: Implement /addmodule.
11338
11339         * typemanager.cs:  Change 'modules' field so it now contains Modules not
11340         ModuleBuilders.
11341
11342 2003-12-20  Martin Baulig  <martin@ximian.com>
11343
11344         * class.cs (TypeContainer.DefineMembers): Don't do the CS0649 check here.
11345         (FieldBase.IsAssigned): Removed this field.
11346         (FieldBase.SetAssigned): New public method.
11347         (TypeContainer.Emit): Make the CS0169/CS0649 checks actually work.
11348
11349 2003-12-20  Martin Baulig  <martin@ximian.com>
11350
11351         * expression.cs (LocalVariableReference.DoResolve): Don't set
11352         `vi.Used' if we're called from DoResolveLValue().
11353
11354         * statement.cs (Block.DoResolve): `ec.DoEndFlowBranching()' now
11355         returns the usage vector it just merged into the current one -
11356         pass this one to UsageWarning().
11357         (Block.UsageWarning): Take the `FlowBranching.UsageVector' instead
11358         of the `EmitContext', don't call this recursively on our children.
11359
11360 2003-12-19  Zoltan Varga  <vargaz@freemail.hu>
11361
11362         * driver.cs: Implement /target:module.
11363
11364 2003-12-18  Zoltan Varga  <vargaz@freemail.hu>
11365
11366         * support.cs (CharArrayHashtable): New helper class.
11367
11368         * cs-tokenizer.cs: Store keywords in a hashtable indexed by 
11369         char arrays, not strings, so we can avoid creating a string in
11370         consume_identifier if the identifier is a keyword.
11371
11372 2003-12-16  Martin Baulig  <martin@ximian.com>
11373
11374         * statement.cs (LocalInfo.Assigned): Removed this property.
11375         (LocalInfo.Flags): Removed `Assigned'.
11376         (LocalInfo.IsAssigned): New public method; takes the EmitContext
11377         and uses flow analysis.
11378         (Block.UsageWarning): Made this method private.
11379         (Block.Resolve): Call UsageWarning() if appropriate.
11380
11381         * expression.cs (LocalVariableReference.DoResolve): Always set
11382         LocalInfo.Used here.
11383
11384 2003-12-13  Martin Baulig  <martin@ximian.com>
11385
11386         * statement.cs (Statement.DoEmit, Statement.Emit): Don't return
11387         any value here; we're now using flow analysis to figure out
11388         whether a statement/block returns a value.
11389
11390 2003-12-13  Martin Baulig  <martin@ximian.com>
11391
11392         * flowanalysis.cs (UsageVector.MergeFinallyOrigins): Made this
11393         working again.
11394         (FlowBranching.MergeFinally): Don't call
11395         `branching.CheckOutParameters()' here, this is called in
11396         MergeTopBlock().
11397         (FlowBranchingException.AddSibling): Call MergeFinallyOrigins()
11398         when adding the `finally' vector.       
11399
11400 2003-12-13  Martin Baulig  <martin@ximian.com>
11401
11402         * flowanalysis.cs
11403         (UsageVector.MergeJumpOrigins, FlowBranching.Label): Make this
11404         actually work and also fix #48962.
11405
11406 2003-12-12 Ben Maurer  <bmaurer@users.sourceforge.net>
11407
11408         * decl.cs: Do not check System.Object for nested types,
11409         since we know it does not have any. Big bang for buck:
11410
11411         BEFORE:
11412            Run 1:   8.35 seconds
11413            Run 2:   8.32 seconds
11414            corlib:  17.99 seconds
11415         AFTER:
11416            Run 1:   8.17 seconds
11417            Run 2:   8.17 seconds
11418            corlib:  17.39 seconds
11419
11420 2003-12-11 Ben Maurer  <bmaurer@users.sourceforge.net>
11421
11422         * class.cs (FindMembers): Allocate arraylists on demand. Most of the
11423         time we are returning 0 members, so we save alot here.
11424
11425 2003-12-11  Martin Baulig  <martin@ximian.com>
11426
11427         * flowanalysis.cs (UsageVector.MergeResult): Renamed this back to
11428         `MergeChild()', also just take the `FlowBranching' as argument;
11429         call Merge() on it and return the result.
11430         (FlowBranching.Merge): We don't need to do anything if we just
11431         have one sibling.
11432
11433 2003-12-11  Martin Baulig  <martin@ximian.com>
11434
11435         * flowanalysis.cs: Use a list of `UsageVector's instead of storing
11436         them in an `ArrayList' to reduce memory usage.  Thanks to Ben
11437         Maurer for this idea.
11438
11439 2003-12-11  Martin Baulig  <martin@ximian.com>
11440
11441         * flowanalysis.cs (MergeResult): This class is now gone; we now
11442         use the `UsageVector' for this.  The reason for this is that if a
11443         branching just has one sibling, we don't need to "merge" them at
11444         all - that's the next step to do.
11445         (FlowBranching.Merge): We now return a `UsageVector' instead of a
11446         `MergeResult'.
11447
11448 2003-12-11  Martin Baulig  <martin@ximian.com>
11449
11450         Reworked flow analyis and made it more precise and bug-free.  The
11451         most important change is that we're now using a special `Reachability'
11452         class instead of having "magic" meanings of `FlowReturns'.  I'll
11453         do some more cleanups and optimizations and also add some more
11454         documentation this week.
11455
11456         * flowanalysis.cs (Reachability): Added `Throws' and `Barrier';
11457         largely reworked this class.
11458         (FlowReturns): Removed `Unreachable' and `Exception'; we now use
11459         the new `Reachability' class instead of having "magic" values here.
11460         (FlowBranching): We're now using an instance of `Reachability'
11461         instead of having separate `Returns', `Breaks' etc. fields.
11462
11463         * codegen.cs (EmitContext.EmitTopBlock): Set `has_ret' solely
11464         based on flow analysis; ignore the return value of block.Emit ().
11465
11466 2003-12-10  Zoltan Varga  <vargaz@freemail.hu>
11467
11468         * driver.cs typemanager.cs: Find the mono extensions to corlib even
11469         if they are private.
11470
11471 2003-12-09  Martin Baulig  <martin@ximian.com>
11472
11473         * flowanalyis.cs (FlowBranching.Return, Goto, Throw): Removed;
11474         call them directly on the UsageVector.
11475
11476 2003-12-09  Martin Baulig  <martin@ximian.com>
11477
11478         * flowanalysis.cs (FlowBranching.MergeChild, MergeTopBlock):
11479         Changed return type from `FlowReturns' to `Reachability'.
11480
11481 2003-12-09  Martin Baulig  <martin@ximian.com>
11482
11483         * flowanalysis.cs (FlowBranching.Reachability): New sealed class.
11484         (FlowBranching.MergeResult): Replaced the `Returns', `Breaks' and
11485         `Reachable' fields with a single `Reachability' one.
11486
11487 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
11488
11489         * class.cs (FindMembers): Remove foreach's.
11490
11491         Bootstrap times:
11492
11493         BEFORE
11494                 Run 1:   8.74 seconds
11495                 Run 2:   8.71 seconds
11496
11497         AFTER
11498                 Run 1:   8.64 seconds
11499                 Run 2:   8.58 seconds
11500
11501
11502 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
11503
11504         * cs-parser.jay:
11505         * gen-treedump.cs:
11506         * statement.cs:
11507         This patch does a few things:
11508                 1. EmptyStatement is now a singleton, so it is never reallocated.
11509                 2. All blah is EmptyStatement constructs have been changed to
11510                    blah == EmptyStatement.Value, which is much faster and valid
11511                    now that EmptyStatement is a singleton.
11512                 3. When resolving a block, rather than allocating a new array for
11513                    the non-empty statements, empty statements are replaced with
11514                    EmptyStatement.Value
11515                 4. Some recursive functions have been made non-recursive.
11516         Mainly the performance impact is from (3), however (1) and (2) are needed for
11517         this to work. (4) does not make a big difference in normal situations, however
11518         it makes the profile look saner.
11519
11520         Bootstrap times:
11521
11522         BEFORE
11523         9.25user 0.23system 0:10.28elapsed 92%CPU (0avgtext+0avgdata 0maxresident)k
11524         9.34user 0.13system 0:10.23elapsed 92%CPU (0avgtext+0avgdata 0maxresident)k
11525         Total memory allocated: 56397 KB
11526
11527         AFTER
11528         9.13user 0.09system 0:09.64elapsed 95%CPU (0avgtext+0avgdata 0maxresident)k
11529         8.96user 0.24system 0:10.13elapsed 90%CPU (0avgtext+0avgdata 0maxresident)k
11530         Total memory allocated: 55666 KB
11531
11532 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
11533
11534         * support.cs: Rewrite DoubleHash to use its own impl. Is faster
11535         than the hashtable in a hashtable version
11536
11537         * decl.cs: Right now, whenever we try to lookup a type inside a namespace,
11538         we always end up concating a string. This results in a huge perf
11539         loss, because many strings have to be tracked by the GC. In this
11540         patch, we first use a hashtable that works with two keys, so that
11541         the strings do not need to be concat'ed.
11542
11543         Bootstrap times:
11544         BEFORE
11545                 Run 1:   8.74 seconds
11546                 Run 2:   8.71 seconds
11547
11548         AFTER
11549                 Run 1:   8.65 seconds
11550                 Run 2:   8.56 seconds
11551
11552 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
11553
11554         * Makefile: Add a new target `do-time' that does a quick and simple
11555         profile, leaving easy to parse output.
11556
11557 2003-12-08  Zoltan Varga  <vargaz@freemail.hu>
11558
11559         * codegen.cs (Init): Create the dynamic assembly with 
11560         AssemblyBuilderAccess.Save, to enable some optimizations in the runtime.
11561
11562 2003-12-02 Ben Maurer  <bmaurer@users.sourceforge.net>
11563
11564         * support.cs: Make the PtrHashtable use only one
11565         instance of its comparer.
11566
11567 2003-11-30  Zoltan Varga  <vargaz@freemail.hu>
11568
11569         * typemanager.cs: Fix lookup of GetNamespaces.
11570
11571 2003-11-29  Miguel de Icaza  <miguel@ximian.com>
11572
11573         * expression.cs: Removed redundant line.
11574
11575         * statement.cs (Block.Resolve, Block.Emit): Avoid foreach on
11576         ArrayLists, use for loops with bounds.  
11577
11578         * flowanalysis.cs (FlowBranching.Merge): Avoid foreach on
11579         arraylist.
11580
11581         * expression.cs (Invocation.OverloadResolve): Avoid foreach on
11582         arraylists, use for loop with bounds.
11583
11584         The above three changes give us a 0.071 second performance
11585         improvement out of 3.294 seconds down to 3.223.  On my machine
11586         the above changes reduced the memory usage by 1,387 KB during
11587         compiler bootstrap.
11588
11589         * cs-parser.jay (QualifiedIdentifier): New class used to represent
11590         QualifiedIdentifiers.  Before we created a new string through
11591         concatenation, and mostly later on, the result would be
11592         manipulated by DecomposeQI through string manipulation.
11593
11594         This reduced the compiler memory usage for bootstrapping from
11595         59380 KB to 59007 KB on my machine, 373 KB, and also reduced the
11596         compile times in 0.05 seconds.
11597
11598 2003-11-28  Dick Porter  <dick@ximian.com>
11599
11600         * support.cs: Do string compares with the Invariant culture.
11601
11602         * rootcontext.cs: 
11603         * gen-treedump.cs: 
11604         * expression.cs: 
11605         * driver.cs: 
11606         * decl.cs: 
11607         * codegen.cs: 
11608         * class.cs: Use the char forms of IndexOf and LastIndexOf, so that
11609         the comparison is done with the Invariant culture.
11610
11611 2003-11-27  Miguel de Icaza  <miguel@ximian.com>
11612
11613         * statement.cs (Foreach.TryType): Use DeclaredOnly to find the
11614         GetEnumerator method.
11615
11616         (ProbeCollectionType): Iterate starting at the most specific type
11617         upwards looking for a GetEnumerator
11618
11619         * expression.cs: Shift count can be up to 31 for int/uint and 63
11620         for long/ulong.
11621
11622 2003-11-26  Miguel de Icaza  <miguel@ximian.com>
11623
11624         * statement.cs (Block.LookupLabel): Also look for the label on the
11625         children blocks.  Use a hash table to keep track of visited
11626         nodes. 
11627
11628         * cfold.cs (IntConstant to UIntConstant mapping): Only return if
11629         we actually did transform the other operand, otherwise fall back
11630         to the common codepath that casts to long.
11631
11632         * cs-tokenizer.cs: Use the same code pattern as the int case.
11633         Maybe I should do the parsing myself, and avoid depending on the
11634         Parse routines to get this done.
11635
11636 2003-11-25  Miguel de Icaza  <miguel@ximian.com>
11637
11638         * expression.cs: Apply fix from l_m@pacbell.net (Laurent Morichetti),  
11639         which fixes bug 51347.  This time test it.
11640
11641         * expression.cs: Make TypeOfVoid derive from TypeOf, so code in
11642         attributes for example can not tell the difference between these.
11643         The difference was only a syntax feature of the language. 
11644
11645         * attribute.cs: Apply attributes to delegates.
11646
11647         * delegate.cs: Call the apply attributes method.
11648
11649 2003-11-24  Miguel de Icaza  <miguel@ximian.com>
11650
11651         * convert.cs (TryImplicitIntConversion): One line bug fix: we were
11652         comparing 0 vs Byte.MinValue, not the value
11653
11654         (ImplicitConversionRequired): When reporting a conversion error,
11655         use error 31 to print out the constant error instead of the
11656         simpler 29.
11657
11658         * expression.cs: Apply fix from l_m@pacbell.net (Laurent Morichetti),  
11659         which fixes bug 51347.
11660
11661 2003-11-22  Miguel de Icaza  <miguel@ximian.com>
11662
11663         * driver.cs: Applied patch from gert.driesen@pandora.be (Gert Driesen) 
11664         which fixes the -warnaserror command line option.
11665
11666 2003-11-21  Miguel de Icaza  <miguel@ximian.com>
11667
11668         * cfold.cs (DoNumericPromotions): During constant folding of
11669         additions on UIntConstant, special case intconstants with
11670         IntConstants like we do on the expression binary operator. 
11671
11672 2003-11-12  Miguel de Icaza  <miguel@ximian.com>
11673
11674         * convert.cs (ImplicitReferenceConversion): We were missing a case
11675         (System.Enum are not value types or class types, so we need to
11676         classify them separatedly).
11677
11678         * driver.cs: We do not support error 2007.
11679
11680 2003-11-12 Jackson Harper <jackson@ximian.com>
11681
11682         * driver.cs: Use corlib.dll or mscorlib.dll when looking up the
11683         system directory. Also use the full file name so users can
11684         libraries names mscorlib-o-tron.dll in a non system dir.
11685         
11686 2004-01-04  David Sheldon <dave-mono@earth.li>
11687
11688         * expression.cs: Added matching ")" to error message for CS0077.
11689
11690 2003-12-19  Martin Baulig  <martin@ximian.com>
11691
11692         * typemanager.cs (TypeManager.IsEqualGenericType): New public
11693         static method; see documentation in the method.
11694         (TypeManager.IsSubclassOrNestedChild): Allow IsEqualGenericType().
11695
11696         * convert.cs (Convert.ImplicitReferenceConversion,
11697         Convert.ImplicitReferenceConversionExists): Add support for
11698         generic type declarations; see gen-36.cs.
11699
11700 2003-12-19  Martin Baulig  <martin@ximian.com>
11701
11702         * pending.cs (Pending.InterfaceMethod): Use
11703         `Type.IsAssignableFrom()' instead of `=='.
11704
11705 2003-12-18  Martin Baulig  <martin@ximian.com>
11706
11707         * decl.cs (DeclSpace.AsAccessible): Check for array, pointer and
11708         byref types first.
11709
11710         * convert.cs (Convert.ImplicitStandardConversionExists): Use
11711         `expr_type.Equals (target_type)' instead of `=='.
11712
11713 2003-12-08  Martin Baulig  <martin@ximian.com>
11714
11715         * generics.cs (Constraints.Types): Removed.
11716         (Constraints.Resolve): Just resolve everything to TypeExpr's, not
11717         to Type's.
11718         (Constraints.ResolveTypes): New public method; resolves the
11719         TypeExpr's to Type's.
11720         (TypeParameter.Define): TypeBuilder.DefineGenericParameter() no
11721         longer takes the constraints.
11722         (TypeParameter.DefineMethod): Likewise.
11723         (TypeParameter.DefineType): New public method.  Calls
11724         `TypeBuilder/MethodBuilder.SetGenericParameterConstraints()' to set
11725         the constraints.
11726
11727 2003-12-08  Martin Baulig  <martin@ximian.com>
11728
11729         * convert.cs (Convert.ImplicitConversionStandard): Use
11730         `expr_type.Equals (target_type)' instead of `=='.
11731
11732 2003-12-08  Martin Baulig  <martin@ximian.com>
11733
11734         * typemanager.cs (TypeManager.GetReferenceType): Call
11735         `Type.MakeByRefType ()'.
11736
11737 2003-12-08  Martin Baulig  <martin@ximian.com>
11738
11739         * cs-parser.jay, cs-tokenizer.cs: `where' is not a keyword, it
11740         just has some special meaning in some situations.  For instance,
11741         it is allowed to use `where' as the name of a variable etc.
11742
11743 2003-12-04  Martin Baulig  <martin@ximian.com>
11744
11745         * expression.cs (ComposedCast.DoResolveAsTypeStep): Use
11746         `Type.MakeArrayType()' for array types.
11747
11748 2003-11-18  Miguel de Icaza  <miguel@ximian.com>
11749
11750         * expression.cs (Invocation.VerifyArgumentsCompat): Remove
11751         debugging message.
11752
11753         (SizeOf.DoResolve): assign the `type_queried' field.  This gets
11754         corlib to compile.
11755
11756 2003-11-16  Martin Baulig  <martin@ximian.com>
11757
11758         * codegen.cs (EmitContext.IsGeneric): Removed.
11759
11760         * ecore.cs (SimpleName.ResolveAsTypeStep): Always call
11761         ResolveGeneric() on the DeclSpace.
11762
11763 2003-11-16  Martin Baulig  <martin@ximian.com>
11764
11765         * generic.cs (TypeArguments.Resolve):
11766         `Expression.ResolveAsTypeTerminal()' returns a TypeExpr; call
11767         `ResolveType()' on it to get the Type.
11768
11769 2003-11-15  Martin Baulig  <martin@ximian.com>
11770
11771         * generic.cs (ConstructedType.GetInterfaces): Override this.
11772
11773 2003-11-14  Martin Baulig  <martin@ximian.com>
11774
11775         * interface.cs (Interface.DefineType): Define all type parameters
11776         before adding the interfaces we inherit.
11777
11778 2003-11-11  Martin Baulig  <martin@ximian.com>
11779
11780         * generic.cs (ConstructedType.ResolveType): Always call
11781         `gt.BindGenericParameters (atypes)'; also if `args.HasTypeArguments'.
11782
11783 2003-11-10  Martin Baulig  <martin@ximian.com>
11784
11785         * typemanager.cs (TypeManager.ResolveExpressionTypes): Removed.
11786         (TypeManager.InitCoreTypes): Initialize them here, but instead of
11787         calling `ResolveType()' on them, directly assign their `Type'.
11788
11789 2003-11-08  Martin Baulig  <martin@ximian.com>
11790
11791         * generic.cs (ConstructedType): Override `IsClass' etc.
11792
11793 2003-11-08  Martin Baulig  <martin@ximian.com>
11794
11795         * class.cs (TypeContainer.GetClassBases): Use TypeExpr's for the
11796         return value and the `out parent' parameter.
11797         (TypeContainer.DefineType): Moved the CS0644 check into
11798         GetClassBases().  Don't pass the interface types to the
11799         `builder.DefineType()'/`builder.DefineNestedType()', but resolve
11800         them later and then call `TypeBuilder.AddInterfaceImplementation()'.
11801
11802         * ecore.cs (TypeExpr.IsAttribute): New property.
11803         (TypeExpr.GetInterfaces): New method.
11804
11805         * interface.cs (Interface.GetInterfaceTypeByName): Return a
11806         TypeExpr instead of a Type.
11807         (Interface.GetInterfaceBases): Return TypeExpr's instead of Type's.
11808         (Interface.DefineType): Don't pass the interface types to the
11809         `builder.Definetype()'/`builder.DefineNestedType()', but resolve
11810         them later and then call `TypeBulider.AddInterfaceImplementation()'.
11811
11812         * typemanager.cs (TypeManager.AddUserType): Take a `TypeExpr[]'
11813         instead of a `Type[]'.
11814         (TypeManager.RegisterBuilder): Likewise.
11815         (TypeManager.AddUserInterface): Likewise.
11816         (TypeManager.ExpandInterfaces): Take a `Type[]' instead of a
11817         `Type[]' and also return a `TypeExpr[]'.
11818         (TypeManager.GetInterfaces): Return a `TypeExpr[]'.
11819
11820 2003-11-08  Martin Baulig  <martin@ximian.com>
11821
11822         * decl.cs (DeclSpace.ResolveTypeExpr): Return a TypeExpr, not an
11823         Expression.     
11824
11825 2003-11-08  Martin Baulig  <martin@ximian.com>
11826
11827         * decl.cs (DeclSpace.GetTypeResolveEmitContext): Call
11828         TypeManager.ResolveExpressionTypes().
11829
11830         * ecore.cs (Expression.ResolveAsTypeTerminal): Return a TypeExpr
11831         instead of an Expression.
11832         (TypeExpr): This is now an abstract base class for `TypeExpression'.
11833         (TypeExpression): New public class; formerly known as `TypeExpr'.
11834
11835         * expression.cs (ComposedCast): Derive from TypeExpr.
11836
11837         * typemanager.cs (TypeManager.system_*_expr): These are now
11838         TypExpr's instead of Expression's.
11839         (TypeManager.ResolveExpressionTypes): New public static function;
11840         called from DeclSpace.GetTypeResolveEmitContext() to resolve all
11841         of them.        
11842
11843 2003-11-06  Miguel de Icaza  <miguel@ximian.com>
11844
11845         * expression.cs (New.DoResolve): Do not dereference value that
11846         might be a null return.
11847
11848         * statement.cs (Block.EmitMeta): Use the Const.ChangeType to make
11849         sure that the constant value has the right type.  Fixes an
11850         unreported bug, similar to 50425.
11851
11852         * const.cs (Const.LookupConstantValue): Call
11853         ImplicitStandardConversionExists before doing a conversion to
11854         avoid havng the TypeManager.ChangeType do conversions.
11855
11856         Reduced the number of casts used
11857
11858         (Const.ChangeType): New routine to enable reuse of the constant
11859         type changing code from statement.
11860
11861         * typemanager.cs (ChangeType): Move common initialization to
11862         static global variables.
11863
11864         Fixes #50425.
11865
11866         * convert.cs (ImplicitReferenceConversion): Somehow we allowed
11867         every value type to go through, even if it was void.  Fix that. 
11868
11869         * cs-tokenizer.cs: Use is_identifier_start_character on the start
11870         character of the define, and the is_identifier_part_character for
11871         the rest of the string.
11872
11873 2003-11-05  Miguel de Icaza  <miguel@ximian.com>
11874
11875         * expression.cs (UnaryMutator.EmitCode): When I updated
11876         LocalVariableReference.DoResolve, I overdid it, and dropped an
11877         optimization done on local variable references.
11878
11879 2003-11-04  Miguel de Icaza  <miguel@ximian.com>
11880
11881         * ecore.cs: Convert the return from Ldlen into an int.
11882
11883 2003-10-20  Miguel de Icaza  <miguel@ximian.com>
11884
11885         * decl.cs (DeclSpace.GetAccessLevel): Handle NotPublic case for
11886         the accessibility, this is a special case for toplevel non-public
11887         classes (internal for instance).
11888
11889 2003-10-20  Nick Drochak <ndrochak@gol.com>
11890
11891         * ecore.cs: Fix typo and build.  Needed another right paren.
11892
11893 2003-10-19  Miguel de Icaza  <miguel@ximian.com>
11894
11895         * ecore.cs: Applied fix from Ben Maurer.   We were handling in the
11896         `internal' case regular and protected, but not allowing protected
11897         to be evaluated later.  Bug 49840
11898
11899 2003-10-15  Miguel de Icaza  <miguel@ximian.com>
11900
11901         * statement.cs (Switch.TableSwitchEmit): Compare the upper bound
11902         to kb.Nlast, and not the kb.nFirst to isolate the switch
11903         statement.
11904
11905         Extract the underlying type, so enumerations of long/ulong are
11906         treated like long/ulong.
11907
11908 2003-10-14  Miguel de Icaza  <miguel@ximian.com>
11909
11910         * expression.cs (New): Overload the meaning of RequestedType to
11911         track the possible creation of the NewDelegate type, since
11912         DoResolve is invoked more than once for new constructors on field
11913         initialization.
11914
11915         See bugs: #48800 and #37014
11916
11917         * cs-parser.jay (declare_local_constants): Take an arraylist
11918         instead of a single constant.
11919
11920         (local_constant_declaration): It should take a
11921         constant_declarators, not a constant_declarator.  Fixes 49487
11922
11923         * convert.cs: Fix error report.
11924
11925 2003-10-13 Jackson Harper <jackson@ximian.com>
11926
11927         * typemanager.cs (TypeToCoreType): Add float and double this fixes
11928         bug #49611
11929         
11930 2003-11-03  Martin Baulig  <martin@ximian.com>
11931
11932         * expression.cs (ArrayAccess.GetStoreOpcode): Added
11933         `out bool has_type_arg'; if set, we need to pass the type to
11934         ig.Emit().
11935         (ArrayAccess.GetStoreOpcode, ArrayAccess.EmitLoadOpcode): Use
11936         Stelem_Any/Ldelem_Any for generic parameters.   
11937
11938 2003-11-02  Martin Baulig  <martin@ximian.com>
11939
11940         * expression.cs (Invocation.EmitCall): Use
11941         `TypeManager.IsValueType()' to check whether it's a value type.
11942         Don't set `struct_call' when calling a method on a type parameter.
11943
11944 2003-11-02  Martin Baulig  <martin@ximian.com>
11945
11946         * generics.cs (ConstructedType.Resolve): Renamed to ResolveType()
11947         and removed the TypeBuilder argument.
11948
11949         * typemanager.cs (TypeManager.IsValueType): Return
11950         `t.IsGenericParameter || t.IsValueType'.
11951
11952 2003-10-25  Martin Baulig  <martin@ximian.com>
11953
11954         * decl.cs (DeclSpace.ResolveType): If we're a ConstructedType,
11955         call ConstructedType.Resolve() on it.
11956
11957         * generic.cs (ConstructedType.Resolve): Set `type' on success.
11958
11959 2003-10-25  Martin Baulig  <martin@ximian.com>
11960
11961         * class.cs (TypeContainer.GetClassBases): Changed
11962         `out Type parent' into `out TypeExpr parent'.  Moved CS0644 and
11963         CS8214 reporting here.
11964         (TypeContainer.DefineType): GetClassBases() gives us a `TypeExpr'
11965         instead of a `Type' for our parent.  In case of a recursive
11966         declaration (see tests/gen-23.cs for an example), our parent is a
11967         ConstructedType and it doesn't have its type set.  So, first
11968         create our own TypeBuilder, then call constructed.Resolve() to get
11969         the parent's type and finally TypeBuilder.SetParent() it.
11970
11971         * ecore.cs (TypeExpr.Name): New public virtual property.
11972
11973         * generic.cs
11974         (ConstructedType): We're now a TypeExpr and not just an Expression.
11975         (ConstructedType.ResolveAsTypeStep): Don't resolve our type
11976         arguments here; this is done later.
11977         (ConstructedType.Resolve): New public method to resolve the type
11978         arguments and bind them.
11979
11980 2003-10-21  Martin Baulig  <martin@ximian.com>
11981
11982         * convert.cs: Use `TypeManager.IsValueType' instead of
11983         'type.IsValueType' everywhere.
11984
11985         * typemanager.cs (TypeManager.IsValueType): Return true for type
11986         parameters.  The reason for this is that we need to box a type
11987         parameter when converting it to a reference type.
11988
11989         * cs-parser.jay: Added support for default value expressions.
11990
11991         * generics.cs (DefaultValueExpression): New public class.       
11992
11993 2003-10-17  Martin Baulig  <martin@ximian.com>
11994
11995         * generic.cs (Constraints.Resolve): Take a DecpSpace instead of a
11996         TypeContainer so we can also use this for Interfaces.
11997         (TypeParameter.Resolve): Likewise.
11998
11999         * interface.cs (Interface.DefineType): Added support for generic
12000         interfaces.
12001
12002         * cs-parser.jay: Added support for generic structs and interfaces.
12003
12004 2003-10-17  Martin Baulig  <martin@ximian.com>
12005
12006         * generic.cs (GenericMemberAccess.DoResolve): We can now actually
12007         call generic methods :-)
12008
12009 2003-10-16  Martin Baulig  <martin@ximian.com>
12010
12011         * cs-parser.jay (namespace_or_type_name): Only create a
12012         GenericMemberAccess if we actually have type arguments.
12013
12014 2003-10-13  Martin Baulig  <martin@ximian.com>
12015
12016         * class.cs (Method.Define): If we're a generic method, call
12017         TypeBuilder.DefineGenericMethod () before resolving
12018         the parameters.
12019         (MethodData): Added .ctor which takes an additional MethodBuilder
12020         argument; this is used for generic methods.
12021         (MethodData.Define): Call `builder.SetGenericMethodSignature()' if
12022         we already have a MethodBuilder.
12023
12024 2003-10-10  Martin Baulig  <martin@ximian.com>
12025
12026         * class.cs (Method): Added .ctor which takes a `GenericMethod'
12027         instead of a `DeclSpace'.  This is used for generic methods.
12028
12029         * cs-parser.jay (method_header): Added support for generic
12030         methods; create a `GenericMethod' instance and pass it to the
12031         `Method's .ctor; it'll be used as the `DeclSpace' to lookup
12032         parameters and locals.
12033
12034         * decl.cs (DeclSpace.SetParameterInfo): Removed Location argument
12035         since we already have the location.  Check whether we're a generic
12036         type declaration or a generic method and create the correct type
12037         parameter.
12038
12039         * generic.cs (TypeParameter.DefineMethod): New public method.
12040         (GenericMethod): New public class; derives from DeclSpace and is
12041         used for generic methods.       
12042
12043 2003-10-09  Martin Baulig  <martin@ximian.com>
12044
12045         * class.cs (MethodCore): Added additional `DeclSpace ds' argument
12046         to the .ctor.
12047         (MethodCore.DoDefineParameters): Removed the TypeContainer
12048         argument; use the DeclSpace which was passed to the .ctor instead.
12049         (MethodCore.CheckParameter): Take a DeclSpace instead of a
12050         TypeContainer; we only need a DeclSpace here.
12051
12052 2003-10-09  Martin Baulig  <martin@ximian.com>
12053
12054         * class.cs (MethodData): Added additional `DeclSpace ds' argument
12055         to the .ctor.
12056         (MethodData.Define, MethodData.Emit): Pass the `ds' to the
12057         EmitContext's .ctor.    
12058
12059 2003-10-09  Martin Baulig  <martin@ximian.com>
12060
12061         * decl.cs (DeclSpace.AsAccessible): Moved here from TypeContainer.
12062         (AccessLevel, CheckAccessLevel, GetAccessLevel): They're used by
12063         AsAccessible(), moved them as well.
12064
12065         * class.cs (TypeContainer.AsAccessible): Moved to DeclSpace.
12066
12067 2003-10-07  Miguel de Icaza  <miguel@ximian.com>
12068
12069         * expression.cs (Binary.Emit.GreatherThanOrEqual): Fix the code
12070         generation for >=, as spotted by Paolo, bug 48679.  
12071         Patch from David Waite.
12072
12073         * cs-tokenizer.cs: Add handling for #pragma.
12074
12075         * cs-parser.jay: Allow for both yield and yield return in the
12076         syntax.  The anti-cobolization of C# fight will go on!
12077
12078         * class.cs (TypeBuilder.DefineType): Catch error condition here
12079         (Parent.DefineType erroring out and returning null).
12080
12081         * expression.cs (ArrayCreation.EmitDynamicInitializers): When
12082         coping with enumerations variables, we were mistakenly processing
12083         them as a regular value type instead of built-in types.  Fixes the
12084         bug #48063
12085
12086         * typemanager.cs (IsBuiltinOrEnum): New method.
12087
12088 2003-09-30  Miguel de Icaza  <miguel@ximian.com>
12089
12090         * cs-parser.jay: Upgrade: yield now needs the return clause.
12091
12092 2003-10-08  Atsushi Enomoto <ginga@kit.hi-ho.ne.jp>
12093
12094         * cs-parser.jay : Renamed yyName to yyNames related to jay.
12095
12096 2003-09-29  Martin Baulig  <martin@ximian.com>
12097
12098         * typemanager.cs (TypeManager.GetMethodFlags): Added support for
12099         inflated generic methods.
12100
12101         * generics.cs (ConstructedType): Distinguish between open and
12102         closed constructed types; correctly resolve the arguments.
12103
12104 2003-09-22  Martin Baulig  <martin@ximian.com>
12105
12106         * generic.cs (ConstructedType.ResolveAsTypeCheck): Check whether
12107         all type arguments meet their constraints.
12108
12109 2003-09-19  Martin Baulig  <martin@ximian.com>
12110
12111         * decl.cs (MemberCache.SetupCacheForInterface): Take a
12112         `MemberCache parent' argument.  Normally, an interface doesn't
12113         have a parent type except System.Object, but we use this in gmcs
12114         for generic type parameters.
12115
12116 2003-09-18  Martin Baulig  <martin@ximian.com>
12117
12118         * typemanager.cs (TypeHandle.ctor): Set `IsInterface' solely based
12119         on `type.IsInterface'; don't check whether the type has a parent
12120         to determine whether it's an interface.
12121
12122 2003-09-17  Martin Baulig  <martin@ximian.com>
12123
12124         * generic.cs (ConstructedType.ToString): Always use `name' as the
12125         type name.
12126
12127 2003-09-15  Martin Baulig  <martin@ximian.com>
12128
12129         * cs-parser.jay: Fix grammar wrt. type_parameter_constraints.
12130
12131         * generic.cs (Constraints.Resolve): New public method; this is
12132         called to resolve the constraint types and to check whether all
12133         the constraints are correct.
12134         (Constraints.Types): New public property.
12135         (TypeParameter.Resolve): New public method; resolves all the
12136         type's constraints.
12137
12138         * class.cs (TypeContainer.DefineType): Call
12139         TypeParameter.Resolve() before actually defining the type.
12140
12141 2003-09-15  Martin Baulig  <martin@ximian.com>
12142
12143         * class.cs (TypeContainer.DefineType): Added an error flag to
12144         avoid reporting duplicate CS0146's ("class definition is
12145         circular.").
12146
12147         * driver.cs (Driver.MainDriver): Abort if
12148         RootContext.ResolveTree() reported any errors.
12149
12150 2003-09-07  Martin Baulig  <martin@ximian.com>
12151
12152         * report.cs (Error, Warning): Added overloaded versions which take
12153         a `params object[] args' and call String.Format().
12154
12155 2003-09-07  Martin Baulig  <martin@ximian.com>
12156
12157         * decl.cs (DeclSpace..ctor): Don't call
12158         NamespaceEntry.DefineName() here; do it in RecordDecl() which is
12159         called from Tree.RecordDecl().  Fixes the CS0101 reporting.
12160         (DeclSpace.RecordDecl): New method.
12161
12162         * tree.cs (Tree.RecordDecl): Call ds.RecordDecl().
12163
12164 2003-09-02  Ravi Pratap  <ravi@ximian.com>
12165
12166         * attribute.cs (CheckAttributeTarget): Ensure that we allow return
12167         value attributes to be applied to ParameterBuilders.
12168
12169         * class.cs (MethodCore.LabelParameters): Make static and more
12170         generic so that it can be used from other places - like interface
12171         methods, for instance.
12172
12173         * interface.cs (Interface.Emit): Call LabelParameters before
12174         emitting attributes on the InterfaceMethod.
12175
12176 2003-09-07  Martin Baulig  <martin@ximian.com>
12177
12178         * generic.cs (ConstructedType.ResolveAsTypeStep): Report a CS8217
12179         if the number of type parameters doesn't match.
12180
12181 2003-09-04  Martin Baulig  <martin@ximian.com>
12182
12183         * expression.cs (ComposedCast.ResolveAsTypeStep): Added support
12184         for arrays of generic type params (ie. `!0[]').
12185
12186 2003-09-04  Martin Baulig  <martin@ximian.com>
12187
12188         * class.cs (TypeContainer.AsAccessible): Ignore generic parameters
12189         for the moment.
12190
12191 2003-09-04  Martin Baulig  <martin@ximian.com>
12192
12193         * decl.cs (DeclSpace.LookupGeneric): New method.
12194         (DeclSpace.CheckAccessLevel): Ignore generic parameters for the
12195         moment.
12196
12197         * generic.cs (TypeParameterExpr): Take a TypeParameter as
12198         argument, not just a string.
12199         (TypeParameter.Define): New public method; this is called to
12200         actually define the generic parameter; after this, you can use the
12201         new `Type' property to get the type.
12202
12203 2003-09-04  Martin Baulig  <martin@ximian.com>
12204
12205         * decl.cs (DeclSpace.SetParameterInfo): The `constraints' argument
12206         is now an ArrayList; initialize the result of the `TypeParameters'
12207         property here.
12208         (DeclSpace.GetGenericData): Removed.
12209         (DeclSpace.LookupGeneric): Temporarily removed; we need to
12210         implement this in a different way.
12211         (DeclSpace.GetTypeParameters): Removed; there's now a
12212         `TypeParameters' property.
12213         (DeclSpace.TypeParameters): New public property.
12214
12215         * generic.cs (Constraints): Make this class public.
12216         (TypeParameter): New public class.
12217
12218 2003-09-04  Martin Baulig  <martin@ximian.com>
12219
12220         * decl.cs (DeclSpace.GetTypeParameters): New method to return the
12221         generic parameters.
12222
12223         * class.cs (TypeContainer.DefineType): Call
12224         TypeBuilder.DefineGenericParameter () on all generic parameters if
12225         this is a generic type.
12226
12227 2003-08-28  Martin Baulig  <martin@ximian.com>
12228
12229         * sample-stack.il: Compile this with ilasm: "ilasm /dll
12230         sample-stack.il".
12231
12232         * sample-hello.cs: Compile this with gmcs: "gmcs
12233         /r:sample-stack.dll sample-hello.cs".
12234
12235 2003-08-28  Martin Baulig  <martin@ximian.com>
12236
12237         * generic.cs (ConstructedType.ResolveAsTypeStep): Actually bind
12238         the parameters to the generic type.
12239
12240 2003-08-28  Martin Baulig  <martin@ximian.com>
12241
12242         * cs-tokenizer.cs (parse_less_than): Also allow all builtin types.
12243
12244 2003-08-28  Martin Baulig  <martin@ximian.com>
12245
12246         * cs-parser.jay (opt_type_argument_list): Use
12247         `OP_GENERICS_LT type_arguments OP_GENERICS_GT'.
12248         (primary_expression): Replace `qualified_identifier' with `type_name'.
12249         (type_parameter_list): Use `OP_GENERICS_LT type_parameters OP_GENERICS_GT'.
12250
12251         * cs-tokenizer.cs (is_punct): When reading a `<', invoke a custom
12252         parser to check whether it is syntactically a type parameter list;
12253         return OP_GENERICS_LT/OP_GENERICS_GT instead of OP_LT/OP_GT in
12254         this case.
12255
12256 2003-08-26  Martin Baulig  <martin@ximian.com>
12257
12258         * ecore.cs (SimpleName.SimpleNameResolve): Look for members before
12259         resolving aliases; fixes #47927.
12260
12261 2003-08-26  Martin Baulig  <martin@ximian.com>
12262
12263         * statement.cs (Using.DoResolve): This is internally emitting a
12264         try/finally clause, so we need to set ec.NeedExplicitReturn if we
12265         do not always return.  Fixes #47681.
12266
12267 2003-08-26  Martin Baulig  <martin@ximian.com>
12268
12269         * decl.cs (MemberCore): Moved WarningNotHiding(),
12270         Error_CannotChangeAccessModifiers() and CheckMethodAgainstBase()
12271         into MemberBase.
12272         (AdditionResult): Make this nested in DeclSpace.
12273         (DeclSpace.ctor): The .ctor now takes an additional NamespaceEntry
12274         argument; call NamespaceEntry.Define() unless we're nested in a
12275         class or struct.
12276
12277         * namespace.cs (Namespace.DefineName): New public function.  This
12278         is called from DeclSpace's .ctor to add 
12279         (Namespace.Lookup): Include DeclSpaces in the lookup.
12280
12281         * class.cs (Operator): Derive from MemberBase, not MemberCore.
12282
12283         * const.cs (Const): Derive from MemberBase, not MemberCore.     
12284
12285 2003-08-25  Martin Baulig  <martin@ximian.com>
12286
12287         * convert.cs (Convert.ExplicitReferenceConversion): When
12288         converting from an interface type to a class, unbox if the target
12289         type is a struct type.  Fixes #47822.
12290
12291 2003-08-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
12292
12293         * typemanager.cs: fixed the values of MethodFlags. Closes #47855 and
12294         #47854.
12295
12296 2003-08-22  Martin Baulig  <martin@ximian.com>
12297
12298         * class.cs (TypeManager.DefineType): When defining a nested type,
12299         call DefineType() on our parent; fixes #47801.
12300
12301 2003-08-22  Martin Baulig  <martin@ximian.com>
12302
12303         * class.cs (MethodData.Define): While checking if a method is an
12304         interface implementation, improve the test a bit more to fix #47654.
12305
12306 2003-08-22  Martin Baulig  <martin@ximian.com>
12307
12308         * expression.cs (Probe.DoResolve): Check whether `expr' resolved
12309         correctly; fixes #47722.
12310
12311 2003-08-22  Martin Baulig  <martin@ximian.com>
12312
12313         * expression.cs (UnaryMutator.ResolveVariable): If the target is a
12314         LocalVariableReference, ensure it's not read-only.  Fixes #47536.
12315
12316         * statement.cs (Fixed.DoResolve): Make all variables read-only. 
12317
12318 2003-08-22  Martin Baulig  <martin@ximian.com>
12319
12320         * ecore.cs (FieldExpr.DoResolveLValue): Static read-only fields
12321         can only be assigned in static constructors.  Fixes #47161.
12322
12323 2003-08-22  Martin Baulig  <martin@ximian.com>
12324
12325         Rewrote and improved the flow analysis code.
12326
12327         * flowbranching.cs (FlowBranching): Make this class abstract.
12328         (FlowBranching.CreateBranching): New static function to create a
12329         new flow branching.
12330         (FlowBranchingBlock, FlowBranchingException): New classes.
12331         (FlowBranching.UsageVector.Type): New public readonly field.
12332         (FlowBranching.UsageVector.Breaks): Removed the setter.
12333         (FlowBranching.UsageVector.Returns): Removed the setter.
12334         (FlowBranching.UsageVector): Added Break(), Return(),
12335         NeverReachable() and Throw() methods to modify the reachability.
12336         (FlowBranching.UsageVector.MergeChildren): Removed, this is now
12337         done by FlowBranching.Merge().
12338         (FlowBranching.UsageVector.MergeChild): New method; merges the
12339         merge result into the current vector.
12340         (FlowBranching.Merge): New abstract method to merge a branching.
12341
12342 2003-08-12  Martin Baulig  <martin@ximian.com>
12343
12344         * expression.cs (Indirection.CacheTemporaries): Create the
12345         LocalTemporary with the pointer type, not its element type.
12346
12347 2003-08-10  Miguel de Icaza  <miguel@ximian.com>
12348
12349         * cs-parser.jay: FIRST_KEYWORD, LAST_KEYWORD: used to know if a
12350         token was a keyword or not.
12351
12352         Add `error' options where an IDENTIFIER was expected;  Provide
12353         CheckToken and CheckIdentifierToken convenience error reporting
12354         functions. 
12355
12356         Do not use `DeclSpace.Namespace', use `DeclSpace.NamespaceEntry'.
12357
12358         * decl.cs: Rename `NamespaceEntry Namespace' public field into
12359         NameSpaceEntry NameSpaceEntry.
12360
12361         (LookupInterfaceOrClass): Avoid creating a full qualified name
12362         from namespace and name: avoid doing lookups when we know the
12363         namespace is non-existant.   Use new Tree.LookupByNamespace which
12364         looks up DeclSpaces based on their namespace, name pair.
12365
12366         * driver.cs: Provide a new `parser verbose' to display the
12367         exception thrown during parsing.  This is turned off by default
12368         now, so the output of a failure from mcs is more graceful.
12369
12370         * namespace.cs: Track all the namespaces defined in a hashtable
12371         for quick lookup.
12372
12373         (IsNamespace): New method
12374
12375 2003-08-09  Miguel de Icaza  <miguel@ximian.com>
12376
12377         * namespace.cs: Remove redundant call;  Avoid using MakeFQN when
12378         we know that we need to concatenate (full typename can never be
12379         null). 
12380
12381         * class.cs: ditto.
12382
12383         * statement.cs: Use a bitfield;  Do not initialize to null things
12384         which are done by the constructor by default.
12385
12386         * cs-parser.jay: bug fix, parameter was 4, not 3.
12387
12388         * expression.cs: Just use the property;
12389
12390         * statement.cs: No need for GetVariableInfo method.
12391
12392 2003-08-08  Martin Baulig  <martin@ximian.com>
12393
12394         * flowanalysis.cs (FlowReturns): This is now nested in the
12395         `FlowBranching' class.
12396         (MyBitVector): Moved this here from statement.cs.
12397         (FlowBranching.SiblingType): New enum type.
12398         (FlowBranching.CreateSibling): Added `SiblingType' argument.
12399
12400 2003-08-07  Martin Baulig  <martin@ximian.com>
12401
12402         * flowanalysis.cs (FlowBranchingType): This is now nested in the
12403         `FlowBranching' class and called `BranchingType'.
12404
12405 2003-08-07  Martin Baulig  <martin@ximian.com>
12406
12407         * flowanalysis.cs: Moved all the control flow analysis code into
12408         its own file.
12409
12410 2003-08-07  Martin Baulig  <martin@ximian.com>
12411
12412         * assign.cs (Assign.DoResolve): `target' must either be an
12413         IAssignMethod or an EventAccess; report a CS0131 otherwise.  Fixes
12414         #37319.
12415
12416 2003-08-07  Miguel de Icaza  <miguel@ximian.com>
12417
12418         * expression.cs (BinaryMethod): This kind of expression is created by the
12419         Binary class if it determines that the operator has to be handled
12420         by a method.
12421
12422         (BinaryDelegate): This kind of expression is created if we are
12423         dealing with a + or - operator on delegates.
12424
12425         (Binary): remove method, argumetns, and DelegateOperator: when
12426         dealing with methods, 
12427
12428         * ecore.cs (EventExpr.EmitAddOrRemove): Update to new layout.
12429
12430         * statement.cs (Block): use bitfields for the three extra booleans
12431         we had in use.   Remove unused topblock parameter.
12432
12433         * codegen.cs: Remove unecessary argument to Block.EmitTopBlock
12434
12435         * assign.cs: Drop extra unneeded tests.
12436
12437 2003-08-06  Miguel de Icaza  <miguel@ximian.com>
12438
12439         * iterators.cs (Mapvariable): provide a mechanism to use prefixes.
12440
12441         * statement.cs (Foreach): Use VariableStorage instead of
12442         LocalBuilders.   
12443
12444         * codegen.cs (VariableStorage): New class used by clients that
12445         require a variable stored: locals or fields for variables that
12446         need to live across yield.
12447
12448         Maybe provide a convenience api for EmitThis+EmitLoad?
12449
12450         (GetTemporaryLocal, FreeTemporaryLocal): Recycle
12451         these bad boys.
12452
12453 2003-08-05  Miguel de Icaza  <miguel@ximian.com>
12454
12455         * codegen.cs (RemapLocal, RemapLocalLValue, RemapParameter,
12456         RemapParameterLValue): New methods that are used to turn a
12457         precomputed FieldInfo into an expression like this:
12458
12459                 instance.FieldInfo
12460
12461         The idea is to use this instead of making LocalVariableReference
12462         have more than one meaning.
12463
12464         * cs-parser.jay: Add error production to BASE.
12465
12466         * ecore.cs: Deal with TypeManager.GetField returning null, which
12467         is now a valid return value.
12468
12469         (FieldExprNoAddress): New expression for Fields whose address can
12470         not be taken.
12471
12472         * expression.cs (LocalVariableReference): During the resolve
12473         phases, create new expressions if we are in a remapping context.
12474         Remove code that dealt with remapping here.
12475
12476         (ParameterReference): same.
12477
12478         (ProxyInstance): New expression, like the `This' expression, but
12479         it is born fully resolved.  We know what we are doing, so remove
12480         the errors that are targeted to user-provided uses of `this'.
12481
12482         * statement.cs (Foreach): our variable is now stored as an
12483         Expression;  During resolution, follow the protocol, dont just
12484         assume it will return this.
12485
12486 2003-08-06  Martin Baulig  <martin@ximian.com>
12487
12488         * support.cs (SeekableStreamReader.cs): New public class.
12489
12490         * cs-tokenizer.cs, cs-parser.jay, driver.cs: Use the new
12491         SeekableStreamReader instead of the normal StreamReader.
12492
12493 2003-08-04  Martin Baulig  <martin@ximian.com>
12494
12495         * cs-parser.jay (CLOSE_PARENS_CAST, CLOSE_PARENS_NO_CAST,
12496         CLOSE_PARENS_OPEN_PARENS, CLOSE_PARENS_MINUS): New tokens to
12497         deambiguate casts and delegate invocations.
12498         (parenthesized_expression): Use the new tokens to ensure this is
12499         not a cast of method invocation.
12500
12501         * cs-tokenizer.cs (is_punct): Return one of the new special tokens
12502         when reading a `)' and Deambiguate_CloseParens () was previously
12503         called.
12504
12505         * expression.cs (ParenthesizedExpression): New class.  This is
12506         just used for the CS0075 test.
12507         (Binary.DoResolve): Check for CS0075.   
12508
12509 2003-07-29  Ravi Pratap  <ravi@ximian.com>
12510
12511         * expression.cs (Invocation.MakeUnionSet): Patch from Lluis
12512         Sanchez : use TypeManager.ArrayContainsMethod instead of a direct
12513         reference comparison.
12514
12515         (TypeManager.ArrayContainsMethod): When we have a MethodInfo, also
12516         examine the ReturnType for equality - this is necessary in the
12517         cases of implicit and explicit operators whose signature also
12518         includes the return type.
12519
12520 2003-07-26  Miguel de Icaza  <miguel@ximian.com>
12521
12522         * namespace.cs: Cache the result of the namespace computation,
12523         instead of computing it every time.
12524
12525 2003-07-24  Miguel de Icaza  <miguel@ximian.com>
12526
12527         * decl.cs: Use a global arraylist that we reuse over invocations
12528         to avoid excesive memory consumption.  Reduces memory usage on an
12529         mcs compile by one meg (45 average).
12530
12531         * typemanager.cs (LookupTypeReflection): In .NET pointers are
12532         private, work around that.
12533
12534 2003-07-23  Miguel de Icaza  <miguel@ximian.com>
12535
12536         * literal.cs (IntLiteral): Define Zero and One static literals. 
12537
12538         * cs-parser.jay (integer_literal): use static literals to reduce
12539         memory usage for the most used literals (0, 1 and -1).  211kb
12540         reduced in memory usage.
12541
12542         Replace all calls to `new ArrayList' with `new
12543         ArrayList(4)' which is a good average number for most allocations,
12544         and also requires only 16 bytes of memory for its buffer by
12545         default. 
12546
12547         This reduced MCS memory usage in seven megabytes for the RSS after
12548         bootstrapping.
12549
12550 2003-07-28  Ravi Pratap  <ravi@ximian.com>
12551
12552         * expression.cs (Invocation.OverloadResolve): Fix the algorithm to
12553         handle params methods the correct way by forming only one
12554         applicable set with params and normal methods in them. Earlier we
12555         were looking at params methods only if we found no normal methods
12556         which was not the correct thing to do.
12557
12558         (Invocation.BetterFunction): Take separate arguments indicating
12559         when candidate and the best method are params methods in their
12560         expanded form.
12561
12562         This fixes bugs #43367 and #46199.
12563
12564         * attribute.cs: Documentation updates.
12565
12566         (CheckAttribute): Rename to CheckAttributeTarget.
12567         (GetValidPlaces): Rename to GetValidTargets.
12568
12569         * expression.cs (Invocation.IsParamsMethodApplicable): Fix trivial
12570         bug - use Convert.ImplicitConversion, not ImplicitUserConversion!
12571
12572         Fixes bug #44468.
12573
12574 2003-07-28  Miguel de Icaza  <miguel@ximian.com>
12575
12576         * codegen.cs: Compute IsGeneric correctly.
12577
12578         * cs-parser.jay: Introduce OP_GENERIC_LT for the grammar ambiguity
12579         resolution. 
12580
12581         Bring back (temporarily) OP_LEFT_SHIFT, OP_RIGHT_SHIFT,
12582         OP_SHIFT_RIGHT_ASSIGN, OP_SHIFT_LEFT_ASSIGN.  There were too many
12583         regressions, and I was chasing more bugs than I required.
12584
12585         * interface.cs: Use expressions for base type names (like classes
12586         and structs have been doing for a while now), and resolve that.
12587         This patch should probably go into head as well.
12588
12589         This makes it one less user of FindType.
12590
12591 2003-07-24  Miguel de Icaza  <miguel@ximian.com>
12592
12593         This compiler can not self host currently.  Need to fix that.
12594         
12595         * Makefile: compile to `gmcs.exe'
12596
12597         * driver.cs: Turn on v2 by default on gmcs.
12598
12599         * generic.cs (ConstructedType): Does no longer take a container
12600         type argument;  That will be taken care of later.
12601
12602         (ConstructedType.DoResolve, ConstructedType.ResolveAsTypeStep):
12603         Use SimpleName to resolve for now, so we can continue the work on
12604         the parser, until we get Type.GetType that understands generics.
12605
12606         (ConstructedType.ToString): Implement
12607
12608         (TypeArguments.Resolve): Resolve the child expressions as types. 
12609         
12610         * cs-parser.jay: Rename interface_constraints to
12611         type_parameter_constraints
12612
12613         (namespace_or_type_name): Only use constructed types for the basic
12614         construction, we will deal with identifier<...> later.
12615
12616         (type/type_name): No longer call DecomposeQI, as
12617         namespace_or_type_name is always decoded now.
12618         
12619 2003-07-22  Ravi Pratap  <ravi@ximian.com>
12620
12621         * expression.cs (Invocation.OverloadResolve): Follow the spec more
12622         closely: we eliminate methods in base types when we have an
12623         applicable method in a top-level type.
12624
12625         Please see section 14.5.5.1 for an exact description of what goes
12626         on. 
12627
12628         This fixes bug #45127 and a host of other related to corlib compilation.
12629
12630         * ecore.cs (MethodGroupExpr.DeclaringType): The element in the
12631         array is the method corresponding to the top-level type (this is
12632         because of the changes made to icall.c) so we change this
12633         accordingly.
12634
12635         (MethodGroupExpr.Name): This too.
12636
12637         * typemanager.cs (GetElementType): New method which does the right
12638         thing when compiling corlib. 
12639
12640         * everywhere: Make use of the above in the relevant places.
12641
12642 2003-07-22  Martin Baulig  <martin@ximian.com>
12643
12644         * cs-parser.jay (invocation_expression): Moved
12645         `OPEN_PARENS expression CLOSE_PARENS unary_expression' here from
12646         `cast_expression', but create a InvocationOrCast which later
12647         resolves to either an Invocation or a Cast.
12648
12649         * ecore.cs (ExpressionStatement.ResolveStatement): New virtual
12650         method; call this before EmitStatement() to make sure that this
12651         expression can be used as a statement.
12652
12653         * expression.cs (InvocationOrCast): New class; resolves to either
12654         an Invocation or a Cast.
12655
12656         * statement.cs (StatementExpression): Call ResolveStatement() on
12657         the ExpressionStatement before emitting it.
12658
12659 2003-07-21  Martin Baulig  <martin@ximian.com>
12660
12661         * expression.cs (Invocation.VerifyArgumentsCompat): Check whether
12662         `ref' and `out' attributes match; fixes #46220.
12663         (MemberAccess.ResolveMemberAccess): You can't reference a type
12664         through an expression; fixes #33180.
12665         (Indexers.GetIndexersForType): Don't return the indexers from
12666         interfaces the class implements; fixes #46502.
12667
12668 2003-07-21  Martin Baulig  <martin@ximian.com>
12669
12670         * class.cs (TypeContainer.CheckPairedOperators): Added CS0660 and
12671         CS0661 checks; fixes bug #30442.
12672
12673 2003-07-21  Martin Baulig  <martin@ximian.com>
12674
12675         * decl.cs (AdditionResult): Added `Error'.
12676
12677         * enum.cs (AddEnumMember): Report a CS0076 if name is `value__'.
12678
12679         * typemanager.cs (TypeManager.ChangeType): Catch exceptions; makes
12680         cs0031.cs actually work.
12681
12682  2003-07-20  Miguel de Icaza  <miguel@ximian.com>
12683  
12684         * cs-parser.jay (namespace_name): do not use
12685         namespace_or_type_name, use qualified_identifier, because
12686         namespace_or_type_name will soon return a composed expression
12687         instead of a string.
12688  
12689         (namespace_or_type_name): Instead of returning a string, now this
12690         production returns an expression.
12691  
12692         * codegen.cs (EmitContext): Setup IsGeneric property based on
12693         whether our DeclSpace is generic, our the method is generic.
12694  
12695         * modifier.cs (Modifiers.METHOD_GENERIC): New definition, use if
12696         the method is generic.
12697  
12698         * cs-parser.jay (type_arguments, opt_type_argument_list,
12699         type_parameters, type_parameter_list, opt_type_parameter_list,
12700         type_parameter,, opt_type_parameter_constraints_clauses,
12701         type_parameter_constraints_clauses,
12702         type_parameter_constraint_clause, type_parameter_constraint,
12703         interface_constraints): Add new production
12704  
12705         * decl.cs (DeclSpace): IsGeneric, flag to track whether this
12706         DeclSpace is generic or not.
12707  
12708         (DeclSpace.SetParameterInfo): New routine, used to set the
12709         parameter info for a type.
12710  
12711         (DeclSpace.LookupGeneric): Lookups a name, and if it is a generic,
12712         returns a GenericTypeExpr
12713  
12714         * ecore.cs (SimpleName.ResolveAsTypeStep): If our container is
12715         generic, lookup the generic argument.
12716  
12717         * attribute.cs: Do not allow TypeParameterExpressions in
12718         Attributes.
12719  
12720         * class.cs: Do not allow the Main method to be defined in a
12721         Generic container.
12722  
12723         * expression.cs (SizeOf): Do not allow generic types to be used as
12724         arguments to sizeof.
12725  
12726         * typemanager.cs (IsGeneric): Wrapper for Reflection when we have
12727         it: whether a type is generic or not.  Only works for types we are
12728         currently building for now.
12729         
12730 2003-07-20  Martin Baulig  <martin@ximian.com>
12731
12732         * namespace.cs: Fixed that bug which caused a crash when compiling
12733         the debugger's GUI.
12734
12735 2003-07-20  Miguel de Icaza  <miguel@ximian.com>
12736
12737         * typemanager.cs (LookupTypeReflection): Never expose types which
12738         are NotPublic, NestedPrivate, NestedAssembly, or
12739         NestedFamANDAssem.  We used to return these, and later do a check
12740         that would report a meaningful error, but the problem is that we
12741         would not get the real match, if there was a name override.
12742
12743 2003-07-18  Miguel de Icaza  <miguel@ximian.com>
12744
12745         * namespace.cs (Namespace, Name): Do not compute the namespace
12746         name dynamically, compute it in the constructor.  This reduced
12747         memory usage by 1697 KB.
12748
12749         * driver.cs: Use --pause to pause at the end.
12750
12751 2003-07-17  Peter Williams  <peter@newton.cx>
12752
12753         * Makefile: Change the name of the test target so that it doesn't
12754         conflict with the recursive test target.
12755
12756 2003-07-17  Miguel de Icaza  <miguel@ximian.com>
12757
12758         * expression.cs (LocalVariableReference.Emit, EmitAssign,
12759         AddressOf): Do not use EmitThis, that was wrong, use the actual
12760         this pointer.
12761
12762 2003-07-15  Miguel de Icaza  <miguel@ximian.com>
12763
12764         * class.cs (MethodData.Define): While checking if a method is an
12765         interface implementation, improve the test: If we are not public
12766         (use new test here: use the computed MethodAttributes directly,
12767         instead of the parsed modifier flags) check if the `implementing'
12768         method comes from an interface or not.
12769
12770         * pending.cs (VerifyPendingMethods): Slightly better error
12771         message.
12772
12773         * makefile: add test target that does the mcs bootstrap.
12774
12775 2003-07-16  Ravi Pratap  <ravi@ximian.com>
12776
12777         * interface.cs (Define): Do nothing here since there are no
12778         members to populate etc. Move the attribute emission out of here
12779         since this was just totally the wrong place to put it. Attribute
12780         application happens during the 'Emit' phase, not in the 'Define'
12781         phase.
12782
12783         (Emit): Add this method and move the attribute emission here
12784
12785         * rootcontext.cs (EmitCode): Call the Emit method on interface
12786         types too.
12787
12788 2003-07-14  Ravi Pratap M  <ravi@ximian.com>
12789
12790         * expression.cs (OverloadResolve): Report error only if Location
12791         is not 'Null' which means that there was a probe going on.
12792
12793 2003-07-14  Martin Baulig  <martin@ximian.com>
12794
12795         * expression.cs (ConditionalLogicalOperator): New public class to
12796         implement user defined conditional logical operators.
12797         This is section 14.11.2 in the spec and bug #40505.
12798
12799 2003-07-14  Martin Baulig  <martin@ximian.com>
12800
12801         * ecore.cs (FieldExpr.DoResolveLValue): Fixed bug #46198.
12802
12803 2003-07-14  Martin Baulig  <martin@ximian.com>
12804
12805         * codegen.cs (EmitContext.InFixedInitializer): New public field.
12806
12807         * ecore.cs (IVariable.VerifyFixed): New interface method.
12808
12809         * expression.cs (Unary.ResolveOperator): When resolving the `&'
12810         operator, check whether the variable is actually fixed.  Fixes bug
12811         #36055.  Set a variable definitely assigned when taking its
12812         address as required by the spec.
12813
12814         * statement.cs (LocalInfo.IsFixed): New field.
12815         (LocalInfo.MakePinned): Set `IsFixed' to true.
12816
12817 2003-07-14  Ravi Pratap M  <ravi@ximian.com>
12818
12819         * attribute.cs (Attribute.Resolve): While doing a Member lookup
12820         for .ctors, ensure that we only ask for members declared in the
12821         attribute type (BindingFlags.DeclaredOnly).
12822
12823         Fixes bug #43632.
12824
12825         * expression.cs (Error_WrongNumArguments): Report error 1501
12826         correctly the way CSC does.
12827
12828 2003-07-13  Martin Baulig  <martin@ximian.com>
12829
12830         * expression.cs (MemberAccess.ResolveAsTypeStep): Try to do a type
12831         lookup on the fully qualified name, to make things like "X.X" work
12832         where "X.X" is a fully qualified type name, but we also have a
12833         namespace "X" in the using list.  Fixes #41975.
12834
12835 2003-07-13  Martin Baulig  <martin@ximian.com>
12836
12837         * assign.cs (Assign.GetEmbeddedAssign): New protected virtual
12838         function. If we're a CompoundAssign, we need to create an embedded
12839         CompoundAssign, not an embedded Assign.
12840         (Assign.DoResolve): Make this work for embedded CompoundAssign's.
12841         Fixes #45854.
12842
12843 2003-07-13  Martin Baulig  <martin@ximian.com>
12844
12845         * typemanager.cs (TypeManager.IsNestedChildOf): Make this actually
12846         work to fix bug #46088.
12847
12848 2003-07-13  Ravi Pratap <ravi@ximian.com>
12849
12850         * class.cs (Operator.Emit): Do not emit attributes here - it is
12851         taken care of by the Method class that we delegate too. This takes
12852         care of bug #45876.
12853
12854 2003-07-10  Martin Baulig  <martin@ximian.com>
12855
12856         * expression.cs (TypeOfVoid): New class.
12857         (TypeOf): Report a CS0673 if it's System.Void.  Fixes #42264.
12858
12859 2003-07-10  Martin Baulig  <martin@ximian.com>
12860
12861         * class.cs (MethodCore.DoDefineParameters): Added CS0225 check;
12862         bug #35957.
12863
12864 2003-07-10  Martin Baulig  <martin@ximian.com>
12865
12866         * rootcontext.cs (RootContext.NamespaceLookup): Take a DeclSpace,
12867         not a NamespaceEntry, so we can use DeclSpace.CheckAccessLevel().
12868
12869         * decl.cs (DeclSpace.FindType): Use DeclSpace.CheckAccessLevel().
12870
12871         * typemanager.cs (TypeManager.IsAccessibleFrom): Removed.
12872
12873 2003-07-10  Martin Baulig  <martin@ximian.com>
12874
12875         * expression.cs (ArrayCreation): Don't use a byte blob for arrays
12876         of decimal.  Fixes #42850.
12877
12878         NOTE: I also fixed the created byte blob, but this doesn't work on
12879         the MS runtime and csc never produces any byte blobs for decimal
12880         arrays.
12881
12882 2003-07-10  Martin Baulig  <martin@ximian.com>
12883
12884         * statement.cs (StructInfo.GetStructInfo): Catch deep cycles in
12885         structs; fixes #32068.
12886         (Block.AddChildVariableNames): Fixed #44302.
12887
12888 2003-07-07  Gonzalo Paniagua Javier <gonzalo@ximian.com>
12889
12890         * namespace.cs: fixed compilation with csc. It's bugzilla #44302.
12891
12892 2003-07-07  Miguel de Icaza  <miguel@ximian.com>
12893
12894         * attribute.cs: And this test is onger needed.
12895
12896 2003-07-08  Martin Baulig  <martin@ximian.com>
12897
12898         * rootcontext.cs (RootContext.NamespaceLookup): Ignore
12899         inaccessible types.  Fixes #36313.
12900
12901         * decl.cs (DeclSpace.FindType): Ignore inaccessible types.
12902
12903         * namespace.cs (NamespaceEntry): Create implicit entries for all
12904         namespaces; ie. if we have `namespace N1.N2.N3 { ... }', we create
12905         implicit entries for N1.N2 and N1.
12906
12907 2003-07-08  Martin Baulig  <martin@ximian.com>
12908
12909         Rewrote the handling of namespaces to fix a lot of the issues
12910         wrt. `using' aliases etc.
12911
12912         * namespace.cs (Namespace): Splitted this class into a
12913         per-assembly `Namespace' and a per-file `NamespaceEntry'.
12914
12915         * typemanager.cs (TypeManager.IsNamespace): Removed.
12916         (TypeManager.ComputeNamespaces): Only compute namespaces from
12917         loaded assemblies here, not the namespaces from the assembly we're
12918         currently compiling.
12919
12920 2003-07-08  Martin Baulig  <martin@ximian.com>
12921
12922         * rootcontext.cs, class.cs: Fixed the CS1530 reporting.
12923
12924 2003-07-07  Miguel de Icaza  <miguel@ximian.com>
12925
12926         * typemanager.cs: Reverted patch from Gonzalo, my previous patch
12927         already fixed it.  
12928
12929         I thought about the memory savings here, but LookupTypeReflection
12930         is used under already very constrained scenarios.  Compiling
12931         corlib or mcs only exposes one hit, so it would not really reduce
12932         any memory consumption.
12933
12934 2003-07-07  Gonzalo Paniagua Javier <gonzalo@ximian.com>
12935
12936         * typemanager.cs: fixes bug #45889 by only adding public types from
12937         other assemblies to the list of known types.
12938
12939 2003-07-07  Miguel de Icaza  <miguel@ximian.com>
12940
12941         * attribute.cs (Attribute.Resolve): Add call to CheckAccessLevel
12942         on the type we resolved.
12943
12944 2003-07-05  Martin Baulig  <martin@ximian.com>
12945
12946         * pending.cs (PendingImplementation.ParentImplements): Don't
12947         create the proxy if the parent is abstract.
12948
12949         * class.cs (TypeContainer.DefineIndexers): Process explicit
12950         interface implementations first.  Fixes #37714.
12951
12952 2003-07-04  Miguel de Icaza  <miguel@ximian.com>
12953
12954         * expression.cs (MemberAccess.ResolveMemberAccess): Events are
12955         defined recursively;  but since we modify the input parameters
12956         (left is set to `this' temporarily), we reset this value if the
12957         left_is_explicit is false, which gives the original semantics to
12958         the code.  
12959
12960         * literal.cs (NullPointer): new class used to represent a null
12961         literal in a pointer context.
12962
12963         * convert.cs (Convert.ImplicitReferenceConversion): Is the target
12964         type is a pointer, use a NullPointer object instead of a
12965         NullLiteral.   Closes 43687
12966
12967         (ExplicitConversion): Convert pointer values using
12968         the conv opcode to the proper type.
12969
12970         * ecore.cs (New): change ValueTypeVariable property into a method,
12971         that returns whether the valuetype is suitable for being used.
12972
12973         * expression.cs (Binary.DoNumericPromotions): Only return if we
12974         the int constant was a valid uint, and we can return both left and
12975         right as uints.  If not, we continue processing, to trigger the
12976         type conversion.  This fixes 39018.
12977
12978         * statement.cs (Block.EmitMeta): During constant resolution, set
12979         the CurrentBlock property on the emitcontext, so that we resolve
12980         constants propertly.
12981
12982 2003-07-02  Martin Baulig  <martin@ximian.com>
12983
12984         * codegen.cs (EmitContext.NeedExplicitReturn): New public variable.
12985         (EmitContext.EmitTopBlock): Emit an explicit return if it's set.
12986
12987         * statement.cs (Try.Resolve): Set ec.NeedExplicitReturn rather
12988         than emitting it here.
12989
12990         * statement.cs: Fixed some more flow analysis bugs.
12991
12992 2003-07-02  Martin Baulig  <martin@ximian.com>
12993
12994         * class.cs (MethodData.Define): When implementing interface
12995         methods, set Final unless we're Virtual.
12996
12997         * decl.cs (MemberCore.CheckMethodAgainstBase): Make the CS0506
12998         check work for interface methods.
12999
13000 2003-07-01  Martin Baulig  <martin@ximian.com>
13001
13002         * ecore.cs (EmitContext.This): Replaced this property with a
13003         GetThis() method which takes a Location argument.  This ensures
13004         that we get the correct error location for a CS0188.
13005
13006 2003-07-01  Miguel de Icaza  <miguel@ximian.com>
13007
13008         * ecore.cs: (Convert.ConvertIntLiteral): Add test for
13009         ImplicitStandardConversion.
13010
13011         * class.cs (TypeContainer.GetClassBases): Small bug fix for 45649.
13012
13013 2003-07-01  Zoltan Varga  <vargaz@freemail.hu>
13014
13015         * expression.cs (ResolveOperator): Fix Concat (string, string, string)
13016         optimization.
13017
13018 2003-06-30  Miguel de Icaza  <miguel@ximian.com>
13019
13020         * class.cs (Constructor.Define): Turn off initlocals for unsafe
13021         constructors.
13022
13023         (MethodData.Define): Turn off initlocals for unsafe methods.
13024
13025 2003-06-29  Miguel de Icaza  <miguel@ximian.com>
13026
13027         * decl.cs (DeclSpace.CheckAccessLevel): Make this routine
13028         complete;  Fixes #37521.
13029
13030         * delegate.cs: Use Modifiers.TypeAttr to compute the
13031         TypeAttributes, instead of rolling our own.  This makes the flags
13032         correct for the delegates.
13033
13034 2003-06-28  Miguel de Icaza  <miguel@ximian.com>
13035
13036         * class.cs (Constructor.Define): Set the private flag for static
13037         constructors as well.
13038
13039         * cs-parser.jay (statement_expression): Set the return value to
13040         null, to avoid a crash when we catch an error.
13041
13042 2003-06-24  Miguel de Icaza  <miguel@ximian.com>
13043
13044         * cs-parser.jay: Applied patch from Jackson that adds support for
13045         extern and unsafe modifiers to destructor declarations.
13046
13047         * expression.cs: Report error 21 if the user is trying to index a
13048         System.Array.
13049
13050         * driver.cs: Add an error message, suggested by the bug report.
13051
13052         * class.cs (TypeContainer.Emit): Only call EmitFieldInitializers
13053         if we do not have a ": this ()" constructor initializer.  Fixes 45149
13054
13055 2003-06-14  Miguel de Icaza  <miguel@ximian.com>
13056
13057         * namespace.cs: Add some information to reduce FAQs.
13058
13059 2003-06-13  Miguel de Icaza  <miguel@ximian.com>
13060
13061         * cfold.cs (BinaryFold): BitwiseAnd, BitwiseOr: handle other
13062         underlying enumeration types.  Fixes #43915.
13063
13064         * expression.cs: Treat ushort/short as legal values to be used in
13065         bitwise operations.
13066
13067 Wed Jun 4 13:19:04 CEST 2003 Paolo Molaro <lupus@ximian.com>
13068
13069         * delegate.cs: transfer custom attributes for paramenters from
13070         the delegate declaration to Invoke and BeginInvoke.
13071
13072 Tue Jun 3 11:11:08 CEST 2003 Paolo Molaro <lupus@ximian.com>
13073
13074         * attribute.cs: handle custom marshalers and emit marshal info
13075         for fields, too.
13076
13077 2003-05-28  Hector E. Gomez Morales  <hgomez_36@flashmail.com>
13078
13079         * makefile.gnu: Added anonymous.cs to the compiler sources.
13080
13081 2003-05-28  Miguel de Icaza  <miguel@ximian.com>
13082
13083         * iterators.cs: Change the name of the proxy class to include two
13084         underscores.
13085
13086         * cs-parser.jay: Update grammar to include anonymous methods.
13087
13088         * anonymous.cs: new file.
13089
13090 2003-05-27  Miguel de Icaza  <miguel@ximian.com>
13091
13092         * class.cs (Field.Define): Add missing test for pointers and
13093         safety. 
13094
13095 2003-05-27  Ravi Pratap  <ravi@ximian.com>
13096
13097         * expression.cs (ArrayAccess.GetStoreOpCode): For System.IntPtr,
13098         we use the stobj opcode.
13099
13100         (ArrayCreation.EmitDynamicInitializers): Revert Miguel's patch
13101         since it wasn't the correct fix. 
13102
13103         It still is puzzling that we are required to use stobj for IntPtr
13104         which seems to be a ValueType.
13105
13106 2003-05-26  Miguel de Icaza  <miguel@ximian.com>
13107
13108         * ecore.cs (SimpleName.SimpleNameResolve): Consider using aliases
13109         during regular simple name resolution.   Now, the trick is that
13110         instead of returning for processing the simplename, we do a
13111         TypeManager.LookupType (ie, a rooted lookup as opposed to a
13112         contextual lookup type).   If a match is found, return that, if
13113         not, return for further composition.
13114
13115         This fixes long-standing 30485.
13116
13117         * expression.cs (ArrayCreation.EmitDynamicInitializers): When
13118         using the address to initialize an object, do an Stobj instead of
13119         using the regular Stelem.
13120
13121         (IndexerAccess.Emit, IndexerAccess.EmitAssign):
13122         Pass `is_base_indexer' to Invocation.EmitCall instead of false.
13123         Because if we are a BaseIndexerAccess that value will be true.
13124         Fixes 43643.
13125
13126         * statement.cs (GotoCase.Resolve): Return after reporting an
13127         error, do not attempt to continue. 
13128
13129         * expression.cs (PointerArithmetic.Emit): If our operand is a
13130         long, convert our constants to match the operand before
13131         multiplying.  Convert to I type before adding.   Fixes 43670.
13132
13133 2003-05-14  Ravi Pratap  <ravi@ximian.com>
13134
13135         * enum.cs (ImplicitConversionExists) : Rename to
13136         ImplicitEnumConversionExists to remove ambiguity. 
13137
13138         * ecore.cs (NullCast): New type of cast expression class which
13139         basically is very similar to EmptyCast with the difference being
13140         it still is a constant since it is used only to cast a null to
13141         something else
13142         (eg. (string) null)
13143
13144         * convert.cs (ImplicitReferenceConversion): When casting a null
13145         literal, we return a NullCast.
13146
13147         * literal.cs (NullLiteralTyped): Remove - I don't see why this
13148         should be around anymore.
13149
13150         The renaming (reported was slightly wrong). Corrections:
13151
13152         ConvertImplicitStandard -> ImplicitConversionStandard
13153         ConvertExplicitStandard -> ExplicitConversionStandard
13154
13155         * expression.cs (StaticCallExpr.MakeSimpleCall): Resolve arguments
13156         before passing them in !
13157
13158         * convert.cs (ImplicitConversionStandard): When comparing for
13159         equal expr and target types, ensure that expr is not a
13160         NullLiteral.
13161
13162         In general, we must not be checking (expr_type ==
13163         target_type) in the top level conversion methods
13164         (ImplicitConversion, ExplicitConversion etc). This checking is
13165         done in the methods that they delegate to.
13166
13167 2003-05-20  Miguel de Icaza  <miguel@ximian.com>
13168
13169         * convert.cs: Move Error_CannotConvertType,
13170         ImplicitReferenceConversion, ImplicitReferenceConversionExists,
13171         ImplicitNumericConversion, ImplicitConversionExists,
13172         ImplicitUserConversionExists, StandardConversionExists,
13173         FindMostEncompassedType, FindMostSpecificSource,
13174         FindMostSpecificTarget, ImplicitUserConversion,
13175         ExplicitUserConversion, GetConversionOperators,
13176         UserDefinedConversion, ConvertImplicit, ConvertImplicitStandard,
13177         TryImplicitIntConversion, Error_CannotConvertImplicit,
13178         ConvertImplicitRequired, ConvertNumericExplicit,
13179         ExplicitReferenceConversionExists, ConvertReferenceExplicit,
13180         ConvertExplicit, ConvertExplicitStandard from the ecore.cs into
13181         its own file.
13182
13183         Perform the following renames:
13184
13185         StandardConversionExists -> ImplicitStandardConversionExists
13186         ConvertImplicit -> ImplicitConversion
13187         ConvertImplicitStandard -> ImplicitStandardConversion
13188         TryImplicitIntConversion -> ImplicitIntConversion
13189         ConvertImplicitRequired -> ImplicitConversionRequired
13190         ConvertNumericExplicit -> ExplicitNumericConversion
13191         ConvertReferenceExplicit -> ExplicitReferenceConversion
13192         ConvertExplicit -> ExplicitConversion
13193         ConvertExplicitStandard -> ExplicitStandardConversion
13194
13195 2003-05-19  Martin Baulig  <martin@ximian.com>
13196
13197         * statement.cs (TypeInfo.StructInfo): Made this type protected.
13198         (TypeInfo): Added support for structs having structs as fields.
13199
13200         * ecore.cs (FieldExpr): Implement IVariable.
13201         (FieldExpr.DoResolve): Call VariableInfo.GetSubStruct() to get the
13202         VariableInfo for the field.
13203
13204 2003-05-18  Martin Baulig  <martin@ximian.com>
13205
13206         * expression.cs (This.DoResolve): Report a CS0027 if we're
13207         emitting a field initializer.
13208
13209 2003-05-18  Martin Baulig  <martin@ximian.com>
13210
13211         * expression.cs (This.ResolveBase): New public function.
13212         (This.DoResolve): Check for CS0188.
13213
13214         * codegen.cs (EmitContext.This): Just call This.ResolveBase(), not
13215         This.Resolve().
13216
13217         * ecore.cs (MethodGroupExpr.DoResolve): Set the
13218         `instance_expression' to null if we don't have any non-static
13219         methods.
13220
13221 2003-05-18  Martin Baulig  <martin@ximian.com>
13222
13223         Reworked the way how local variables and parameters are handled by
13224         the flow analysis code.
13225
13226         * statement.cs (TypeInfo, VariableMap): New public classes.
13227         (VariableInfo): New public class.  This is now responsible for
13228         checking whether a variable has been assigned.  It is used for
13229         parameters and local variables.
13230         (Block.EmitMeta): Take the InternalParameters as argument; compute
13231         the layout of the flow vectors here.
13232         (Block.LocalMap, Block.ParameterMap): New public properties.
13233         (FlowBranching): The .ctor doesn't get the InternalParameters
13234         anymore since Block.EmitMeta() now computes the layout of the flow
13235         vector.
13236         (MyStructInfo): This class is now known as `StructInfo' and nested
13237         in `TypeInfo'; we don't access this directly anymore.
13238
13239         * ecore.cs (IVariable): Added `VariableInfo VariableInfo'
13240         property and removed IsAssigned(), IsFieldAssigned(),
13241         SetAssigned() and SetFieldAssigned(); we now call them on the
13242         VariableInfo so we don't need to duplicate this code everywhere.
13243
13244         * expression.cs (ParameterReference): Added `Block block' argument
13245         to the .ctor.
13246         (LocalVariableReference, ParameterReference, This): The new
13247         VariableInfo class is now responsible for all the definite
13248         assignment stuff.
13249
13250         * codegen.cs (EmitContext.IsVariableAssigned, SetVariableAssigned,
13251         IsParameterAssigned, SetParameterAssigned): Removed.
13252
13253 2003-05-18  Martin Baulig  <martin@ximian.com>
13254
13255         * typemanager.cs (InitCoreTypes): Try calling
13256         SetCorlibTypeBuilders() with 4 args; if that fails, fall back to
13257         the 3-args-version.  Corlib now also needs our `void_type'.
13258         (GetMethod): Added overloaded version which takes an optional
13259         `bool report_errors' to allow lookups of optional methods.
13260
13261 2003-05-12  Martin Baulig  <martin@ximian.com>
13262
13263         * statement.cs (VariableInfo): Renamed to LocalInfo since it's
13264         only used for locals and not for parameters.
13265
13266 2003-05-12  Miguel de Icaza  <miguel@ximian.com>
13267
13268         * support.cs (InternalParameters.ParameterType): Return the
13269         ExternalType of the parameter.
13270
13271         * parameter.cs (Parameter.ExternalType): drop the two arguments,
13272         they were unused.
13273
13274 2003-05-11  Miguel de Icaza  <miguel@ximian.com>
13275
13276         * class.cs (MethodData.Define): Do not set the `newslot' on
13277         interface members, if they are also flagged as "override".
13278
13279         * expression.cs (UnaryMutator.EmitCode): Simple workaround to emit
13280         better code for ++i and i++.  This only works for static fields
13281         and local variables.
13282
13283         * typemanager.cs (LookupDeclSpace): Add new method, sometimes we
13284         want to pull the DeclSpace out of the builder_to_declspace instead
13285         of the TypeBuilder (like in TypeContainer.FindMembers).
13286
13287         * class.cs (TypeContainer.FindMembers): Use LookupDeclSpace
13288         instead of LookupTypeContainer.  Fixes the crash on .NET for
13289         looking up interface members.
13290
13291         * const.cs: Create our own emit context during the Definition
13292         stage, so that constants are evaluated in the proper context, when
13293         a recursive definition happens.
13294
13295 2003-05-11  Martin Baulig  <martin@ximian.com>
13296
13297         * statement.cs (Block.CreateSwitchBlock): New method.  Creates a
13298         new block for a switch section.
13299         (Block.AddLabel, Block.LookupLabel): If we're a switch section, do
13300         the adding/lookup in the switch block.  Fixes #39828.
13301
13302 2003-05-09  Miguel de Icaza  <miguel@ximian.com>
13303
13304         * expression.cs (UnaryMutator.LoadOneAndEmitOp): Missing
13305         functionality: I needed to convert the data after I had performed
13306         the add/sub operation into the operands type size.
13307
13308         * ecore.cs (ImplicitReferenceConversion): When boxing an interface
13309         pass the type for the box operation, otherwise the resulting
13310         object would have been of type object.
13311
13312         (BoxedCast): Add constructor to specify the type to box as.
13313
13314 2003-05-07  Miguel de Icaza  <miguel@ximian.com>
13315
13316         * iterators.cs: I was reusing the `count' variable inadvertently,
13317         take steps to not allow this to happen.
13318
13319 2003-05-06  Miguel de Icaza  <miguel@ximian.com>
13320
13321         * attribute.cs (Attribute.Resolve): Params attributes are encoded
13322         by creating an array at the point where the params starts and
13323         putting all those arguments there, then adjusting the size of the
13324         array.
13325
13326 2003-05-05  Miguel de Icaza  <miguel@ximian.com>
13327
13328         * expression.cs (New.AddressOf): Implement interface
13329         IMemoryLocation.  This is used when the `new' operator is used in
13330         the context of an invocation to a method on a value type.
13331
13332         See http://bugzilla.ximian.com/show_bug.cgi?id=#42390 for an
13333         example. 
13334
13335         * namespace.cs: Also check the using aliases here.
13336
13337         * driver.cs: Move the test for using validity after the types have
13338         been entered, so we do a single pass that also includes the using
13339         aliases. 
13340
13341         * statement.cs (Try.Resolve): Avoid crashing if there is a failure
13342         in the regular case.   CreateSiblingForFinally is doing extra
13343         error checking.
13344
13345         * attribute.cs (GetAttributeArgumentExpression): Store the result
13346         on an out value, and use the return value to indicate failure
13347         instead of using null (which is a valid return for Constant.GetValue).
13348
13349         * statement.cs: Perform the analysis flow for the increment
13350         portion after the statement, because this will be the real flow of
13351         execution.  Fixes #42385
13352
13353         * codegen.cs (EmitContext.EmitArgument,
13354         EmitContext.EmitStoreArgument): New helper functions when the
13355         RemapToProxy flag is set.
13356
13357         * expression.cs (ParameterReference.EmitLdarg): Expose this useful
13358         function.
13359
13360         Add support for remapping parameters. 
13361
13362         * iterators.cs: Propagate parameter values;  Store parameter
13363         values in the proxy classes.
13364
13365 2003-05-04  Miguel de Icaza  <miguel@ximian.com>
13366
13367         * ecore.cs (FieldExpr): Fix an obvious bug.  static fields do not
13368         need a proxy reference;  I do not know what I was thinking
13369
13370         * cs-parser.jay (constructor_initializer): catch another error,
13371         and display nice message.
13372
13373         (field_declaration): catch void field declaration
13374         to flag a better error. 
13375
13376         * class.cs (MemberBase.CheckBase): Report an error instead of a
13377         warning if a new protected member is declared in a struct. 
13378         (Field.Define): catch the error of readonly/volatile.
13379
13380         * ecore.cs (FieldExpr.EmitAssign): reuse the field lookup.
13381
13382         (FieldExpr.AddressOf): ditto.  Catch error where the address of a
13383         volatile variable is taken
13384
13385 2003-05-02  Miguel de Icaza  <miguel@ximian.com>
13386
13387         * statement.cs (Fixed.Resolve): Report an error if we are not in
13388         an unsafe context.
13389
13390 2003-05-01  Miguel de Icaza  <miguel@ximian.com>
13391
13392         * typemanager.cs: reuse the code that handles type clashes for
13393         delegates and enumerations.
13394
13395         * class.cs (Report28): Always report.
13396
13397         * expression.cs (EncodeAsAttribute): Allow nulls here.
13398
13399 2003-04-28  Miguel de Icaza  <miguel@ximian.com>
13400
13401         * attribute.cs (Attribute.GetAttributeArgumentExpression): Moved
13402         the functionality for testing whether an expression is valid for
13403         an attribute here.  Also handle the case of arrays of elements
13404         being stored. 
13405
13406         * expression.cs (ArrayCreation.EncodeAsAttribute): Add support for
13407         encoding a linear array into an array of objects that are suitable
13408         to be passed to an CustomAttributeBuilder.
13409
13410         * delegate.cs: Check unsafe types being used outside of an Unsafe context.
13411
13412         * ecore.cs: (FieldExpr): Handle field remapping here.
13413
13414         * iteratators.cs: Pass the instance variable (if the method is an
13415         instance method) to the constructors, so we can access the field
13416         variables on the class.
13417
13418         TODO: Test this with structs.  I think the THIS variable on
13419         structs might have to be a pointer, and not a refenrece
13420
13421 2003-04-27  Miguel de Icaza  <miguel@ximian.com>
13422
13423         * codegen.cs (EmitContext.Mapvariable): Adds a mechanism to map
13424         local variables to fields in a proxy class.
13425
13426         * iterators.cs (PopulateProxy): Rename our internal fields to
13427         <XXX>.  
13428         Create a <THIS> field if we are an instance method, so we can
13429         reference our parent container variables.
13430         (MapVariable): Called back from the EmitContext code to enter a
13431         new variable to field mapping into the proxy class (we just create
13432         a FieldBuilder).
13433
13434         * expression.cs
13435         (LocalVariableReference.{Emit,EmitAssign,AddressOf}): Add support
13436         for using the remapped locals to fields.
13437
13438         I placed the code here, because that gives the same semantics to
13439         local variables, and only changes the Emit code.
13440
13441         * statement.cs (Fixed.Resolve): it is not allowed to have fixed
13442         statements inside iterators.
13443         (VariableInfo): Add a FieldBuilder for the cases when we are
13444         remapping local variables to fields in a proxy class
13445
13446         * ecore.cs (SimpleNameResolve): Avoid testing two times for
13447         current_block != null.
13448
13449         * statement.cs (Swithc.SimpleSwitchEmit): Removed code that did
13450         not cope with strings, as it has been moved to the
13451         TableSwitchEmit.  Fixed bug in switch generation.
13452
13453         * expression.cs (New.DoResolve): Provide more context for the user
13454         when reporting an error.
13455
13456         * ecore.cs (Expression.LoadFromPtr): Use ldind_i when loading
13457         pointers. 
13458
13459         * expression.cs (MemberAccess.DoResolve): When we get a type back,
13460         check the permissions for it.  Note than in a type-resolution
13461         context the check was already present in DeclSpace.ResolveType,
13462         but was missing from the MemberAccess.
13463
13464         (ArrayCreation.CheckIndices): warn if the user has
13465         more nested levels of expressions, but there are no more
13466         dimensions specified.  Avoids crash on bug 41906.
13467
13468 2003-04-26  Miguel de Icaza  <miguel@ximian.com>
13469
13470         * statement.cs (Block): replace Implicit bool, for a generic
13471         flags.   
13472         New flag: `Unchecked'.  This is used during the EmitMeta phase
13473         (which is out-of-line with the regular Resolve/Emit process for a
13474         statement, as this is done ahead of time, but still gets a chance
13475         to call constant resolve).
13476
13477         (Block.Flags): new enum for adding a new flag.
13478
13479         (Block.EmitMeta): track the state of unchecked.
13480
13481         (Unchecked): Set the "UnChecked" flags on any blocks we enclose,
13482         to enable constant resolution to work there as well.
13483
13484 2003-04-22  Miguel de Icaza  <miguel@ximian.com>
13485
13486         * typemanager.cs (ienumerable_type): Also look up
13487         System.Collections.IEnumerable. 
13488
13489 2003-04-21  Miguel de Icaza  <miguel@ximian.com>
13490
13491         TODO: Test more than one conditional per method.
13492
13493         * class.cs (Indexer.Define): Report the location where the user is
13494         referencing the unsupported feature.
13495
13496         (MethodData): Overload the use of `conditionals' to
13497         minimize the creation of needless ArrayLists.   This saves roughly
13498         212kb on my machine.
13499
13500         (Method): Implement the new IIteratorContainer interface.
13501         (Method.SetYields): Implement the method by setting the ModFlags
13502         to contain METHOD_YIELDS.
13503
13504         * expression.cs (Unary.ResolveOperator): Use expr_type, not Expr,
13505         which just got set to null.
13506
13507         * iterators.cs: New file.
13508
13509         (Yield, YieldBreak): New statements.
13510
13511         * statement.cs (Return.Resolve): Flag an error if we are used in
13512         an iterator method.
13513
13514         * codegen.cs (InIterator): New flag set if the code is being
13515         compiled in an iterator method.
13516
13517         * modifiers.cs: New flag METHOD_YIELDS.  This modifier is an
13518         internal modifier, and we just use it to avoid adding extra
13519         fields, as this is seldom used.  
13520
13521         * cs-parser.jay: Add yield_statement (yield and yield break).
13522
13523         * driver.cs: New flag -v2 to turn on version 2 features. 
13524
13525         * cs-tokenizer.cs (Tokenizer): Add yield and __yield to the
13526         hashtable when v2 is enabled.
13527
13528 2003-04-20  Miguel de Icaza  <miguel@ximian.com>
13529
13530         * typemanager.cs (TypeManager.NamespaceClash): Use to check if
13531         there is already a namespace defined with this name.
13532
13533         (TypeManager.InitCoreTypes): Remove the temporary workaround, as
13534         people upgraded their corlibs.
13535
13536         (TypeManager.CoreLookupType): Use LookupTypeDirect, as we
13537         always use fully qualified types, no need to use the compiler
13538         front end.
13539
13540         (TypeManager.IsNamespace): Use binarysearch.
13541
13542         * class.cs (AddClass, AddStruct, AddInterface, AddEvent,
13543         AddDelegate): I did not quite use the new IsValid API properly: I
13544         have to pass the short-name and the fullname.  I was passing only
13545         the basename instead of the fullname sometimes. 
13546
13547         (TypeContainer.DefineType): call NamespaceClash.
13548
13549         * interface.cs (Interface.DefineType): use NamespaceClash before
13550         defining the type.
13551
13552         * delegate.cs (Delegate.DefineType): use NamespaceClash before
13553         defining the type.
13554
13555         * enum.cs: (Enum.DefineType): use NamespaceClash before
13556         defining the type.
13557
13558         * typemanager.cs (: 3-line patch that gives us some tasty 11%
13559         speed increase.  First, use the negative_hits cache when we get a
13560         negative.  Second, add the type with its full original name
13561         instead of the new . and + encoded name (reflection uses + to
13562         separate type from a nested type).  Use LookupTypeReflection
13563         directly which bypasses the type->name hashtable (that we already
13564         know does not contain the type.
13565
13566         * decl.cs (DeclSpace.ResolveTypeExpr): track the
13567         location/container type. 
13568
13569         * driver.cs: When passing utf8, use directly the UTF8Encoding.
13570
13571 2003-04-19  Miguel de Icaza  <miguel@ximian.com>
13572
13573         * decl.cs (ResolveTypeExpr): Mirror check acess here too.
13574
13575         * delegate.cs (NewDelegate.Resolve): Test whether an instance
13576         method is being referenced in the method group from a static
13577         context, and report error 120 if so.
13578
13579         * expression.cs, ecore.cs (Error_UnexpectedKind): New name for
13580         Error118. 
13581
13582         * typemanager.cs: Add intermediate namespaces (if a namespace A.B
13583         is created, we create the A namespace).
13584
13585         * cs-parser.jay: A namespace also introduces a DeclarationFound.
13586         Fixes #41591
13587
13588 2003-04-18  Miguel de Icaza  <miguel@ximian.com>
13589
13590         * typemanager.cs (GetReferenceType, GetPointerType): In .NET each
13591         invocation to ModuleBuilder.GetType with the same values will
13592         return a new type instance, so we need to cache its return
13593         values. 
13594
13595         * expression.cs (Binary.ResolveOperator): Only allow the compare
13596         operators on enums if they are of the same type.
13597
13598         * ecore.cs (Expression.ImplicitReferenceConversion): handle target
13599         types of ValueType on their own case.  Before we were giving them
13600         the same treatment as objects.
13601
13602         * decl.cs (DeclSpace.IsValid): IsValid takes the short name and
13603         fullname.  Short name is used to compare against container name.
13604         Fullname is used to check against defined namespace names.
13605
13606         * class.cs (AddProperty, AddField, AddClass, AddStruct, AddEnum,
13607         AddDelegate, AddEvent): Pass new parameter to DeclSpace.IsValid
13608
13609         (Method.CheckBase): Call parent.
13610         (MemberBase.CheckBase): Check for protected members on sealed
13611         classes.
13612         (PropertyBase.CheckBase): Call parent.
13613         (Field.Define): Call parent.
13614
13615         * report.cs: Negative error codes are now mapped to 8000 - code,
13616         so that the display is render more nicely.
13617
13618         * typemanager.cs: Do not use try/catch, instead report a regular
13619         error. 
13620
13621         (GetPointerType, GetReferenceType): These methods provide
13622         mechanisms to obtain the T* and T& from a T.  We had the code
13623         previously scattered around the code base, and it also used
13624         TypeManager.LookupType that would go through plenty of caches.
13625         This one goes directly to the type source.
13626
13627         In some places we did the Type.GetType followed by
13628         ModuleBuilder.GetType, but not in others, so this unifies the
13629         processing as well.
13630
13631         * namespace.cs (VerifyUsing): Perform a non-lazy approach to using
13632         statements now that we have namespace information.
13633
13634         * typemanager.cs (IsNamespace): New method, returns whether the
13635         string presented is a namespace or not.
13636
13637         (ComputeNamespaces): New public entry point, computes the list of
13638         available namespaces, using the GetNamespaces API call in Mono, or
13639         the slower version in MS.NET.   
13640
13641         Now before we start the semantic analysis phase, we have a
13642         complete list of namespaces including everything that the user has
13643         provided.
13644
13645         Deleted old code to cache namespaces in .nsc files.
13646
13647 2003-04-17  Miguel de Icaza  <miguel@ximian.com>
13648
13649         * class.cs: (TypeContainer.DefineDefaultConstructor): Use the
13650         class/struct location definition Location for the implicit
13651         constructor location.
13652
13653         (Operator.Define): Use the location of the operator for the
13654         implicit Method definition.
13655
13656         (Constructor.Emit): use the constructor location for the implicit
13657         base initializer constructor.
13658
13659         * ecore.cs: Remove ITypeExpression.  This interface is now gone,
13660         and the Expression class now contains two new methods:
13661
13662         ResolveAsTypeStep and ResolveAsTypeTerminal.  This is used to
13663         isolate type lookup from the rest of the resolution process.
13664
13665         Since we use Expressions to hold type definitions due to the way
13666         we parse the input we have historically overloaded Resolve to
13667         perform the Type lookups if a special flag is passed.  Now this is
13668         eliminated and two methods take their place. 
13669
13670         The differences in the two methods between xStep and xTerminal is
13671         that xStep is involved in our current lookup system that uses
13672         SimpleNames to compose a name, while xTerminal is used just to
13673         catch the case where the simplename lookup failed.
13674
13675 2003-04-16  Miguel de Icaza  <miguel@ximian.com>
13676
13677         * expression.cs (ResolveMemberAccess): Remove redundant code.
13678         TypeExpr expressions are always born fully resolved.
13679
13680         * interface.cs (PopulateMethod): Do not lookup the types twice.
13681         We were doing it once during SemanticAnalysis and once during
13682         PopulateMethod.
13683
13684         * cs-parser.jay: Due to our hack in the grammar, things like A.B[]
13685         in local variable type definitions, were being returned as a
13686         SimpleName (we decomposed everything into a string), that is
13687         because primary_expression was being used instead of a type in the
13688         grammar (reduce/reduce conflicts).
13689
13690         The part that was wrong is that we converted the expression into a
13691         string (an oversimplification in one hand, compounded with primary
13692         expressions doing string concatenation).
13693
13694         So things like:
13695
13696         A.B.C [] x;
13697
13698         Would return "A.B.C[]" as a SimpleName.  This stopped things like
13699         using clauses from working on this particular context.  And a type
13700         was being matched directly against "A.B.C[]".
13701
13702         We now use the correct approach, and allow for ComposedCast to be
13703         part of the unary expression.  So the "A.B.C []" become a composed
13704         cast of "A.B.C" (as a nested group of MemberAccess with a
13705         SimpleName at the end) plus the rank composition "[]". 
13706
13707         Also fixes 35567
13708
13709 2003-04-10  Miguel de Icaza  <miguel@ximian.com>
13710
13711         * decl.cs (CheckAccessLevel): Implement the NestedPrivate rules
13712         for the access level checking.
13713
13714         * class.cs: Cosmetic changes.  Renamed `TypeContainer parent' to
13715         `TypeContainer container', because I kept getting confused when I
13716         was debugging this code.
13717
13718         * expression.cs (Indexers): Instead of tracking getters/setters,
13719         we now track them in parallel.  We create one arraylist less, but
13720         most importantly it is possible now for the LValue code to find a
13721         matching get for a set.
13722
13723         (IndexerAccess.DoResolveLValue): Update the code.
13724         GetIndexersForType has been modified already to extract all the
13725         indexers from a type.  The code assumed it did not.
13726
13727         Also make the code set the correct return type for the indexer.
13728         This was fixed a long time ago for properties, but was missing for
13729         indexers.  It used to be void_type.
13730
13731         (Binary.Emit): Test first for doubles instead of
13732         floats, as they are more common.
13733
13734         (Binary.EmitBranchable): Use the .un version of the branch opcodes
13735         when dealing with floats and the <=, >= operators.  This fixes bug
13736         #39314 
13737
13738         * statement.cs (Foreach.EmitArrayForeach): bug fix: The code used
13739         to load the array value by emitting a load on the foreach variable
13740         type.  This was incorrect.  
13741
13742         We now emit the code to load an element using the the array
13743         variable type, and then we emit the conversion operator.
13744
13745         Fixed #40176
13746
13747 2003-04-10  Zoltan Varga  <vargaz@freemail.hu>
13748
13749         * attribute.cs: Avoid allocation of ArrayLists in the common case.
13750
13751 2003-04-09  Miguel de Icaza  <miguel@ximian.com>
13752
13753         * class.cs (MethodSignature.InheritableMemberSignatureCompare):
13754         test for protection before we test for signatures. 
13755
13756         (MethodSignature.ToString): implement.
13757
13758         * expression.cs (Unary.TryReduceNegative): Add missing minus sign
13759         to the case where we reduced into a LongConstant.
13760
13761         * decl.cs (CheckAccessLevel): If the type is an array, we can not
13762         depend on whether the information is acurrate, because the
13763         Microsoft runtime will always claim that the array type is public,
13764         regardless of the real state.
13765
13766         If the type is a pointer, another problem happens: the type is
13767         reported as non-public in Microsoft.  
13768
13769         In both cases we have to call CheckAccessLevel recursively with
13770         the underlying type as the argument to be tested.
13771
13772 2003-04-08  Miguel de Icaza  <miguel@ximian.com>
13773
13774         * assign.cs (Assign.Emit): If we are dealing with a compound
13775         assignment expression, we should use the code path that stores the
13776         intermediate result in a temporary value.  This fixes #40903.
13777
13778         *expression.cs (Indirection.ToString): Provide ToString method for
13779         debugging. 
13780
13781 2003-04-08  Zoltan Varga  <vargaz@freemail.hu>
13782
13783         * class.cs: Null out fields holding references to Block objects so
13784         they can be garbage collected.
13785
13786         * expression.cs (OverloadResolve): Remove unused local.
13787
13788 2003-04-07  Martin Baulig  <martin@ximian.com>
13789
13790         * codegen.cs (EmitContext.CurrentFile): New public field.
13791         (EmitContext.Mark): Use the CurrentFile to check whether the
13792         location is in the correct file.
13793         (EmitContext.EmitTopBlock): Initialize CurrentFile here.
13794
13795 2003-04-07  Martin Baulig  <martin@ximian.com>
13796
13797         * ecore.cs (Expression.ResolveBoolean): Don't call ec.Mark().
13798
13799         * codegen.cs (EmitContext.EmitTopBlock): Don't call Mark() on the
13800         location.  [FIXME: The location argument which gets passed to this
13801         method is sometimes wrong!]
13802
13803 2003-04-07  Nick Drochak <ndrochak@gol.com>
13804
13805         * codegen.cs: Be more verbose when we can't find the symbol writer dll.
13806
13807 2003-04-07  Miguel de Icaza  <miguel@ximian.com>
13808
13809         * expression.cs (Indirection.EmitAssign): We were using the
13810         temporary, but returning immediately instead of continuing the
13811         EmitAssing flow.
13812
13813 2003-04-06  Martin Baulig  <martin@ximian.com>
13814
13815         * ecore.cs (SimpleName.SimpleNameResolve): Don't report an error
13816         if it's a nested child, but also deriving from the outer class.
13817         See test 190.cs.
13818
13819         * typemanager.cs (IsNestedChildOf): Make this work if it's a
13820         nested child, but also deriving from the outer class.  See
13821         test-190.cs.
13822         (FilterWithClosure): We may access private members of the outer
13823         class if we're a nested child and deriving from the outer class.
13824         (RealMemberLookup): Only set `closure_private_ok' if the
13825         `original_bf' contained BindingFlags.NonPublic.
13826
13827 2003-04-05  Martin Baulig  <martin@ximian.com>
13828
13829         * expression.cs (SizeOf.DoResolve): Use ResolveTypeExpr, so we can
13830         probe if its a type parameter, and if so, flag an error.
13831
13832         * decl.cs: Move here the SetParameterInfo code from class.cs.
13833         Handle IsGeneric here.
13834
13835         Handle a variety of errors in the parameter info definition.
13836
13837         * ecore.cs (SimpleName.DoResolveType): Handle look ups for generic
13838         type parameters here.
13839
13840         * cs-parser.jay (class_declaration): report errors for parameters
13841         here as well.
13842
13843 2003-01-21  Miguel de Icaza  <miguel@ximian.com>
13844
13845         * generic.cs: New file, contains support code for generics.
13846
13847         * cs-parser.jay: Remove OP_SHIFT_LEFT, OP_SHIFT_RIGHT,
13848         OP_SHIFT_LEFT_ASSIGN, OP_SHIFT_RIGHT_ASSIGN.
13849
13850         Update parser for the above removals.
13851
13852         * cs-tokenizer.cs: Do not handle <<= or >>= specially.  This is
13853         now taken care of in the parser.
13854
13855 2003-04-02  Miguel de Icaza  <miguel@ximian.com>
13856
13857         * class.cs (Event.Define): Do not allow abstract events to have
13858         initializers. 
13859
13860 2003-04-01  Miguel de Icaza  <miguel@ximian.com>
13861
13862         * cs-parser.jay: Add error productions for ADD/REMOVE missing a
13863         block in event declarations.
13864
13865         * ecore.cs (FieldExpr.AddressOf): If our instance expression is a
13866         value type, get its address.
13867
13868         * expression.cs (Is.Emit): For action `LeaveOnStack' we were
13869         leaving a class on the stack instead of a boolean value (int
13870         0/1).  Change the code so we compare against null, and then the
13871         result against zero.
13872
13873         * class.cs (TypeContainer.GetClassBases): We were checking for the
13874         parent class being sealed too late.
13875
13876         * expression.cs (Binary.Emit): For <= and >= when dealing with
13877         floating point values, use cgt.un and clt.un instead of cgt and
13878         clt alone.
13879
13880 2003-04-01  Zoltan Varga  <vargaz@freemail.hu>
13881
13882         * statement.cs: Apply the same optimization as MS: skip the 
13883         GetEnumerator returning an IEnumerator, and use the one returning a 
13884         CharEnumerator instead. This allows us to avoid the try-finally block 
13885         and the boxing.
13886
13887 2003-03-31  Gaurav Vaish <gvaish_mono@lycos.com>
13888
13889         * cs-parser.jay: Attributes cannot be applied to
13890                          namespaces. Fixes #40473
13891
13892 2003-03-31  Gonzalo Paniagua Javier <gonzalo@ximian.com>
13893
13894         * class.cs:
13895         (Add*): check if the name is valid using the full name for constants,
13896         fields, properties and events.
13897
13898 2003-03-28  Miguel de Icaza  <miguel@ximian.com>
13899
13900         * enum.cs (Enum.DefineType, Enum.IsValidEnumConstant): Also allow
13901         char constants to be part of the enumeration.
13902
13903         * expression.cs (Conditional.DoResolve): Add support for operator
13904         true. Implements the missing functionality from 14.12
13905
13906         * class.cs (TypeContainer.CheckPairedOperators): Report error for missmatch on
13907         operator true/false as required by the spec.
13908
13909         * expression.cs (Unary.ResolveOperator): In LogicalNot, do an
13910         implicit conversion to boolean.
13911
13912         * statement.cs (Statement.ResolveBoolean): A boolean expression is
13913         also one where the type implements `operator true'. 
13914
13915         * ecore.cs (Expression.GetOperatorTrue): New helper routine to
13916         get an expression that will invoke operator true based on an
13917         expression.  
13918
13919         (GetConversionOperators): Removed the hack that called op_True
13920         here.  
13921
13922         (Expression.ResolveBoolean): Move this from Statement.
13923
13924 2003-03-17  Miguel de Icaza  <miguel@ximian.com>
13925
13926         * ecore.cs (FieldExpr): do not allow initialization of initonly
13927         fields on derived classes
13928
13929 2003-03-13  Martin Baulig  <martin@ximian.com>
13930
13931         * statement.cs (Block.Emit): Call ig.BeginScope() and
13932         ig.EndScope() when compiling with debugging info; call
13933         LocalBuilder.SetLocalSymInfo _after_ opening the scope.
13934
13935 2003-03-08  Miguel de Icaza  <miguel@ximian.com>
13936
13937         * expression.cs (Indexers): Do not construct immediately, allow
13938         for new members to be appended as we go.  Fixes 38143
13939
13940 2003-03-07  Gonzalo Paniagua Javier <gonzalo@ximian.com>
13941
13942         * expression.cs: save/restore context when resolving an unchecked
13943         expression.
13944
13945 2003-03-05  Miguel de Icaza  <miguel@ximian.com>
13946
13947         * cfold.cs: Catch division by zero in modulus operator during
13948         constant folding.
13949
13950 2003-03-03  Miguel de Icaza  <miguel@ximian.com>
13951
13952         * interface.cs (Interface.DefineMembers): Avoid defining members
13953         twice. 
13954
13955 2003-02-27  Miguel de Icaza  <miguel@ximian.com>
13956
13957         * driver.cs: handle the +/- options for -noconfig
13958
13959         * statement.cs (Unckeched.Resolve): Also track the state of
13960         unchecked in the Resolve phase.
13961
13962 2003-02-27  Martin Baulig  <martin@ximian.com>
13963
13964         * ecore.cs (Expression.MemberLookup): Don't create a
13965         MethodGroupExpr for something which is not a method.  Fixes #38291.
13966
13967 2003-02-25  Miguel de Icaza  <miguel@ximian.com>
13968
13969         * class.cs (MemberBase.CheckParameters): Also check that the type
13970         is unmanaged if it is a pointer.
13971
13972         * expression.cs (SizeOf.Resolve): Add location information.
13973
13974         * statement.cs (Block.EmitMeta): Flag error (208) if a pointer to
13975         a managed type is declared.
13976
13977         * expression.cs (Invocation.VerifyArgumentsCompat): Check for the
13978         parameter modifiers as well.  Fixes bug 38606
13979
13980         * class.cs: Very sad.  Am backing out the speed up changes
13981         introduced by the ArrayList -> Array in the TypeContainer, as they
13982         were not actually that much faster, and introduced a bug (no error
13983         reports on duplicated methods).
13984
13985         * assign.cs (CompoundAssign.DoLResolve): Resolve the original
13986         source first, this will guarantee that we have a valid expression
13987         before calling in lower levels functions that will require a
13988         resolved object.  Then use this original_source in the
13989         target.ResolveLValue instead of the original source that was
13990         passed to us.
13991
13992         Another change.  Use target.Resolve instead of LValueResolve.
13993         Although we are resolving for LValues, we will let the Assign code
13994         take care of that (it will be called again from Resolve).  This
13995         basically allows code like this:
13996
13997         class X { X operator + (X x, object o) {} X this [int idx] { get; set; } }
13998         class Y { void A (X x) { x [0] += o; }
13999
14000         The problem was that the indexer was trying to resolve for
14001         set_Item (idx, object o) and never finding one.  The real set_Item
14002         was set_Item (idx, X).  By delaying the process we get the right
14003         semantics. 
14004
14005         Fixes bug 36505
14006
14007 2003-02-23  Martin Baulig  <martin@ximian.com>
14008
14009         * statement.cs (Block.Emit): Override this and set ec.CurrentBlock
14010         while calling DoEmit ().
14011
14012         * codegen.cs (EmitContext.Mark): Don't mark locations in other
14013         source files; if you use the #line directive inside a method, the
14014         compiler stops emitting line numbers for the debugger until it
14015         reaches the end of the method or another #line directive which
14016         restores the original file.
14017
14018 2003-02-23  Martin Baulig  <martin@ximian.com>
14019
14020         * statement.cs (FlowBranching.UsageVector.MergeChildren): Fix bug #37708.
14021
14022 2003-02-23  Martin Baulig  <martin@ximian.com>
14023
14024         * statement.cs (Block.AddChildVariableNames): We need to call this
14025         recursively, not just for our immediate children.
14026
14027 2003-02-23  Martin Baulig  <martin@ximian.com>
14028
14029         * class.cs (Event.Define): Always make the field private, like csc does.
14030
14031         * typemanager.cs (TypeManager.RealMemberLookup): Make events
14032         actually work, fixes bug #37521.
14033
14034 2003-02-23  Miguel de Icaza  <miguel@ximian.com>
14035
14036         * delegate.cs: When creating the various temporary "Parameters"
14037         classes, make sure that we call the ComputeAndDefineParameterTypes
14038         on those new parameters (just like we do with the formal ones), to
14039         allow them to be resolved in the context of the DeclSpace.
14040
14041         This fixes the bug that Dick observed in Bugzilla #38530.
14042
14043 2003-02-22  Miguel de Icaza  <miguel@ximian.com>
14044
14045         * expression.cs (ResolveMemberAccess): When resolving a constant,
14046         do not attempt to pull a constant if the value was not able to
14047         generate a valid constant.
14048
14049         * const.cs (LookupConstantValue): Do not report more errors than required.
14050
14051 2003-02-19  Gonzalo Paniagua Javier <gonzalo@ximian.com>
14052
14053         * expression.cs: fixes bug #38328.
14054
14055 2003-02-18  Miguel de Icaza  <miguel@ximian.com>
14056
14057         * class.cs: Changed all the various members that can be part of a
14058         class from being an ArrayList to be an Array of the right type.
14059         During the DefineType type_list, interface_list, delegate_list and
14060         enum_list are turned into types, interfaces, delegates and enums
14061         arrays.  
14062
14063         And during the member population, indexer_list, event_list,
14064         constant_list, field_list, instance_constructor_list, method_list,
14065         operator_list and property_list are turned into their real arrays.
14066
14067         Although we could probably perform this operation earlier, for
14068         good error reporting we need to keep the lists and remove the
14069         lists for longer than required.
14070
14071         This optimization was triggered by Paolo profiling the compiler
14072         speed on the output of `gen-sample-program.pl' perl script. 
14073
14074         * decl.cs (DeclSpace.ResolveType): Set the ContainerType, so we do
14075         not crash in methods like MemberLookupFailed that use this field.  
14076
14077         This problem arises when the compiler fails to resolve a type
14078         during interface type definition for example.
14079
14080 2003-02-18  Miguel de Icaza  <miguel@ximian.com>
14081
14082         * expression.cs (Indexers.GetIndexersForType): Interfaces do not
14083         inherit from System.Object, so we have to stop at null, not only
14084         when reaching System.Object.
14085
14086 2003-02-17  Miguel de Icaza  <miguel@ximian.com>
14087
14088         * expression.cs: (Indexers.GetIndexersForType): Martin's fix used
14089         DeclaredOnly because the parent indexer might have had a different
14090         name, but did not loop until the top of the hierarchy was reached.
14091
14092         The problem this one fixes is 35492: when a class implemented an
14093         indexer from an interface, we were getting the interface method
14094         (which was abstract) and we were flagging an error (can not invoke
14095         abstract method).
14096
14097         This also keeps bug 33089 functioning, and test-148 functioning.
14098
14099         * typemanager.cs (IsSpecialMethod): The correct way of figuring
14100         out if a method is special is to see if it is declared in a
14101         property or event, or whether it is one of the predefined operator
14102         names.   This should fix correctly #36804.
14103
14104 2003-02-15  Miguel de Icaza  <miguel@ximian.com>
14105
14106         The goal here is to remove the dependency on EmptyCast.Peel ().
14107         Killing it completely.
14108
14109         The problem is that currently in a number of places where
14110         constants are expected, we have to "probe" for an EmptyCast, and
14111         Peel, which is not the correct thing to do, as this will be
14112         repetitive and will likely lead to errors. 
14113
14114         The idea is to remove any EmptyCasts that are used in casts that
14115         can be reduced to constants, so we only have to cope with
14116         constants. 
14117
14118         This bug hunt was triggered by Bug 37363 and the desire to remove
14119         the duplicate pattern where we were "peeling" emptycasts to check
14120         whether they were constants.  Now constants will always be
14121         constants.
14122
14123         * ecore.cs: Use an enumconstant here instead of wrapping with
14124         EmptyCast.  
14125
14126         * expression.cs (Cast.TryReduce): Ah, the tricky EnumConstant was
14127         throwing me off.  By handling this we can get rid of a few hacks.
14128
14129         * statement.cs (Switch): Removed Peel() code.
14130
14131 2003-02-14  Miguel de Icaza  <miguel@ximian.com>
14132
14133         * class.cs: Location information for error 508
14134
14135         * expression.cs (New.DoResolve): Add a guard against double
14136         resolution of an expression.  
14137
14138         The New DoResolve might be called twice when initializing field
14139         expressions (see EmitFieldInitializers, the call to
14140         GetInitializerExpression will perform a resolve on the expression,
14141         and later the assign will trigger another resolution
14142
14143         This leads to bugs (#37014)
14144
14145         * delegate.cs: The signature for EndInvoke should contain any ref
14146         or out parameters as well.  We were not doing this in the past. 
14147
14148         * class.cs (Field.Define): Do not overwrite the type definition
14149         inside the `volatile' group.  Turns out that volatile enumerations
14150         were changing the type here to perform a validity test, which
14151         broke conversions. 
14152
14153 2003-02-12  Miguel de Icaza  <miguel@ximian.com>
14154
14155         * ecore.cs (FieldExpr.AddressOf): In the particular case of This
14156         and structs, we do not want to load the instance variable
14157
14158         (ImplicitReferenceConversion, ImplicitReferenceConversionExists):
14159         enum_type has to be handled like an object reference (implicit
14160         conversions exists from this to object), but the regular IsClass
14161         and IsValueType tests will never return true for this one.
14162
14163         Also we use TypeManager.IsValueType instead of type.IsValueType,
14164         just for consistency with the rest of the code (this is only
14165         needed if we ever use the construct exposed by test-180.cs inside
14166         corlib, which we dont today).
14167
14168 2003-02-12  Zoltan Varga  <vargaz@freemail.hu>
14169
14170         * attribute.cs (ApplyAttributes): apply all MethodImplAttributes, not
14171         just InternalCall.
14172
14173 2003-02-09  Martin Baulig  <martin@ximian.com>
14174
14175         * namespace.cs (Namespace..ctor): Added SourceFile argument.
14176         (Namespace.DefineNamespaces): New static public method; this is
14177         called when we're compiling with debugging to add all namespaces
14178         to the symbol file.
14179
14180         * tree.cs (Tree.RecordNamespace): Added SourceFile argument and
14181         pass it to the Namespace's .ctor.
14182
14183         * symbolwriter.cs (SymbolWriter.OpenMethod): Added TypeContainer
14184         and MethodBase arguments; pass the namespace ID to the symwriter;
14185         pass the MethodBase instead of the token to the symwriter.
14186         (SymbolWriter.DefineNamespace): New method to add a namespace to
14187         the symbol file.
14188
14189 2003-02-09  Martin Baulig  <martin@ximian.com>
14190
14191         * symbolwriter.cs: New file.  This is a wrapper around
14192         ISymbolWriter with a cleaner API.  We'll dynamically Invoke()
14193         methods here in near future.
14194
14195 2003-02-09  Martin Baulig  <martin@ximian.com>
14196
14197         * codegen.cs (EmitContext.Mark): Just pass the arguments to
14198         ILGenerator.MarkSequencePoint() which are actually used by the
14199         symbol writer.
14200
14201 2003-02-09  Martin Baulig  <martin@ximian.com>
14202
14203         * location.cs (SourceFile): New public sealed class.  This
14204         contains the name and an index which is used in the location's token.
14205         (Location): Reserve an appropriate number of bits in the token for
14206         the source file instead of walking over that list, this gives us a
14207         really huge performance improvement when compiling with debugging.
14208
14209         * driver.cs (Driver.parse, Driver.tokenize_file): Take a
14210         `SourceFile' argument instead of a string.
14211         (Driver.ProcessFile): Add all the files via Location.AddFile(),
14212         but don't parse/tokenize here, we need to generate the list of all
14213         source files before we do that.
14214         (Driver.ProcessFiles): New static function.  Parses/tokenizes all
14215         the files.
14216
14217         * cs-parser.jay (CSharpParser): Take a `SourceFile' argument
14218         instead of a string.
14219
14220         * cs-tokenizer.cs (Tokenizer): Take `SourceFile' argument instead
14221         of a string.
14222
14223 2003-02-09  Martin Baulig  <martin@ximian.com>
14224
14225         * cs-tokenizer.cs (Tokenizer.PreProcessLine): Also reset the
14226         filename on `#line default'.
14227
14228 Sat Feb 8 17:03:16 CET 2003 Paolo Molaro <lupus@ximian.com>
14229
14230         * statement.cs: don't clear the pinned var when the fixed statement
14231         returns from the method (fixes bug#37752).
14232
14233 Sat Feb 8 12:58:06 CET 2003 Paolo Molaro <lupus@ximian.com>
14234
14235         * typemanager.cs: fix from mathpup@mylinuxisp.com (Marcus Urban) 
14236         to IsValueType.
14237
14238 2003-02-07  Martin Baulig  <martin@ximian.com>
14239
14240         * driver.cs: Removed the `--debug-args' command line argument.
14241
14242         * codegen.cs (CodeGen.SaveSymbols): Removed, this is now done
14243         automatically by the AsssemblyBuilder.
14244         (CodeGen.InitializeSymbolWriter): We don't need to call any
14245         initialization function on the symbol writer anymore.  This method
14246         doesn't take any arguments.
14247
14248 2003-02-03  Miguel de Icaza  <miguel@ximian.com>
14249
14250         * driver.cs: (AddAssemblyAndDeps, LoadAssembly): Enter the types
14251         from referenced assemblies as well.
14252
14253 2003-02-02  Martin Baulig  <martin@ximian.com>
14254
14255         * class.cs (MethodData.Emit): Generate debugging info for external methods.
14256
14257 2003-02-02  Martin Baulig  <martin@ximian.com>
14258
14259         * class.cs (Constructor.Emit): Open the symbol writer before
14260         emitting the constructor initializer.
14261         (ConstructorInitializer.Emit): Call ec.Mark() to allow
14262         single-stepping through constructor initializers.
14263
14264 2003-01-30  Miguel de Icaza  <miguel@ximian.com>
14265
14266         * class.cs: Handle error 549: do not allow virtual methods in
14267         sealed classes. 
14268
14269 2003-02-01 Jackson Harper <jackson@latitudegeo.com>
14270
14271         * decl.cs: Check access levels when resolving types
14272
14273 2003-01-31 Jackson Harper <jackson@latitudegeo.com>
14274
14275         * statement.cs: Add parameters and locals set in catch blocks that might 
14276         return to set vector
14277
14278 2003-01-29  Miguel de Icaza  <miguel@ximian.com>
14279
14280         * class.cs (Operator): Set the SpecialName flags for operators.
14281
14282         * expression.cs (Invocation.DoResolve): Only block calls to
14283         accessors and operators on SpecialName methods.
14284
14285         (Cast.TryReduce): Handle conversions from char constants.
14286
14287
14288 Tue Jan 28 17:30:57 CET 2003 Paolo Molaro <lupus@ximian.com>
14289
14290         * statement.cs: small memory and time optimization in FlowBranching.
14291
14292 2003-01-28  Pedro Mart  <yoros@wanadoo.es>
14293
14294         * expression.cs (IndexerAccess.DoResolveLValue): Resolve the same
14295         problem that the last fix but in the other sid (Set).
14296
14297         * expression.cs (IndexerAccess.DoResolve): Fix a problem with a null
14298         access when there is no indexer in the hierarchy.
14299
14300 2003-01-27 Jackson Harper <jackson@latitudegeo.com>
14301
14302         * class.cs: Combine some if statements.
14303
14304 2003-01-27  Gonzalo Paniagua Javier <gonzalo@ximian.com>
14305
14306         * driver.cs: fixed bug #37187.
14307
14308 2003-01-27  Pedro Martinez Juliá  <yoros@wanadoo.es>
14309
14310         * expression.cs (IndexerAccess.DoResolve): Before trying to resolve
14311         any indexer, it's needed to build a list with all the indexers in the
14312         hierarchy (AllGetters), else we have problems. Fixes #35653.
14313
14314 2003-01-23  Miguel de Icaza  <miguel@ximian.com>
14315
14316         * class.cs (MethodData.Define): It is wrong for an interface
14317         implementation to be static in both cases: explicit and implicit.
14318         We were only handling this in one case.
14319
14320         Improve the if situation there to not have negations.
14321
14322         * class.cs (Field.Define): Turns out that we do not need to check
14323         the unsafe bit on field definition, only on usage.  Remove the test.
14324
14325 2003-01-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
14326
14327         * driver.cs: use assembly.Location instead of Codebase (the latest
14328         patch made mcs fail when using MS assemblies).
14329
14330 2003-01-21  Tim Haynes <thaynes@openlinksw.com>
14331
14332         * driver.cs: use DirectorySeparatorChar instead of a hardcoded "/" to
14333         get the path to *corlib.dll.
14334
14335 2003-01-21  Nick Drochak <ndrochak@gol.com>
14336
14337         * cs-tokenizer.cs:
14338         * pending.cs:
14339         * typemanager.cs: Remove compiler warnings
14340
14341 2003-01-20  Duncan Mak  <duncan@ximian.com>
14342
14343         * AssemblyInfo.cs: Bump the version number to 0.19.
14344
14345 2003-01-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
14346
14347         * cs-tokenizer.cs: little fixes to line numbering when #line is used.
14348
14349 2003-01-18  Zoltan Varga  <vargaz@freemail.hu>
14350
14351         * class.cs (Constructor::Emit): Emit debugging info for constructors.
14352
14353 2003-01-17  Miguel de Icaza  <miguel@ximian.com>
14354
14355         * cs-parser.jay: Small fix: we were not comparing the constructor
14356         name correctly.   Thanks to Zoltan for the initial pointer.
14357
14358 2003-01-16 Jackson Harper <jackson@latitudegeo.com>
14359
14360         * cs-tokenizer.cs: Set file name when specified with #line
14361
14362 2003-01-15  Miguel de Icaza  <miguel@ximian.com>
14363
14364         * cs-parser.jay: Only perform the constructor checks here if we
14365         are named like the class;  This will help provider a better
14366         error.  The constructor path is taken when a type definition is
14367         not found, but most likely the user forgot to add the type, so
14368         report that rather than the constructor error.
14369
14370 Tue Jan 14 10:36:49 CET 2003 Paolo Molaro <lupus@ximian.com>
14371
14372         * class.cs, rootcontext.cs: small changes to avoid unnecessary memory
14373         allocations.
14374
14375 2003-01-13 Jackson Harper <jackson@latitudegeo.com>
14376
14377         * cs-parser.jay: Add cleanup call.
14378
14379 2003-01-13  Duncan Mak  <duncan@ximian.com>
14380
14381         * cs-tokenizer.cs (Cleanup): Rename to 'cleanup' to make it more
14382         consistent with other methods.
14383
14384 2003-01-13 Jackson Harper <jackson@latitudegeo.com>
14385
14386         * cs-tokenizer.cs: Add Cleanup method, also fix #region error messages.
14387
14388 Sun Jan 12 19:58:42 CET 2003 Paolo Molaro <lupus@ximian.com>
14389
14390         * attribute.cs: only set GuidAttr to true when we have a
14391         GuidAttribute.
14392
14393 2003-01-09  Gonzalo Paniagua Javier <gonzalo@ximian.com>
14394
14395         * ecore.cs:
14396         * expression.cs:
14397         * typemanager.cs: fixes to allow mcs compile corlib with the new
14398         Type.IsSubclassOf fix.
14399
14400 2003-01-08  Miguel de Icaza  <miguel@ximian.com>
14401
14402         * expression.cs (LocalVariableReference.DoResolve): Classify a
14403         constant as a value, not as a variable.   Also, set the type for
14404         the variable.
14405
14406         * cs-parser.jay (fixed_statement): take a type instead of a
14407         pointer_type, so we can produce a better error message later.
14408
14409         * statement.cs (Fixed.Resolve): Flag types that are not pointers
14410         as an error.  
14411
14412         (For.DoEmit): Make inifinite loops have a
14413         non-conditional branch back.
14414
14415         (Fixed.DoEmit): First populate the pinned variables, then emit the
14416         statement, then clear the variables.  Before I was emitting the
14417         code once for each fixed piece.
14418
14419
14420 2003-01-08  Martin Baulig  <martin@ximian.com>
14421
14422         * statement.cs (FlowBranching.MergeChild): A break in a
14423         SWITCH_SECTION does not leave a loop.  Fixes #36155.
14424
14425 2003-01-08  Martin Baulig  <martin@ximian.com>
14426
14427         * statement.cs (FlowBranching.CheckOutParameters): `struct_params'
14428         lives in the same number space than `param_map'.  Fixes #36154.
14429
14430 2003-01-07  Miguel de Icaza  <miguel@ximian.com>
14431
14432         * cs-parser.jay (constructor_declaration): Set the
14433         Constructor.ModFlags before probing for it.  This makes the
14434         compiler report 514, 515 and 132 (the code was there, but got
14435         broken). 
14436
14437         * statement.cs (Goto.Resolve): Set `Returns' to ALWAYS.
14438         (GotoDefault.Resolve): Set `Returns' to ALWAYS.
14439         (GotoCase.Resolve): Set `Returns' to ALWAYS.
14440
14441 Tue Jan 7 18:32:24 CET 2003 Paolo Molaro <lupus@ximian.com>
14442
14443         * enum.cs: create the enum static fields using the enum type.
14444
14445 Tue Jan 7 18:23:44 CET 2003 Paolo Molaro <lupus@ximian.com>
14446
14447         * class.cs: don't try to create the ParamBuilder for the return
14448         type if it's not needed (and handle it breaking for the ms runtime
14449         anyway).
14450
14451 2003-01-06 Jackson Harper <jackson@latitudegeo.com>
14452
14453         * cs-tokenizer.cs: Add REGION flag to #region directives, and add checks to make sure that regions are being poped correctly
14454
14455 2002-12-29  Miguel de Icaza  <miguel@ximian.com>
14456
14457         * cs-tokenizer.cs (get_cmd_arg): Fixups to allow \r to terminate
14458         the command.   This showed up while compiling the JANET source
14459         code, which used \r as its only newline separator.
14460
14461 2002-12-28  Miguel de Icaza  <miguel@ximian.com>
14462
14463         * class.cs (Method.Define): If we are an operator (because it
14464         reuses our code), then set the SpecialName and HideBySig.  #36128
14465
14466 2002-12-22  Miguel de Icaza  <miguel@ximian.com>
14467
14468         * ecore.cs (FieldExpr.DoResolve): Instead of throwing an
14469         exception, report error 120 `object reference required'.
14470
14471         * driver.cs: Add --pause option, used during to measure the size
14472         of the process as it goes with --timestamp.
14473
14474         * expression.cs (Invocation.DoResolve): Do not allow methods with
14475         SpecialName to be invoked.
14476
14477 2002-12-21  Miguel de Icaza  <miguel@ximian.com>
14478
14479         * cs-tokenizer.cs: Small fix to the parser: compute the ascii
14480         number before adding it.
14481
14482 2002-12-21  Ravi Pratap  <ravi@ximian.com>
14483
14484         * ecore.cs (StandardImplicitConversion): When in an unsafe
14485         context, we allow conversion between void * to any other pointer
14486         type. This fixes bug #35973.
14487
14488 2002-12-20 Jackson Harper <jackson@latitudegeo.com>
14489
14490         * codegen.cs: Use Path.GetFileNameWithoutExtension so an exception
14491         is not thrown when extensionless outputs are used 
14492
14493 2002-12-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
14494
14495         * rootcontext.cs: fixed compilation of corlib.
14496
14497 2002-12-19  Miguel de Icaza  <miguel@ximian.com>
14498
14499         * attribute.cs (Attributes.Contains): Add new method.
14500
14501         * class.cs (MethodCore.LabelParameters): if the parameter is an
14502         `out' parameter, check that no attribute `[In]' has been passed.
14503
14504         * enum.cs: Handle the `value__' name in an enumeration.
14505
14506 2002-12-14  Jaroslaw Kowalski <jarek@atm.com.pl>
14507
14508         * decl.cs: Added special case to allow overrides on "protected
14509         internal" methods
14510
14511 2002-12-18  Ravi Pratap  <ravi@ximian.com>
14512
14513         * attribute.cs (Attributes.AddAttributeSection): Rename to this
14514         since it makes much more sense.
14515
14516         (Attributes.ctor): Don't require a Location parameter.
14517
14518         * rootcontext.cs (AddGlobalAttributeSection): Rename again.
14519
14520         * attribute.cs (ApplyAttributes): Remove extra Location parameters
14521         since we already have that information per attribute.
14522
14523         * everywhere : make appropriate changes.
14524
14525         * class.cs (LabelParameters): Write the code which actually
14526         applies attributes to the return type. We can't do this on the MS
14527         .NET runtime so we flag a warning in the case an exception is
14528         thrown.
14529
14530 2002-12-18  Miguel de Icaza  <miguel@ximian.com>
14531
14532         * const.cs: Handle implicit null conversions here too.
14533
14534 2002-12-17  Ravi Pratap  <ravi@ximian.com>
14535
14536         * class.cs (MethodCore.LabelParameters): Remove the extra
14537         Type [] parameter since it is completely unnecessary. Instead
14538         pass in the method's attributes so that we can extract
14539         the "return" attribute.
14540
14541 2002-12-17  Miguel de Icaza  <miguel@ximian.com>
14542
14543         * cs-parser.jay (parse): Use Report.Error to flag errors instead
14544         of ignoring it and letting the compile continue.
14545
14546         * typemanager.cs (ChangeType): use an extra argument to return an
14547         error condition instead of throwing an exception.
14548
14549 2002-12-15  Miguel de Icaza  <miguel@ximian.com>
14550
14551         * expression.cs (Unary.TryReduce): mimic the code for the regular
14552         code path.  Perform an implicit cast in the cases where we can
14553         implicitly convert to one of the integral types, and then reduce
14554         based on that constant.   This fixes bug #35483.
14555
14556 2002-12-14  Gonzalo Paniagua Javier <gonzalo@ximian.com>
14557
14558         * typemanager.cs: fixed cut & paste error in GetRemoveMethod.
14559
14560 2002-12-13  Gonzalo Paniagua Javier <gonzalo@ximian.com>
14561
14562         * namespace.cs: fixed bug #35489.
14563
14564 2002-12-12  Miguel de Icaza  <miguel@ximian.com>
14565
14566         * class.cs: Remove some dead code.
14567
14568         * cs-parser.jay: Estimate the number of methods needed
14569         (RootContext.MethodCount);
14570
14571         * cs-tokenizer.cs: Use char arrays for parsing identifiers and
14572         numbers instead of StringBuilders.
14573
14574         * support.cs (PtrHashtable): Add constructor with initial size;
14575         We can now reduce reallocations of the method table.
14576
14577 2002-12-10  Ravi Pratap  <ravi@ximian.com>
14578
14579         * attribute.cs (ApplyAttributes): Keep track of the emitted
14580         attributes on a per-target basis. This fixes bug #35413.
14581
14582 2002-12-10  Miguel de Icaza  <miguel@ximian.com>
14583
14584         * driver.cs (MainDriver): On rotor encoding 28591 does not exist,
14585         default to the Windows 1252 encoding.
14586
14587         (UnixParseOption): Support version, thanks to Alp for the missing
14588         pointer. 
14589
14590         * AssemblyInfo.cs: Add nice assembly information.
14591
14592         * cs-tokenizer.cs: Add fix from Felix to the #if/#else handler
14593         (bug 35169).
14594
14595         * cs-parser.jay: Allow a trailing comma before the close bracked
14596         in the attribute_section production.
14597
14598         * ecore.cs (FieldExpr.AddressOf): Until I figure out why the
14599         address of the instance was being taken, I will take this out,
14600         because we take the address of the object immediately here.
14601
14602 2002-12-09  Ravi Pratap  <ravi@ximian.com>
14603
14604         * typemanager.cs (AreMultipleAllowed): Take care of the most
14605         obvious case where attribute type is not in the current assembly -
14606         stupid me ;-)
14607
14608 2002-12-08  Miguel de Icaza  <miguel@ximian.com>
14609
14610         * ecore.cs (SimpleName.DoResolve): First perform lookups on using
14611         definitions, instead of doing that afterwards.  
14612
14613         Also we use a nice little hack, depending on the constructor, we
14614         know if we are a "composed" name or a simple name.  Hence, we
14615         avoid the IndexOf test, and we avoid 
14616
14617         * codegen.cs: Add code to assist in a bug reporter to track down
14618         the source of a compiler crash. 
14619
14620 2002-12-07  Ravi Pratap  <ravi@ximian.com>
14621
14622         * attribute.cs (Attribute.ApplyAttributes) : Keep track of which attribute
14623         types have been emitted for a given element and flag an error
14624         if something which does not have AllowMultiple set is used more
14625         than once.
14626
14627         * typemanager.cs (RegisterAttributeAllowMultiple): Keep track of
14628         attribute types and their corresponding AllowMultiple properties
14629
14630         (AreMultipleAllowed): Check the property for a given type.
14631
14632         * attribute.cs (Attribute.ApplyAttributes): Register the AllowMultiple
14633         property in the case we have a TypeContainer.
14634
14635         (Attributes.AddAttribute): Detect duplicates and just skip on
14636         adding them. This trivial fix catches a pretty gross error in our
14637         attribute emission - global attributes were being emitted twice!
14638
14639         Bugzilla bug #33187 is now fixed.
14640
14641 2002-12-06  Miguel de Icaza  <miguel@ximian.com>
14642
14643         * cs-tokenizer.cs (pp_expr): Properly recurse here (use pp_expr
14644         instead of pp_and).
14645
14646         * expression.cs (Binary.ResolveOperator): I can only use the
14647         Concat (string, string, string) and Concat (string, string,
14648         string, string) if the child is actually a concatenation of
14649         strings. 
14650
14651 2002-12-04  Miguel de Icaza  <miguel@ximian.com>
14652
14653         * cs-tokenizer.cs: Small fix, because decimal_digits is used in a
14654         context where we need a 2-character lookahead.
14655
14656         * pending.cs (PendingImplementation): Rework so we can keep track
14657         of interface types all the time, and flag those which were
14658         implemented by parents as optional.
14659
14660 2002-12-03  Miguel de Icaza  <miguel@ximian.com>
14661
14662         * expression.cs (Binary.ResolveOperator): Use
14663         String.Concat(string,string,string) or
14664         String.Concat(string,string,string,string) when possible. 
14665
14666         * typemanager: More helper methods.
14667
14668
14669 Tue Dec 3 19:32:04 CET 2002 Paolo Molaro <lupus@ximian.com>
14670
14671         * pending.cs: remove the bogus return from GetMissingInterfaces()
14672         (see the 2002-11-06 entry: the mono runtime is now fixed in cvs).
14673
14674 2002-12-02  Gonzalo Paniagua Javier <gonzalo@ximian.com>
14675
14676         * namespace.cs: avoid duplicated 'using xxx' being added to
14677         using_clauses. This prevents mcs from issuing and 'ambiguous type' error
14678         when we get more than one 'using' statement for the same namespace.
14679         Report a CS0105 warning for it.
14680
14681 2002-11-30  Miguel de Icaza  <miguel@ximian.com>
14682
14683         * cs-tokenizer.cs (consume_identifier): use read directly, instead
14684         of calling getChar/putback, uses internal knowledge of it.    
14685
14686         (xtoken): Reorder tokenizer so most common patterns are checked
14687         first.  This reduces the compilation time in another 5% (from 8.11s
14688         average to 7.73s for bootstrapping mcs on my Mobile p4/1.8ghz).
14689
14690         The parsing time is 22% of the compilation in mcs, and from that
14691         64% is spent on the tokenization process.  
14692
14693         I tried using a binary search for keywords, but this is slower
14694         than the hashtable.  Another option would be to do a couple of
14695         things:
14696
14697                 * Not use a StringBuilder, instead use an array of chars,
14698                   with a set value.  Notice that this way we could catch
14699                   the 645 error without having to do it *afterwards*.
14700
14701                 * We could write a hand-parser to avoid the hashtable
14702                   compares altogether.
14703
14704         The identifier consumption process takes 37% of the tokenization
14705         time.  Another 15% is spent on is_number.  56% of the time spent
14706         on is_number is spent on Int64.Parse:
14707
14708                 * We could probably choose based on the string length to
14709                   use Int32.Parse or Int64.Parse and avoid all the 64-bit
14710                   computations. 
14711
14712         Another 3% is spend on wrapping `xtoken' in the `token' function.
14713
14714         Handle 0xa0 as whitespace (#34752)
14715
14716 2002-11-26  Miguel de Icaza  <miguel@ximian.com>
14717
14718         * typemanager.cs (IsCLRType): New routine to tell whether a type
14719         is one of the builtin types.  
14720
14721         Maybe it needs to use TypeCodes to be faster.  Maybe we could use
14722         typecode in more places instead of doing pointer comparissions.
14723         We could leverage some knowledge about the way the typecodes are
14724         laid out.
14725
14726         New code to cache namespaces in assemblies, it is currently not
14727         invoked, to be used soon.
14728
14729         * decl.cs (DeclSpace.MakeFQN): Simple optimization.
14730
14731         * expression.cs (Binary.ResolveOperator): specially handle
14732         strings, and do not perform user-defined operator overloading for
14733         built-in types.
14734
14735 2002-11-24  Miguel de Icaza  <miguel@ximian.com>
14736
14737         * cs-tokenizer.cs: Avoid calling Char.IsDigit which is an
14738         internalcall as it is a pretty simple operation;  Avoid whenever
14739         possible to call Char.IsLetter.
14740
14741         (consume_identifier): Cut by half the number of
14742         hashtable calls by merging the is_keyword and GetKeyword behavior.
14743
14744         Do not short-circuit, because if we do, we
14745         report errors (ie, #if false && true would produce an invalid
14746         directive error);
14747
14748
14749 2002-11-24  Martin Baulig  <martin@ximian.com>
14750
14751         * expression.cs (Cast.TryReduce): If we're in checked syntax,
14752         check constant ranges and report a CS0221.  Fixes #33186.
14753
14754 2002-11-24  Martin Baulig  <martin@ximian.com>
14755
14756         * cs-parser.jay: Make this work for uninitialized variable
14757         declarations in the `for' initializer.  Fixes #32416.
14758
14759 2002-11-24  Martin Baulig  <martin@ximian.com>
14760
14761         * ecore.cs (Expression.ConvertExplicit): Make casting from/to
14762         System.Enum actually work.  Fixes bug #32269, added verify-6.cs.
14763
14764 2002-11-24  Martin Baulig  <martin@ximian.com>
14765
14766         * expression.cs (Binary.DoNumericPromotions): Added `check_user_conv'
14767         argument; if true, we also check for user-defined conversions.
14768         This is only needed if both arguments are of a user-defined type.
14769         Fixes #30443, added test-175.cs.
14770         (Binary.ForceConversion): Pass the location argument to ConvertImplicit.
14771
14772         * ecore.cs (Expression.ImplicitUserConversionExists): New method.
14773
14774 2002-11-24  Martin Baulig  <martin@ximian.com>
14775
14776         * expression.cs (ArrayAccess.GetStoreOpcode): New public static
14777         function to get the store opcode.
14778         (Invocation.EmitParams): Call ArrayAccess.GetStoreOpcode() and
14779         only emit the Ldelema if the store opcode is Stobj.  You must run
14780         both test-34 and test-167 to test this.  Fixes #34529.
14781
14782 2002-11-23  Martin Baulig  <martin@ximian.com>
14783
14784         * ecore.cs (Expression.MemberLookup): Added additional
14785         `qualifier_type' argument which is used when we're being called
14786         from MemberAccess.DoResolve() and null if we're called from a
14787         SimpleName lookup.
14788         (Expression.MemberLookupFailed): New method to report errors; this
14789         does the CS1540 check and reports the correct error message.
14790
14791         * typemanager.cs (MemberLookup): Added additional `qualifier_type'
14792         argument for the CS1540 check and redone the way how we're dealing
14793         with private members.  See the comment in the source code for details.
14794         (FilterWithClosure): Reverted this back to revision 1.197; renamed
14795         `closure_start_type' to `closure_qualifier_type' and check whether
14796         it's not null.  It was not this filter being broken, it was just
14797         being called with the wrong arguments.
14798
14799         * expression.cs (MemberAccess.DoResolve): use MemberLookupFinal()
14800         and pass it the correct `qualifier_type'; this also does the error
14801         handling for us.
14802
14803 2002-11-22  Miguel de Icaza  <miguel@ximian.com>
14804
14805         * expression.cs (Invocation.EmitParams): If the we are dealing
14806         with a non-built-in value type, load its address as well.
14807
14808         (ArrayCreation): Use a a pretty constant instead
14809         of the hardcoded value 2.   Use 6 instead of 2 for the number of
14810         static initializers.  
14811
14812         (ArrayCreation.EmitDynamicInitializers): Peel enumerations,
14813         because they are not really value types, just glorified integers. 
14814
14815         * driver.cs: Do not append .exe, the CSC compiler does not do it.
14816
14817         * ecore.cs: Remove redundant code for enumerations, make them use
14818         the same code path as everything else, fixes the casting issue
14819         with enumerations in Windows.Forms.
14820
14821         * attribute.cs: Do only cast to string if it is a string, the
14822         validation happens later.
14823
14824         * typemanager.cs: Temproary hack to avoid a bootstrap issue until
14825         people upgrade their corlibs.
14826
14827         * ecore.cs: Oops, enumerations were not following the entire code path
14828
14829 2002-11-21  Miguel de Icaza  <miguel@ximian.com>
14830
14831         * typemanager.cs (FilterWithClosure): Commented out the test for
14832         1540 in typemanager.cs, as it has problems when accessing
14833         protected methods from a parent class (see test-174.cs). 
14834
14835         * attribute.cs (Attribute.ValidateGuid): new method.
14836         (Attribute.Resolve): Use above.
14837
14838 2002-11-19  Miguel de Icaza  <miguel@ximian.com>
14839
14840         * enum.cs: In FindMembers, perform a recursive lookup for values. (34308)
14841
14842         * ecore.cs (SimpleName.SimpleNameResolve): Remove the special
14843         handling for enumerations, as we only needed the TypeContainer
14844         functionality to begin with (this is required for the fix below to
14845         work for enums that reference constants in a container class for
14846         example). 
14847
14848         * codegen.cs (EmitContext): Make TypeContainer a DeclSpace.
14849
14850         * enum.cs (Enum.Define): Use `this' instead of parent, so we have
14851         a valid TypeBuilder to perform lookups on.o
14852
14853         * class.cs (InheritableMemberSignatureCompare): Use true in the
14854         call to GetGetMethod and GetSetMethod, because we are comparing
14855         the signature, and we need to get the methods *even* if they are
14856         private. 
14857
14858         (PropertyBase.CheckBase): ditto.
14859
14860         * statement.cs (Switch.ResolveAndReduce, Block.EmitMeta,
14861         GotoCase.Resolve): Use Peel on EmpytCasts.
14862
14863         * ecore.cs (EmptyCast): drop child, add Peel method.
14864
14865 2002-11-17  Martin Baulig  <martin@ximian.com>
14866
14867         * ecore.cs (EmptyCast.Child): New public property.
14868
14869         * statement.cs (SwitchLabel.ResolveAndReduce): Check whether the
14870         label resolved to an EmptyCast.  Fixes #34162.
14871         (GotoCase.Resolve): Likewise.
14872         (Block.EmitMeta): Likewise.
14873
14874 2002-11-17  Martin Baulig  <martin@ximian.com>
14875
14876         * expression.cs (Invocation.BetterConversion): Prefer int over
14877         uint; short over ushort; long over ulong for integer literals.
14878         Use ImplicitConversionExists instead of StandardConversionExists
14879         since we also need to check for user-defined implicit conversions.
14880         Fixes #34165.  Added test-173.cs.
14881
14882 2002-11-16  Martin Baulig  <martin@ximian.com>
14883
14884         * expression.cs (Binary.EmitBranchable): Eliminate comparisions
14885         with the `true' and `false' literals.  Fixes #33151.
14886
14887 2002-11-16  Martin Baulig  <martin@ximian.com>
14888
14889         * typemanager.cs (RealMemberLookup): Reverted Miguel's patch from
14890         October 22nd; don't do the cs1540 check for static members.
14891
14892         * ecore.cs (PropertyExpr.ResolveAccessors): Rewrote this; we're
14893         now using our own filter here and doing the cs1540 check again.
14894
14895 2002-11-16  Martin Baulig  <martin@ximian.com>
14896
14897         * support.cs (InternalParameters): Don't crash if we don't have
14898         any fixed parameters.  Fixes #33532.
14899
14900 2002-11-16  Martin Baulig  <martin@ximian.com>
14901
14902         * decl.cs (MemberCache.AddMethods): Use BindingFlags.FlattenHierarchy
14903         when looking up static methods to make this work on Windows.
14904         Fixes #33773.
14905
14906 2002-11-16  Martin Baulig  <martin@ximian.com>
14907
14908         * ecore.cs (PropertyExpr.VerifyAssignable): Check whether we have
14909         a setter rather than using PropertyInfo.CanWrite.
14910
14911 2002-11-15  Nick Drochak  <ndrochak@gol.com>
14912
14913         * class.cs: Allow acces to block member by subclasses. Fixes build
14914         breaker.
14915
14916 2002-11-14  Martin Baulig  <martin@ximian.com>
14917
14918         * class.cs (Constructor.Emit): Added the extern/block check.
14919         Fixes bug #33678.
14920
14921 2002-11-14  Martin Baulig  <martin@ximian.com>
14922
14923         * expression.cs (IndexerAccess.DoResolve): Do a DeclaredOnly
14924         iteration while looking for indexers, this is needed because the
14925         indexer may have a different name in our base classes.  Fixed the
14926         error reporting (no indexers at all, not get accessor, no
14927         overloaded match).  Fixes bug #33089.
14928         (IndexerAccess.DoResolveLValue): Likewise.
14929
14930 2002-11-14  Martin Baulig  <martin@ximian.com>
14931
14932         * class.cs (PropertyBase.CheckBase): Make this work for multiple
14933         indexers.  Fixes the first part of bug #33089.
14934         (MethodSignature.InheritableMemberSignatureCompare): Added support
14935         for properties.
14936
14937 2002-11-13  Ravi Pratap  <ravi@ximian.com>
14938
14939         * attribute.cs (Attribute.Resolve): Catch the
14940         NullReferenceException and report it since it isn't supposed to
14941         happen. 
14942
14943 2002-11-12  Miguel de Icaza  <miguel@ximian.com>
14944
14945         * expression.cs (Binary.EmitBranchable): Also handle the cases for
14946         LogicalOr and LogicalAnd that can benefit from recursively
14947         handling EmitBranchable.  The code now should be nice for Paolo.
14948
14949 2002-11-08  Miguel de Icaza  <miguel@ximian.com>
14950
14951         * typemanager.cs (LookupType): Added a negative-hit hashtable for
14952         the Type lookups, as we perform quite a number of lookups on
14953         non-Types.  This can be removed once we can deterministically tell
14954         whether we have a type or a namespace in advance.
14955
14956         But this might require special hacks from our corlib.
14957
14958         * TODO: updated.
14959
14960         * ecore.cs (TryImplicitIntConversion): Handle conversions to float
14961         and double which avoids a conversion from an integer to a double.
14962
14963         * expression.cs: tiny optimization, avoid calling IsConstant,
14964         because it effectively performs the lookup twice.
14965
14966 2002-11-06  Miguel de Icaza  <miguel@ximian.com>
14967
14968         But a bogus return here to keep the semantics of the old code
14969         until the Mono runtime is fixed.
14970
14971         * pending.cs (GetMissingInterfaces): New method used to remove all
14972         the interfaces that are already implemented by our parent
14973         classes from the list of pending methods. 
14974
14975         * interface.cs: Add checks for calls after ResolveTypeExpr.
14976
14977 2002-11-05  Miguel de Icaza  <miguel@ximian.com>
14978
14979         * class.cs (Class.Emit): Report warning 67: event not used if the
14980         warning level is beyond 3.
14981
14982         * ecore.cs (Expression.ConvertExplicit): Missed a check for expr
14983         being a NullLiteral.
14984
14985         * cs-parser.jay: Fix, Gonzalo reverted the order of the rank
14986         specifiers. 
14987
14988         * class.cs (TypeContainer.GetClassBases): Cover a missing code
14989         path that might fail if a type can not be resolved.
14990
14991         * expression.cs (Binary.Emit): Emit unsigned versions of the
14992         operators. 
14993
14994         * driver.cs: use error 5.
14995
14996 2002-11-02  Gonzalo Paniagua Javier <gonzalo@gnome-db.org>
14997
14998         * cs-parser.jay: simplified a rule and 5 SR conflicts dissapeared.
14999
15000 2002-11-01  Miguel de Icaza  <miguel@ximian.com>
15001
15002         * cs-parser.jay (switch_section): A beautiful patch from Martin
15003         Baulig that fixed 33094.
15004
15005 2002-10-31  Miguel de Icaza  <miguel@ximian.com>
15006
15007         * ecore.cs (PropertyExpr.DoResolveLValue, PropertyExpr.DoResolve):
15008         Check whether the base is abstract and report an error if so.
15009
15010         * expression.cs (IndexerAccess.DoResolveLValue,
15011         IndexerAccess.DoResolve): ditto. 
15012
15013         (Invocation.DoResolve): ditto.
15014
15015         (Invocation.FullMethodDesc): Improve the report string.
15016
15017         * statement.cs (Block): Eliminate IsVariableDefined as it is
15018         basically just a wrapper for GetVariableInfo.
15019
15020         * ecore.cs (SimpleName): Use new 
15021
15022         * support.cs (ReflectionParamter.ParameterType): We unwrap the
15023         type, as we return the actual parameter ref/unref state on a
15024         different call.
15025
15026 2002-10-30  Miguel de Icaza  <miguel@ximian.com>
15027
15028         * support.cs: Return proper flags REF/OUT fixing the previous
15029         commit.  
15030
15031         * expression.cs: Reverted last patch, that was wrong.  Is_ref is
15032         not used to mean `ref' but `ref or out' in ParameterReference
15033
15034         * delegate.cs (FullDelegateDesc): use ParameterDesc to get the
15035         full type signature instead of calling TypeManger.CSharpName
15036         ourselves. 
15037
15038         * support.cs (InternalParameters.ParameterDesc): Do not compare
15039         directly to the modflags, because REF/OUT will actually be bitsets
15040         if set. 
15041
15042         * delegate.cs (VerifyMethod): Check also the modifiers.
15043
15044         * cs-tokenizer.cs: Fix bug where floating point values with an
15045         exponent where a sign was missing was ignored.
15046
15047         * driver.cs: Allow multiple assemblies to be specified in a single
15048         /r: argument
15049
15050 2002-10-28  Miguel de Icaza  <miguel@ximian.com>
15051
15052         * cs-parser.jay: Ugly.  We had to add a multiplicative_expression,
15053         because identifiers after a parenthesis would end up in this kind
15054         of production, and we needed to desamiguate it for having casts
15055         like:
15056
15057                 (UserDefinedType *) xxx
15058
15059 2002-10-24  Miguel de Icaza  <miguel@ximian.com>
15060
15061         * typemanager.cs (RealMemberLookup): when we deal with a subclass,
15062         we should set on the Bindingflags.NonPublic, but not turn on
15063         private_ok.  private_ok controls whether a Private member is
15064         returned (this is chekced on the filter routine), while the
15065         BindingFlags.NonPublic just controls whether private/protected
15066         will be allowed.   This fixes the problem part of the problem of
15067         private properties being allowed to be used in derived classes.
15068
15069         * expression.cs (BaseAccess): Provide an DoResolveLValue method,
15070         so we can call the children DoResolveLValue method (this will
15071         properly signal errors on lvalue assignments to base properties)
15072
15073         * ecore.cs (PropertyExpr.ResolveAccessors): If both setter and
15074         getter are null, and we have a property info, we know that this
15075         happened because the lookup failed, so we report an error 122 for
15076         protection level violation.
15077
15078         We also silently return if setter and getter are null in the
15079         resolve functions, this condition only happens if we have flagged
15080         the error before.  This is the other half of the problem. 
15081
15082         (PropertyExpr.ResolveAccessors): Turns out that PropertyInfo does
15083         not have accessibility information, that is why we were returning
15084         true in the filter function in typemanager.cs.
15085
15086         To properly report 122 (property is inaccessible because of its
15087         protection level) correctly, we report this error in ResolveAccess
15088         by failing if both the setter and the getter are lacking (ie, the
15089         lookup failed). 
15090
15091         DoResolve and DoLResolve have been modified to check for both
15092         setter/getter being null and returning silently, the reason being
15093         that I did not want to put the knowledge about this error in upper
15094         layers, like:
15095
15096         int old = Report.Errors;
15097         x = new PropertyExpr (...);
15098         if (old != Report.Errors)
15099                 return null;
15100         else
15101                 return x;
15102
15103         So the property expr is returned, but it is invalid, so the error
15104         will be flagged during the resolve process. 
15105
15106         * class.cs: Remove InheritablePropertySignatureCompare from the
15107         class, as we no longer depend on the property signature to compute
15108         whether it is possible to implement a method or not.
15109
15110         The reason is that calling PropertyInfo.GetGetMethod will return
15111         null (in .NET, in Mono it works, and we should change this), in
15112         cases where the Get Method does not exist in that particular
15113         class.
15114
15115         So this code:
15116
15117         class X { public virtual int A { get { return 1; } } }
15118         class Y : X { }
15119         class Z : Y { public override int A { get { return 2; } } }
15120
15121         Would fail in Z because the parent (Y) would not have the property
15122         defined.  So we avoid this completely now (because the alternative
15123         fix was ugly and slow), and we now depend exclusively on the
15124         method names.
15125
15126         (PropertyBase.CheckBase): Use a method-base mechanism to find our
15127         reference method, instead of using the property.
15128
15129         * typemanager.cs (GetPropertyGetter, GetPropertySetter): These
15130         routines are gone now.
15131
15132         * typemanager.cs (GetPropertyGetter, GetPropertySetter): swap the
15133         names, they were incorrectly named.
15134
15135         * cs-tokenizer.cs: Return are more gentle token on failure. 
15136
15137         * pending.cs (PendingImplementation.InterfaceMethod): This routine
15138         had an out-of-sync index variable, which caused it to remove from
15139         the list of pending methods the wrong method sometimes.
15140
15141 2002-10-22  Miguel de Icaza  <miguel@ximian.com>
15142
15143         * ecore.cs (PropertyExpr): Do not use PropertyInfo.CanRead,
15144         CanWrite, because those refer to this particular instance of the
15145         property, and do not take into account the fact that we can
15146         override single members of a property.
15147
15148         Constructor requires an EmitContext.  The resolution process does
15149         not happen here, but we need to compute the accessors before,
15150         because the resolution does not always happen for properties.
15151
15152         * typemanager.cs (RealMemberLookup): Set private_ok if we are a
15153         subclass, before we did not update this flag, but we did update
15154         bindingflags. 
15155
15156         (GetAccessors): Drop this routine, as it did not work in the
15157         presence of partially overwritten set/get methods. 
15158
15159         Notice that this broke the cs1540 detection, but that will require
15160         more thinking. 
15161
15162 2002-10-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
15163
15164         * class.cs:
15165         * codegen.cs:
15166         * driver.cs: issue a warning instead of an error if we don't support
15167         debugging for the platform. Also ignore a couple of errors that may
15168         arise when trying to write the symbols. Undo my previous patch.
15169
15170 2002-10-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
15171
15172         * driver.cs: ignore /debug switch except for Unix platforms.
15173
15174 2002-10-23  Nick Drochak  <ndrochak@gol.com>
15175
15176         * makefile: Remove mcs2.exe and mcs3.exe on 'make clean'
15177
15178 2002-10-21  Miguel de Icaza  <miguel@ximian.com>
15179
15180         * driver.cs: Do not make mcs-debug conditional, so we do not break
15181         builds that use it.
15182
15183         * statement.cs (UsageVector.MergeChildren): I would like Martin to
15184         review this patch.  But basically after all the children variables
15185         have been merged, the value of "Breaks" was not being set to
15186         new_breaks for Switch blocks.  I think that it should be set after
15187         it has executed.  Currently I set this to the value of new_breaks,
15188         but only if new_breaks is FlowReturn.ALWAYS, which is a bit
15189         conservative, but I do not understand this code very well.
15190
15191         I did not break anything in the build, so that is good ;-)
15192
15193         * cs-tokenizer.cs: Also allow \r in comments as a line separator.
15194
15195 2002-10-20  Mark Crichton  <crichton@gimp.org>
15196
15197         * cfold.cs: Fixed compile blocker.  Really fixed it this time.
15198
15199 2002-10-20  Nick Drochak  <ndrochak@gol.com>
15200
15201         * cfold.cs: Fixed compile blocker.
15202
15203 2002-10-20  Miguel de Icaza  <miguel@ximian.com>
15204
15205         * driver.cs: I was chekcing the key, not the file.
15206
15207 2002-10-19  Ravi Pratap  <ravi@ximian.com>
15208
15209         * ecore.cs (UserDefinedConversion): Get rid of the bogus error
15210         message that we were generating - we just need to silently return
15211         a null.
15212
15213 2002-10-19  Miguel de Icaza  <miguel@ximian.com>
15214
15215         * class.cs (Event.Define): Change my previous commit, as this
15216         breaks the debugger.  This is a temporary hack, as it seems like
15217         the compiler is generating events incorrectly to begin with.
15218
15219         * expression.cs (Binary.ResolveOperator): Added support for 
15220         "U operator - (E x, E y)"
15221
15222         * cfold.cs (BinaryFold): Added support for "U operator - (E x, E
15223         y)".
15224
15225         * ecore.cs (FieldExpr.AddressOf): We had a special code path for
15226         init-only variables, but this path did not take into account that
15227         there might be also instance readonly variables.  Correct this
15228         problem. 
15229
15230         This fixes bug 32253
15231
15232         * delegate.cs (NewDelegate.DoResolve): Catch creation of unsafe
15233         delegates as well.
15234
15235         * driver.cs: Change the extension for modules to `netmodule'
15236
15237         * cs-parser.jay: Improved slightly the location tracking for
15238         the debugger symbols.
15239
15240         * class.cs (Event.Define): Use Modifiers.FieldAttr on the
15241         modifiers that were specified instead of the hardcoded value
15242         (FamAndAssem).  This was basically ignoring the static modifier,
15243         and others.  Fixes 32429.
15244
15245         * statement.cs (Switch.SimpleSwitchEmit): Simplified the code, and
15246         fixed a bug in the process (32476)
15247
15248         * expression.cs (ArrayAccess.EmitAssign): Patch from
15249         hwang_rob@yahoo.ca that fixes bug 31834.3
15250
15251 2002-10-18  Miguel de Icaza  <miguel@ximian.com>
15252
15253         * driver.cs: Make the module extension .netmodule.
15254
15255 2002-10-16  Miguel de Icaza  <miguel@ximian.com>
15256
15257         * driver.cs: Report an error if the resource file is not found
15258         instead of crashing.
15259
15260         * ecore.cs (PropertyExpr.EmitAssign): Pass IsBase instead of
15261         false, like Emit does.
15262
15263 2002-10-16  Nick Drochak  <ndrochak@gol.com>
15264
15265         * typemanager.cs: Remove unused private member.  Also reported mcs
15266         bug to report this as a warning like csc.
15267
15268 2002-10-15  Martin Baulig  <martin@gnome.org>
15269
15270         * statement.cs (Statement.Emit): Made this a virtual method; emits
15271         the line number info and calls DoEmit().
15272         (Statement.DoEmit): New protected abstract method, formerly knows
15273         as Statement.Emit().
15274
15275         * codegen.cs (EmitContext.Mark): Check whether we have a symbol writer.
15276
15277 2002-10-11  Miguel de Icaza  <miguel@ximian.com>
15278
15279         * class.cs: Following the comment from 2002-09-26 to AddMethod, I
15280         have fixed a remaining problem: not every AddXXXX was adding a
15281         fully qualified name.  
15282
15283         Now everyone registers a fully qualified name in the DeclSpace as
15284         being defined instead of the partial name.  
15285
15286         Downsides: we are slower than we need to be due to the excess
15287         copies and the names being registered this way.  
15288
15289         The reason for this is that we currently depend (on the corlib
15290         bootstrap for instance) that types are fully qualified, because
15291         we dump all the types in the namespace, and we should really have
15292         types inserted into the proper namespace, so we can only store the
15293         basenames in the defined_names array.
15294
15295 2002-10-10  Martin Baulig  <martin@gnome.org>
15296
15297         * expression.cs (ArrayAccess.EmitStoreOpcode): Reverted the patch
15298         from bug #31834, see the bug report for a testcase which is
15299         miscompiled.
15300
15301 2002-10-10  Martin Baulig  <martin@gnome.org>
15302
15303         * codegen.cs (EmitContext.Breaks): Removed, we're now using the
15304         flow analysis code for this.
15305
15306         * statement.cs (Do, While, For): Tell the flow analysis code about
15307         infinite loops.
15308         (FlowBranching.UsageVector): Added support for infinite loops.
15309         (Block.Resolve): Moved the dead code elimination here and use flow
15310         analysis to do it.
15311
15312 2002-10-09  Miguel de Icaza  <miguel@ximian.com>
15313
15314         * class.cs (Field.Define): Catch cycles on struct type
15315         definitions. 
15316
15317         * typemanager.cs (IsUnmanagedtype): Do not recursively check
15318         fields if the fields are static.  We only need to check instance
15319         fields. 
15320
15321         * expression.cs (As.DoResolve): Test for reference type.
15322
15323         * statement.cs (Using.ResolveExpression): Use
15324         ConvertImplicitRequired, not ConvertImplicit which reports an
15325         error on failture
15326         (Using.ResolveLocalVariableDecls): ditto.
15327
15328         * expression.cs (Binary.ResolveOperator): Report errors in a few
15329         places where we had to.
15330
15331         * typemanager.cs (IsUnmanagedtype): Finish implementation.
15332
15333 2002-10-08  Miguel de Icaza  <miguel@ximian.com>
15334
15335         * expression.cs: Use StoreFromPtr instead of extracting the type
15336         and then trying to use Stelem.  Patch is from hwang_rob@yahoo.ca
15337
15338         * ecore.cs (ImplicitReferenceConversion): It is possible to assign
15339         an enumeration value to a System.Enum, but System.Enum is not a
15340         value type, but an class type, so we need to box.
15341
15342         (Expression.ConvertExplicit): One codepath could return
15343         errors but not flag them.  Fix this.  Fixes #31853
15344
15345         * parameter.cs (Resolve): Do not allow void as a parameter type.
15346
15347 2002-10-06  Martin Baulig  <martin@gnome.org>
15348
15349         * statemenc.cs (FlowBranching.SetParameterAssigned): Don't crash
15350         if it's a class type and not a struct.  Fixes #31815.
15351
15352 2002-10-06  Martin Baulig  <martin@gnome.org>
15353
15354         * statement.cs: Reworked the flow analysis code a bit to make it
15355         usable for dead code elimination.
15356
15357 2002-10-06  Gonzalo Paniagua Javier <gonzalo@ximian.com>
15358
15359         * cs-parser.jay: allow empty source files. Fixes bug #31781.
15360
15361 2002-10-04  Miguel de Icaza  <miguel@ximian.com>
15362
15363         * expression.cs (ComposedCast.DoResolveType): A quick workaround
15364         to fix the test 165, will investigate deeper.
15365
15366 2002-10-04  Martin Baulig  <martin@gnome.org>
15367
15368         * statement.cs (FlowBranching.UsageVector.MergeChildren): Make
15369         finally blocks actually work.
15370         (Try.Resolve): We don't need to create a sibling for `finally' if
15371         there is no finally block.
15372
15373 2002-10-04  Martin Baulig  <martin@gnome.org>
15374
15375         * class.cs (Constructor.Define): The default accessibility for a
15376         non-default constructor is private, not public.
15377
15378 2002-10-04  Miguel de Icaza  <miguel@ximian.com>
15379
15380         * class.cs (Constructor): Make AllowedModifiers public, add
15381         EXTERN.
15382
15383         * cs-parser.jay: Perform the modifiers test here, as the
15384         constructor for the Constructor class usually receives a zero
15385         because of the way we create it (first we create, later we
15386         customize, and we were never checking the modifiers).
15387
15388         * typemanager.cs (Typemanager.LookupTypeDirect): This new function
15389         is a version of LookupTypeReflection that includes the type-name
15390         cache.  This can be used as a fast path for functions that know
15391         the fully qualified name and are only calling into *.GetType() to
15392         obtain a composed type.
15393
15394         This is also used by TypeManager.LookupType during its type
15395         composition.
15396
15397         (LookupType): We now also track the real type name, as sometimes
15398         we can get a quey for the real type name from things like
15399         ComposedCast.  This fixes bug 31422.
15400
15401         * expression.cs (ComposedCast.Resolve): Since we are obtaining a
15402         complete type fullname, it does not have to go through the type
15403         resolution system to obtain the composed version of the type (for
15404         obtaining arrays or pointers).
15405
15406         (Conditional.Emit): Use the EmitBoolExpression to
15407         generate nicer code, as requested by Paolo.
15408
15409         (ArrayCreation.CheckIndices): Use the patch from
15410         hwang_rob@yahoo.ca to validate the array initializers. 
15411
15412 2002-10-03  Miguel de Icaza  <miguel@ximian.com>
15413
15414         * class.cs (ConstructorInitializer.Emit): simplify code by using
15415         Invocation.EmitCall, and at the same time, fix the bugs in calling
15416         parent constructors that took variable arguments. 
15417
15418         * ecore.cs (Expression.ConvertNumericExplicit,
15419         Expression.ImplicitNumericConversion): Remove the code that
15420         manually wrapped decimal (InternalTypeConstructor call is now gone
15421         as well).
15422
15423         * expression.cs (Cast.TryReduce): Also handle decimal types when
15424         trying to perform a constant fold on the type.
15425
15426         * typemanager.cs (IsUnmanagedtype): Partially implemented.
15427
15428         * parameter.cs: Removed ResolveAndDefine, as it was not needed, as
15429         that only turned off an error report, and did nothing else. 
15430
15431 2002-10-02  Miguel de Icaza  <miguel@ximian.com>
15432
15433         * driver.cs: Handle and ignore /fullpaths
15434
15435 2002-10-01  Miguel de Icaza  <miguel@ximian.com>
15436
15437         * expression.cs (Binary.ResolveOperator): Catch the case where
15438         DoNumericPromotions returns true, 
15439
15440         (Binary.DoNumericPromotions): Simplify the code, and the tests.
15441
15442 2002-09-27  Miguel de Icaza  <miguel@ximian.com>
15443
15444         * ecore.cs (EventExpr.Emit): Instead of emitting an exception,
15445         report error 70.
15446
15447 2002-09-26  Miguel de Icaza  <miguel@ximian.com>
15448
15449         * ecore.cs (ConvertNumericExplicit): It is not enough that the
15450         conversion exists, but it is also required that the conversion be
15451         performed.  This manifested in "(Type64Enum) 2".  
15452
15453         * class.cs (TypeManager.AddMethod): The fix is not to change
15454         AddEnum, because that one was using a fully qualified name (every
15455         DeclSpace derivative does), but to change the AddMethod routine
15456         that was using an un-namespaced name.  This now correctly reports
15457         the duplicated name.
15458
15459         Revert patch until I can properly fix it.  The issue
15460         is that we have a shared Type space across all namespaces
15461         currently, which is wrong.
15462
15463         Options include making the Namespace a DeclSpace, and merge
15464         current_namespace/current_container in the parser.
15465
15466 2002-09-25  Miguel de Icaza  <miguel@ximian.com>
15467
15468         * cs-parser.jay: Improve error reporting when we get a different
15469         kind of expression in local_variable_type and
15470         local_variable_pointer_type. 
15471
15472         Propagate this to avoid missleading errors being reported.
15473
15474         * ecore.cs (ImplicitReferenceConversion): treat
15475         TypeManager.value_type as a target just like object_type.   As
15476         code like this:
15477
15478         ValueType v = 1;
15479
15480         Is valid, and needs to result in the int 1 being boxed before it
15481         is assigned to the value type v.
15482
15483         * class.cs (TypeContainer.AddEnum): Use the basename, not the name
15484         to validate the enumeration name.
15485
15486         * expression.cs (ArrayAccess.EmitAssign): Mimic the same test from
15487         EmitDynamicInitializers for the criteria to use Ldelema.  Thanks
15488         to hwang_rob@yahoo.ca for finding the bug and providing a patch.
15489
15490         * ecore.cs (TryImplicitIntConversion): When doing an
15491         implicit-enumeration-conversion, check if the type is 64-bits and
15492         perform a conversion before passing to EnumConstant.
15493
15494 2002-09-23  Miguel de Icaza  <miguel@ximian.com>
15495
15496         * decl.cs (Error_AmbiguousTypeReference); New routine used to
15497         report ambiguous type references.  Unlike the MS version, we
15498         report what the ambiguity is.   Innovation at work ;-)
15499
15500         (DeclSpace.FindType): Require a location argument to
15501         display when we display an ambiguous error.
15502
15503         * ecore.cs: (SimpleName.DoResolveType): Pass location to FindType.
15504
15505         * interface.cs (GetInterfaceTypeByName): Pass location to FindType.
15506
15507         * expression.cs (EmitDynamicInitializers): Apply patch from
15508         hwang_rob@yahoo.ca that fixes the order in which we emit our
15509         initializers. 
15510
15511 2002-09-21  Martin Baulig  <martin@gnome.org>
15512
15513         * delegate.cs (Delegate.VerifyApplicability): Make this work if the
15514         delegate takes no arguments.
15515
15516 2002-09-20  Miguel de Icaza  <miguel@ximian.com>
15517
15518         * constant.cs: Use Conv_U8 instead of Conv_I8 when loading longs
15519         from integers.
15520
15521         * expression.cs: Extract the underlying type.
15522
15523         * ecore.cs (StoreFromPtr): Use TypeManager.IsEnumType instad of IsEnum
15524
15525         * decl.cs (FindType): Sorry about this, fixed the type lookup bug.
15526
15527 2002-09-19  Miguel de Icaza  <miguel@ximian.com>
15528
15529         * class.cs (TypeContainer.DefineType): We can not use the nice
15530         PackingSize with the size set to 1 DefineType method, because it
15531         will not allow us to define the interfaces that the struct
15532         implements.
15533
15534         This completes the fixing of bug 27287
15535
15536         * ecore.cs (Expresion.ImplicitReferenceConversion): `class-type S'
15537         means also structs.  This fixes part of the problem. 
15538         (Expresion.ImplicitReferenceConversionExists): ditto.
15539
15540         * decl.cs (DeclSparce.ResolveType): Only report the type-not-found
15541         error if there were no errors reported during the type lookup
15542         process, to avoid duplicates or redundant errors.  Without this
15543         you would get an ambiguous errors plus a type not found.  We have
15544         beaten the user enough with the first error.  
15545
15546         (DeclSparce.FindType): Emit a warning if we have an ambiguous
15547         reference. 
15548
15549         * ecore.cs (SimpleName.DoResolveType): If an error is emitted
15550         during the resolution process, stop the lookup, this avoids
15551         repeated error reports (same error twice).
15552
15553         * rootcontext.cs: Emit a warning if we have an ambiguous reference.
15554
15555         * typemanager.cs (LookupType): Redo the type lookup code to match
15556         the needs of System.Reflection.  
15557
15558         The issue is that System.Reflection requires references to nested
15559         types to begin with a "+" sign instead of a dot.  So toplevel
15560         types look like: "NameSpace.TopLevelClass", and nested ones look
15561         like "Namespace.TopLevelClass+Nested", with arbitrary nesting
15562         levels. 
15563
15564 2002-09-19  Martin Baulig  <martin@gnome.org>
15565
15566         * codegen.cs (EmitContext.EmitTopBlock): If control flow analysis
15567         says that a method always returns or always throws an exception,
15568         don't report the CS0161.
15569
15570         * statement.cs (FlowBranching.UsageVector.MergeChildren): Always
15571         set `Returns = new_returns'.
15572
15573 2002-09-19  Martin Baulig  <martin@gnome.org>
15574
15575         * expression.cs (MemberAccess.ResolveMemberAccess): When resolving
15576         to an enum constant, check for a CS0176.
15577
15578 2002-09-18  Miguel de Icaza  <miguel@ximian.com>
15579
15580         * class.cs (TypeContainer.CheckPairedOperators): Now we check
15581         for operators that must be in pairs and report errors.
15582
15583         * ecore.cs (SimpleName.DoResolveType): During the initial type
15584         resolution process, when we define types recursively, we must
15585         check first for types in our current scope before we perform
15586         lookups in the enclosing scopes.
15587
15588         * expression.cs (MakeByteBlob): Handle Decimal blobs.
15589
15590         (Invocation.VerifyArgumentsCompat): Call
15591         TypeManager.TypeToCoreType on the parameter_type.GetElementType.
15592         I thought we were supposed to always call this, but there are a
15593         few places in the code where we dont do it.
15594
15595 2002-09-17  Miguel de Icaza  <miguel@ximian.com>
15596
15597         * driver.cs: Add support in -linkres and -resource to specify the
15598         name of the identifier.
15599
15600 2002-09-16  Miguel de Icaza  <miguel@ximian.com>
15601
15602         * ecore.cs (StandardConversionExists): Sync with the conversion
15603         code: allow anything-* to void* conversions.
15604
15605         (FindMostSpecificSource): Use an Expression argument
15606         instead of a Type, because we might be handed over a Literal which
15607         gets a few more implicit conversions that plain types do not.  So
15608         this information was being lost.
15609
15610         Also, we drop the temporary type-holder expression when not
15611         required.
15612
15613 2002-09-17  Martin Baulig  <martin@gnome.org>
15614
15615         * class.cs (PropertyBase.CheckBase): Don't check the base class if
15616         this is an explicit interface implementation.
15617
15618 2002-09-17  Martin Baulig  <martin@gnome.org>
15619
15620         * class.cs (PropertyBase.CheckBase): Make this work for indexers with
15621         different `IndexerName' attributes.
15622
15623         * expression.cs (BaseIndexerAccess): Rewrote this class to use IndexerAccess.
15624         (IndexerAccess): Added special protected ctor for BaseIndexerAccess and
15625         virtual CommonResolve().
15626
15627 2002-09-16  Miguel de Icaza  <miguel@ximian.com>
15628
15629         * enum.cs (LookupEnumValue): Use the EnumConstant declared type,
15630         and convert that to the UnderlyingType.
15631
15632         * statement.cs (Foreach.Resolve): Indexers are just like variables
15633         or PropertyAccesses.
15634
15635         * cs-tokenizer.cs (consume_string): Track line numbers and columns
15636         inside quoted strings, we were not doing this before.
15637
15638 2002-09-16  Martin Baulig  <martin@gnome.org>
15639
15640         * ecore.cs (MethodGroupExpr.DoResolve): If we have an instance expression,
15641         resolve it.  This is needed for the definite assignment check of the
15642         instance expression, fixes bug #29846.
15643         (PropertyExpr.DoResolve, EventExpr.DoResolve): Likewise.
15644
15645 2002-09-16  Nick Drochak  <ndrochak@gol.com>
15646
15647         * parameter.cs: Fix compile error.  Cannot reference static member
15648         from an instance object.  Is this an mcs bug?
15649
15650 2002-09-14  Martin Baulig  <martin@gnome.org>
15651
15652         * decl.cs (MemberCache.SetupCacheForInterface): Don't add an interface
15653         multiple times.  Fixes bug #30295, added test-166.cs.
15654
15655 2002-09-14  Martin Baulig  <martin@gnome.org>
15656
15657         * statement.cs (Block.Emit): Don't emit unreachable code.
15658         (Switch.SimpleSwitchEmit, Switch.TableSwitchEmit): Check for missing
15659         `break' statements.
15660         (Goto.Emit, Continue.Emit): Set ec.Breaks = true.
15661
15662 2002-09-14  Martin Baulig  <martin@gnome.org>
15663
15664         * parameter.cs (Parameter.Attributes): Make this work if Modifier.ISBYREF
15665         is set.
15666
15667 2002-09-14  Martin Baulig  <martin@gnome.org>
15668
15669         * typemanager.cs (TypeManager.IsNestedChildOf): This must return false
15670         if `type == parent' since in this case `type.IsSubclassOf (parent)' will
15671         be false on the ms runtime.
15672
15673 2002-09-13  Martin Baulig  <martin@gnome.org>
15674
15675         * ecore.cs (SimpleName.SimpleNameResolve): Include the member name in
15676         the CS0038 error message.
15677
15678 2002-09-12  Miguel de Icaza  <miguel@ximian.com>
15679
15680         * expression.cs (CheckedExpr, UnCheckedExpr): If we have a
15681         constant inside, return it.
15682
15683 2002-09-12  Martin Baulig  <martin@gnome.org>
15684
15685         * cfold.cs (ConstantFold.DoConstantNumericPromotions): Check whether an
15686         implicit conversion can be done between enum types.
15687
15688         * enum.cs (Enum.LookupEnumValue): If the value is an EnumConstant,
15689         check whether an implicit conversion to the current enum's UnderlyingType
15690         exists and report an error if not.
15691
15692         * codegen.cs (CodeGen.Init): Delete the symbol file when compiling
15693         without debugging support.
15694
15695         * delegate.cs (Delegate.CloseDelegate): Removed, use CloseType instead.
15696         Fixes bug #30235.  Thanks to Ricardo Fernández Pascual.
15697
15698 2002-09-12  Martin Baulig  <martin@gnome.org>
15699
15700         * typemanager.cs (TypeManager.IsNestedChildOf): New method.
15701
15702         * ecore.cs (IMemberExpr.DeclaringType): New property.
15703         (SimpleName.SimpleNameResolve): Check whether we're accessing a
15704         nonstatic member of an outer type (CS0038).
15705
15706 2002-09-11  Miguel de Icaza  <miguel@ximian.com>
15707
15708         * driver.cs: Activate the using-error detector at warning level
15709         4 (at least for MS-compatible APIs).
15710
15711         * namespace.cs (VerifyUsing): Small buglett fix.
15712
15713         * pending.cs (PendingImplementation): pass the container pointer. 
15714
15715         * interface.cs (GetMethods): Allow for recursive definition.  Long
15716         term, I would like to move every type to support recursive
15717         definitions, not the current ordering mechanism that we have right
15718         now.
15719
15720         The situation is this: Attributes are handled before interfaces,
15721         so we can apply attributes to interfaces.  But some attributes
15722         implement interfaces, we will now handle the simple cases
15723         (recursive definitions will just get an error).  
15724
15725         * parameter.cs: Only invalidate types at the end if we fail to
15726         lookup all types.  
15727
15728 2002-09-09  Martin Baulig  <martin@gnome.org>
15729
15730         * ecore.cs (PropertyExpr.Emit): Also check for
15731         TypeManager.system_int_array_get_length so this'll also work when
15732         compiling corlib.  Fixes #30003.
15733
15734 2002-09-09  Martin Baulig  <martin@gnome.org>
15735
15736         * expression.cs (ArrayCreation.MakeByteBlob): Added support for enums
15737         and throw an exception if we can't get the type's size.  Fixed #30040,
15738         added test-165.cs.
15739
15740 2002-09-09  Martin Baulig  <martin@gnome.org>
15741
15742         * ecore.cs (PropertyExpr.DoResolve): Added check for static properies.
15743
15744         * expression.cs (SizeOf.DoResolve): Sizeof is only allowed in unsafe
15745         context.  Fixes bug #30027.
15746
15747         * delegate.cs (NewDelegate.Emit): Use OpCodes.Ldvirtftn for
15748         virtual functions.  Fixes bug #30043, added test-164.cs.
15749
15750 2002-09-08  Ravi Pratap  <ravi@ximian.com>
15751
15752         * attribute.cs : Fix a small NullRef crash thanks to my stupidity.
15753
15754 2002-09-08  Nick Drochak  <ndrochak@gol.com>
15755
15756         * driver.cs: Use an object to get the windows codepage since it's not a
15757         static property.
15758
15759 2002-09-08  Miguel de Icaza  <miguel@ximian.com>
15760
15761         * statement.cs (For.Emit): for infinite loops (test == null)
15762         return whether there is a break inside, not always "true".
15763
15764         * namespace.cs (UsingEntry): New struct to hold the name of the
15765         using definition, the location where it is defined, and whether it
15766         has been used in a successful type lookup.
15767
15768         * rootcontext.cs (NamespaceLookup): Use UsingEntries instead of
15769         strings.
15770
15771         * decl.cs: ditto.
15772
15773 2002-09-06  Ravi Pratap  <ravi@ximian.com>
15774
15775         * attribute.cs : Fix incorrect code which relied on catching
15776         a NullReferenceException to detect a null being passed in
15777         where an object was expected.
15778
15779 2002-09-06  Miguel de Icaza  <miguel@ximian.com>
15780
15781         * statement.cs (Try): flag the catch variable as assigned
15782
15783         * expression.cs (Cast): Simplified by using ResolveType instead of
15784         manually resolving.
15785
15786         * statement.cs (Catch): Fix bug by using ResolveType.
15787
15788 2002-09-06  Ravi Pratap  <ravi@ximian.com>
15789
15790         * expression.cs (BetterConversion): Special case for when we have
15791         a NullLiteral as the argument and we have to choose between string
15792         and object types - we choose string the way csc does.
15793
15794         * attribute.cs (Attribute.Resolve): Catch the
15795         NullReferenceException and report error #182 since the Mono
15796         runtime no more has the bug and having this exception raised means
15797         we tried to select a constructor which takes an object and is
15798         passed a null.
15799
15800 2002-09-05  Ravi Pratap  <ravi@ximian.com>
15801
15802         * expression.cs (Invocation.OverloadResolve): Flag a nicer error
15803         message (1502, 1503) when we can't locate a method after overload
15804         resolution. This is much more informative and closes the bug
15805         Miguel reported.
15806
15807         * interface.cs (PopulateMethod): Return if there are no argument
15808         types. Fixes a NullReferenceException bug.
15809
15810         * attribute.cs (Attribute.Resolve): Ensure we allow TypeOf
15811         expressions too. Previously we were checking only in one place for
15812         positional arguments leaving out named arguments.
15813
15814         * ecore.cs (ImplicitNumericConversion): Conversion from underlying
15815         type to the enum type is not allowed. Remove code corresponding to
15816         that.
15817
15818         (ConvertNumericExplicit): Allow explicit conversions from
15819         the underlying type to enum type. This precisely follows the spec
15820         and closes a bug filed by Gonzalo.
15821
15822 2002-09-04  Gonzalo Paniagua Javier <gonzalo@ximian.com>
15823
15824         * compiler.csproj:
15825         * compiler.csproj.user: patch from Adam Chester (achester@bigpond.com).
15826
15827 2002-09-03  Miguel de Icaza  <miguel@ximian.com>
15828
15829         * statement.cs (SwitchLabel.ResolveAndReduce): In the string case,
15830         it was important that we stored the right value after the
15831         reduction in `converted'.
15832
15833 2002-09-04  Martin Baulig  <martin@gnome.org>
15834
15835         * location.cs (Location.SymbolDocument): Use full pathnames for the
15836         source files.
15837
15838 2002-08-30  Miguel de Icaza  <miguel@ximian.com>
15839
15840         * expression.cs (ComposedCast): Use DeclSparce.ResolveType instead
15841         of the expression resolve mechanism, because that will catch the
15842         SimpleName error failures.
15843
15844         (Conditional): If we can not resolve the
15845         expression, return, do not crash.
15846
15847 2002-08-29  Gonzalo Paniagua Javier <gonzalo@ximian.com>
15848
15849         * cs-tokenizer.cs:
15850         (location): display token name instead of its number.
15851
15852 2002-08-28  Martin Baulig  <martin@gnome.org>
15853
15854         * expression.cs (Binary.ResolveOperator): Don't silently return
15855         but return an error if an operator cannot be applied between two
15856         enum types.
15857
15858 2002-08-28  Martin Baulig  <martin@gnome.org>
15859
15860         * class.cs (Constructor.Define): Set the permission attributes
15861         correctly instead of making all constructors public.
15862
15863 2002-08-28  Martin Baulig  <martin@gnome.org>
15864
15865         * ecore.cs (Expression.DoResolve): Do a TypeManager.MemberLook
15866         for private members before reporting a CS0103; if we find anything,
15867         it's a CS0122.
15868
15869 2002-08-28  Martin Baulig  <martin@gnome.org>
15870
15871         * typemanager.cs (TypeManager.FilterWithClosure): It's not enough
15872         to check whether `closure_start_type == closure_invocation_type',
15873         we also need to check whether `m.DeclaringType == closure_invocation_type'
15874         before bypassing the permission checks.  We might be accessing
15875         protected/private members from the base class.
15876         (TypeManager.RealMemberLookup): Only set private_ok if private
15877         members were requested via BindingFlags.NonPublic.
15878
15879         * ecore.cs (MethodGroupExpr.IsExplicitImpl): New property.
15880
15881         * expression.cs (MemberAccess.ResolveMemberAccess): Set
15882         MethodGroupExpr.IsExplicitImpl if appropriate.
15883         (Invocation.DoResolve): Don't report the CS0120 for explicit
15884         interface implementations.
15885
15886 2002-08-27  Martin Baulig  <martin@gnome.org>
15887
15888         * expression.cs (Invocation.DoResolve): If this is a static
15889         method and we don't have an InstanceExpression, we must report
15890         a CS0120.
15891
15892 2002-08-25  Martin Baulig  <martin@gnome.org>
15893
15894         * expression.cs (Binary.ResolveOperator): Don't allow `!=' and
15895         `==' between a valuetype and an object.
15896
15897 2002-08-25  Miguel de Icaza  <miguel@ximian.com>
15898
15899         * ecore.cs (TypeExpr): Provide a ToString method.
15900
15901 2002-08-24  Martin Baulig  <martin@gnome.org>
15902
15903         * codegen.cs (CodeGen.InitMonoSymbolWriter): The symbol file is
15904         now called proggie.dbg and it's a binary file.
15905
15906 2002-08-23  Martin Baulig  <martin@gnome.org>
15907
15908         * decl.cs (MemberCache.AddMethods): Ignore varargs methods.
15909
15910 2002-08-23  Martin Baulig  <martin@gnome.org>
15911
15912         * struct.cs (MyStructInfo.ctor): Make this work with empty
15913         structs; it's not allowed to use foreach() on null.
15914
15915 2002-08-23  Martin Baulig  <martin@gnome.org>
15916
15917         * codegen.cs (CodeGen.InitMonoSymbolWriter): Tell the symbol
15918         writer the full pathname of the generated assembly.
15919
15920 2002-08-23  Martin Baulig  <martin@gnome.org>
15921
15922         * statements.cs (FlowBranching.UsageVector.MergeChildren):
15923         A `finally' block never returns or breaks; improved handling of
15924         unreachable code.
15925
15926 2002-08-23  Martin Baulig  <martin@gnome.org>
15927
15928         * statement.cs (Throw.Resolve): Allow `throw null'.
15929
15930 2002-08-23  Martin Baulig  <martin@gnome.org>
15931
15932         * expression.cs (MemberAccess.ResolveMemberAccess): If this is an
15933         EventExpr, don't do a DeclaredOnly MemberLookup, but check whether
15934         `ee.EventInfo.DeclaringType == ec.ContainerType'.  The
15935         MemberLookup would return a wrong event if this is an explicit
15936         interface implementation and the class has an event with the same
15937         name.
15938
15939 2002-08-23  Martin Baulig  <martin@gnome.org>
15940
15941         * statement.cs (Block.AddChildVariableNames): New public method.
15942         (Block.AddChildVariableName): Likewise.
15943         (Block.IsVariableNameUsedInChildBlock): Likewise.
15944         (Block.AddVariable): Check whether a variable name has already
15945         been used in a child block.
15946
15947         * cs-parser.jay (declare_local_variables): Mark all variable names
15948         from the current block as being used in a child block in the
15949         implicit block.
15950
15951 2002-08-23  Martin Baulig  <martin@gnome.org>
15952
15953         * codegen.cs (CodeGen.InitializeSymbolWriter): Abort if we can't
15954         find the symbol writer.
15955
15956         * driver.cs: csc also allows the arguments to /define being
15957         separated by commas, not only by semicolons.
15958
15959 2002-08-23  Martin Baulig  <martin@gnome.org>
15960
15961         * interface.cs (Interface.GetMembers): Added static check for events.
15962
15963 2002-08-15  Martin Baulig  <martin@gnome.org>
15964
15965         * class.cs (MethodData.EmitDestructor): In the Expression.MemberLookup
15966         call, use ec.ContainerType.BaseType as queried_type and invocation_type.
15967
15968         * ecore.cs (Expression.MemberLookup): Added documentation and explained
15969         why the MethodData.EmitDestructor() change was necessary.
15970
15971 2002-08-20  Martin Baulig  <martin@gnome.org>
15972
15973         * class.cs (TypeContainer.FindMembers): Added static check for events.
15974
15975         * decl.cs (MemberCache.AddMembers): Handle events like normal members.
15976
15977         * typemanager.cs (TypeHandle.GetMembers): When queried for events only,
15978         use Type.GetEvents(), not Type.FindMembers().
15979
15980 2002-08-20  Martin Baulig  <martin@gnome.org>
15981
15982         * decl.cs (MemberCache): Added a special method cache which will
15983         be used for method-only searched.  This ensures that a method
15984         search will return a MethodInfo with the correct ReflectedType for
15985         inherited methods.      
15986
15987 2002-08-20  Martin Baulig  <martin@gnome.org>
15988
15989         * decl.cs (DeclSpace.FindMembers): Made this public.
15990
15991 2002-08-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
15992
15993         * delegate.cs: fixed build on windows.
15994         [FIXME:  Filed as bug #29150: MCS must report these errors.]
15995
15996 2002-08-19  Ravi Pratap  <ravi@ximian.com>
15997
15998         * ecore.cs (StandardConversionExists): Return a false
15999         if we are trying to convert the void type to anything else
16000         since that is not allowed.
16001
16002         * delegate.cs (DelegateInvocation.DoResolve): Ensure that
16003         we flag error 70 in the event an event is trying to be accessed
16004         directly from outside the declaring type.
16005
16006 2002-08-20  Martin Baulig  <martin@gnome.org>
16007
16008         * typemanager.cs, decl.cs: Moved MemberList, IMemberContainer and
16009         MemberCache from typemanager.cs to decl.cs.
16010
16011 2002-08-19  Martin Baulig  <martin@gnome.org>
16012
16013         * class.cs (TypeContainer): Implement IMemberContainer.
16014         (TypeContainer.DefineMembers): Create the MemberCache.
16015         (TypeContainer.FindMembers): Do better BindingFlags checking; only
16016         return public members if BindingFlags.Public was given, check
16017         whether members are static.
16018
16019 2002-08-16  Martin Baulig  <martin@gnome.org>
16020
16021         * decl.cs (DeclSpace.Define): Splitted this in Define and
16022         DefineMembers.  DefineMembers is called first and initializes the
16023         MemberCache.
16024
16025         * rootcontext.cs (RootContext.DefineMembers): New function.  Calls
16026         DefineMembers() on all our DeclSpaces.
16027
16028         * class.cs (TypeContainer.Define): Moved all code to DefineMembers(),
16029         but call DefineMembers() on all nested interfaces.  We call their
16030         Define() in our new Define() function.
16031
16032         * interface.cs (Interface): Implement IMemberContainer.
16033         (Interface.Define): Moved all code except the attribute stuf to
16034         DefineMembers().
16035         (Interface.DefineMembers): Initialize the member cache.
16036
16037         * typemanager.cs (IMemberFinder): Removed this interface, we don't
16038         need this anymore since we can use MemberCache.FindMembers directly.
16039
16040 2002-08-19  Martin Baulig  <martin@gnome.org>
16041
16042         * typemanager.cs (MemberCache): When creating the cache for an
16043         interface type, add all inherited members.
16044         (TypeManager.MemberLookup_FindMembers): Changed `ref bool searching'
16045         to `out bool used_cache' and documented it.
16046         (TypeManager.MemberLookup): If we already used the cache in the first
16047         iteration, we don't need to do the interfaces check.
16048
16049 2002-08-19  Martin Baulig  <martin@gnome.org>
16050
16051         * decl.cs (DeclSpace.FindMembers): New abstract method.  Moved this
16052         here from IMemberFinder and don't implement this interface anymore.
16053         (DeclSpace.MemberCache): Moved here from IMemberFinder.
16054
16055         * typemanager.cs (IMemberFinder): This interface is now only used by
16056         classes which actually support the member cache.
16057         (TypeManager.builder_to_member_finder): Renamed to builder_to_declspace
16058         since we only put DeclSpaces into this Hashtable.
16059         (MemberLookup_FindMembers): Use `builder_to_declspace' if the type is
16060         a dynamic type and TypeHandle.GetTypeHandle() otherwise.
16061
16062 2002-08-16  Martin Baulig  <martin@gnome.org>
16063
16064         * typemanager.cs (ICachingMemberFinder): Removed.
16065         (IMemberFinder.MemberCache): New property.
16066         (TypeManager.FindMembers): Merged this with RealFindMembers().
16067         This function will never be called from TypeManager.MemberLookup()
16068         so we can't use the cache here, just the IMemberFinder.
16069         (TypeManager.MemberLookup_FindMembers): Check whether the
16070         IMemberFinder has a MemberCache and call the cache's FindMembers
16071         function.
16072         (MemberCache): Rewrote larger parts of this yet another time and
16073         cleaned it up a bit.
16074
16075 2002-08-15  Miguel de Icaza  <miguel@ximian.com>
16076
16077         * driver.cs (LoadArgs): Support quoting.
16078
16079         (Usage): Show the CSC-like command line arguments.
16080
16081         Improved a few error messages.
16082
16083 2002-08-15  Martin Baulig  <martin@gnome.org>
16084
16085         * typemanager.cs (IMemberContainer.Type): New property.
16086         (IMemberContainer.IsInterface): New property.
16087
16088         The following changes are conditional to BROKEN_RUNTIME, which is
16089         defined at the top of the file.
16090
16091         * typemanager.cs (MemberCache.MemberCache): Don't add the base
16092         class'es members, but add all members from TypeHandle.ObjectType
16093         if we're an interface.
16094         (MemberCache.AddMembers): Set the Declared flag if member.DeclaringType
16095         is the current type.
16096         (MemberCache.CacheEntry.Container): Removed this field.
16097         (TypeHandle.GetMembers): Include inherited members.
16098
16099 2002-08-14  Gonzalo Paniagua Javier <gonzalo@ximian.com>
16100
16101         * typemanager.cs: fixed compilation and added a comment on a field that
16102         is never used.
16103
16104 2002-08-15  Martin Baulig  <martin@gnome.org>
16105
16106         * class.cs (ConstructorInitializer.Resolve): In the
16107         Expression.MemberLookup call, use the queried_type as
16108         invocation_type.
16109
16110         * typemanager.cs (IMemberContainer.GetMembers): Removed the `bool
16111         declared' attribute, it's always true.
16112         (IMemberContainer.Parent, IMemberContainer.Name): New properties.
16113         (TypeManager.MemberLookup_FindMembers): [FIXME FIXME FIXME] Added
16114         temporary wrapper for FindMembers which tells MemberLookup whether
16115         members from the base classes are included in the return value.
16116         This will go away soon.
16117         (TypeManager.MemberLookup): Use this temporary hack here; once the
16118         new MemberCache is completed, we don't need to do the DeclaredOnly
16119         looping here anymore since the MemberCache will take care of this.
16120         (TypeManager.IsSubclassOrNestedChildOf): Allow `type == parent'.
16121         (MemberCache): When creating the MemberCache for a class, get
16122         members from the current class and all its base classes.
16123         (MemberCache.CacheEntry.Container): New field.  This is a
16124         temporary hack until the Mono runtime is fixed to distinguish
16125         between ReflectedType and DeclaringType.  It allows us to use MCS
16126         with both the MS runtime and the unfixed Mono runtime without
16127         problems and without accecting performance.
16128         (MemberCache.SearchMembers): The DeclaredOnly looping from
16129         TypeManager.MemberLookup is now done here.      
16130
16131 2002-08-14  Martin Baulig  <martin@gnome.org>
16132
16133         * statement.cs (MyStructInfo.MyStructInfo): Don't call
16134         Type.GetFields on dynamic types but get the fields from the
16135         corresponding TypeContainer.
16136         (MyStructInfo.GetStructInfo): Added check for enum types.
16137
16138         * typemanager.cs (MemberList.IsSynchronized): Implemented.
16139         (MemberList.SyncRoot): Implemented.
16140         (TypeManager.FilterWithClosure): No need to check permissions if
16141         closure_start_type == closure_invocation_type, don't crash if
16142         closure_invocation_type is null.
16143
16144 2002-08-13  Martin Baulig  <martin@gnome.org>
16145
16146         Rewrote TypeContainer.FindMembers to use a member cache.  This
16147         gives us a speed increase of about 35% for the self-hosting MCS
16148         build and of about 15-20% for the class libs (both on GNU/Linux).
16149
16150         * report.cs (Timer): New class to get enhanced profiling.  This
16151         whole class is "TIMER" conditional since it remarkably slows down
16152         compilation speed.
16153
16154         * class.cs (MemberList): New class.  This is an IList wrapper
16155         which we're now using instead of passing MemberInfo[]'s around to
16156         avoid copying this array unnecessarily.
16157         (IMemberFinder.FindMember): Return a MemberList, not a MemberInfo [].
16158         (ICachingMemberFinder, IMemberContainer): New interface.
16159         (TypeManager.FilterWithClosure): If `criteria' is null, the name
16160         has already been checked, otherwise use it for the name comparision.
16161         (TypeManager.FindMembers): Renamed to RealMemberFinder and
16162         provided wrapper which tries to use ICachingMemberFinder.FindMembers
16163         if possible.  Returns a MemberList, not a MemberInfo [].
16164         (TypeHandle): New class, implements IMemberContainer.  We create
16165         one instance of this class per type, it contains a MemberCache
16166         which is used to do the member lookups.
16167         (MemberCache): New class.  Each instance of this class contains
16168         all members of a type and a name-based hash table.
16169         (MemberCache.FindMembers): This is our new member lookup
16170         function.  First, it looks up all members of the requested name in
16171         the hash table.  Then, it walks this list and sorts out all
16172         applicable members and returns them.
16173
16174 2002-08-13  Martin Baulig  <martin@gnome.org>
16175
16176         In addition to a nice code cleanup, this gives us a performance
16177         increase of about 1.4% on GNU/Linux - not much, but it's already
16178         half a second for the self-hosting MCS compilation.
16179
16180         * typemanager.cs (IMemberFinder): New interface.  It is used by
16181         TypeManager.FindMembers to call FindMembers on a TypeContainer,
16182         Enum, Delegate or Interface.
16183         (TypeManager.finder_to_member_finder): New PtrHashtable.
16184         (TypeManager.finder_to_container): Removed.
16185         (TypeManager.finder_to_delegate): Removed.
16186         (TypeManager.finder_to_interface): Removed.
16187         (TypeManager.finder_to_enum): Removed.
16188
16189         * interface.cs (Interface): Implement IMemberFinder.
16190
16191         * delegate.cs (Delegate): Implement IMemberFinder.
16192
16193         * enum.cs (Enum): Implement IMemberFinder.
16194
16195         * class.cs (TypeContainer): Implement IMemberFinder.
16196
16197 2002-08-12  Martin Baulig  <martin@gnome.org>
16198
16199         * ecore.cs (TypeExpr.DoResolveType): Mark this as virtual.
16200
16201 2002-08-12  Martin Baulig  <martin@gnome.org>
16202
16203         * ecore.cs (ITypeExpression): New interface for expressions which
16204         resolve to a type.
16205         (TypeExpression): Renamed to TypeLookupExpression.
16206         (Expression.DoResolve): If we're doing a types-only lookup, the
16207         expression must implement the ITypeExpression interface and we
16208         call DoResolveType() on it.
16209         (SimpleName): Implement the new ITypeExpression interface.
16210         (SimpleName.SimpleNameResolve): Removed the ec.OnlyLookupTypes
16211         hack, the situation that we're only looking up types can't happen
16212         anymore when this method is called.  Moved the type lookup code to
16213         DoResolveType() and call it.
16214         (SimpleName.DoResolveType): This ITypeExpression interface method
16215         is now doing the types-only lookup.
16216         (TypeExpr, TypeLookupExpression): Implement ITypeExpression.
16217         (ResolveFlags): Added MaskExprClass.
16218
16219         * expression.cs (MemberAccess): Implement the ITypeExpression
16220         interface.
16221         (MemberAccess.DoResolve): Added support for a types-only lookup
16222         when we're called via ITypeExpression.DoResolveType().
16223         (ComposedCast): Implement the ITypeExpression interface.
16224
16225         * codegen.cs (EmitContext.OnlyLookupTypes): Removed.  Call
16226         Expression.Resolve() with ResolveFlags.Type instead.
16227
16228 2002-08-12  Martin Baulig  <martin@gnome.org>
16229
16230         * interface.cs (Interface.Define): Apply attributes.
16231
16232         * attribute.cs (Attribute.ApplyAttributes): Added support for
16233         interface attributes.
16234
16235 2002-08-11  Martin Baulig  <martin@gnome.org>
16236
16237         * statement.cs (Block.Emit): Only check the "this" variable if we
16238         do not always throw an exception.
16239
16240         * ecore.cs (PropertyExpr.DoResolveLValue): Implemented, check
16241         whether the property has a set accessor.
16242
16243 2002-08-11  Martin Baulig  <martin@gnome.org>
16244
16245         Added control flow analysis support for structs.
16246
16247         * ecore.cs (ResolveFlags): Added `DisableFlowAnalysis' to resolve
16248         with control flow analysis turned off.
16249         (IVariable): New interface.
16250         (SimpleName.SimpleNameResolve): If MemberAccess.ResolveMemberAccess
16251         returns an IMemberExpr, call DoResolve/DoResolveLValue on it.
16252         (FieldExpr.DoResolve): Resolve the instance expression with flow
16253         analysis turned off and do the definite assignment check after the
16254         resolving when we know what the expression will resolve to.
16255
16256         * expression.cs (LocalVariableReference, ParameterReference):
16257         Implement the new IVariable interface, only call the flow analysis
16258         code if ec.DoFlowAnalysis is true.
16259         (This): Added constructor which takes a Block argument.  Implement
16260         the new IVariable interface.
16261         (MemberAccess.DoResolve, MemberAccess.DoResolveLValue): Call
16262         DoResolve/DoResolveLValue on the result of ResolveMemberLookup().
16263         This does the definite assignment checks for struct members.
16264
16265         * class.cs (Constructor.Emit): If this is a non-static `struct'
16266         constructor which doesn't have any initializer, call
16267         Block.AddThisVariable() to tell the flow analysis code that all
16268         struct elements must be initialized before control returns from
16269         the constructor.
16270
16271         * statement.cs (MyStructInfo): New public class.
16272         (UsageVector.this [VariableInfo vi]): Added `int field_idx'
16273         argument to this indexer.  If non-zero, check an individual struct
16274         member, not the whole struct.
16275         (FlowBranching.CheckOutParameters): Check struct members.
16276         (FlowBranching.IsVariableAssigned, SetVariableAssigned): Added
16277         overloaded versions of these methods which take an additional
16278         `int field_idx' argument to check struct members.
16279         (FlowBranching.IsParameterAssigned, SetParameterAssigned): Added
16280         overloaded versions of these methods which take an additional
16281         `string field_name' argument to check struct member.s
16282         (VariableInfo): Implement the IVariable interface.
16283         (VariableInfo.StructInfo): New public property.  Returns the
16284         MyStructInfo instance of the variable if it's a struct or null.
16285         (Block.AddThisVariable): New public method.  This is called from
16286         Constructor.Emit() for non-static `struct' constructor which do
16287         not have any initializer.  It creates a special variable for the
16288         "this" instance variable which will be checked by the flow
16289         analysis code to ensure that all of the struct's fields are
16290         initialized before control returns from the constructor.
16291         (UsageVector): Added support for struct members.  If a
16292         variable/parameter is a struct with N members, we reserve a slot
16293         in the usage vector for each member.  A struct is considered fully
16294         initialized if either the struct itself (slot 0) or all its
16295         members are initialized.
16296
16297 2002-08-08  Martin Baulig  <martin@gnome.org>
16298
16299         * driver.cs (Driver.MainDriver): Only report an error CS5001
16300         if there were no compilation errors.
16301
16302         * codegen.cs (EmitContext.EmitContext): Use the DeclSpace's
16303         `UnsafeContext' property to determine whether the parent is in
16304         unsafe context rather than checking the parent's ModFlags:
16305         classes nested in an unsafe class are unsafe as well.
16306
16307 2002-08-08  Martin Baulig  <martin@gnome.org>
16308
16309         * statement.cs (UsageVector.MergeChildren): Distinguish between
16310         `Breaks' and `Returns' everywhere, don't set `Breaks' anymore if
16311         we return.  Added test17() and test18() to test-154.cs.
16312
16313 2002-08-08  Martin Baulig  <martin@gnome.org>
16314
16315         * typemanager.cs (TypeManager.FilterWithClosure): If we have
16316         Family access, make sure the invoking type isn't a subclass of the
16317         queried type (that'd be a CS1540).
16318
16319         * ecore.cs (Expression.MemberLookup): Added overloaded version of
16320         this method which takes an additional `Type invocation_type'.
16321
16322         * expression.cs (BaseAccess.DoResolve): Use the base type as
16323         invocation and query type.
16324         (MemberAccess.DoResolve): If the lookup failed and we're about to
16325         report a CS0122, try a lookup with the ec.ContainerType - if this
16326         succeeds, we must report a CS1540.
16327
16328 2002-08-08  Martin Baulig  <martin@gnome.org>
16329
16330         * ecore.cs (IMemberExpr): Added `bool IsInstance' property.
16331         (MethodGroupExpr): Implement the IMemberExpr interface.
16332
16333         * expression (MemberAccess.ResolveMemberAccess): No need to have
16334         any special code for MethodGroupExprs anymore, they're now
16335         IMemberExprs.   
16336
16337 2002-08-08  Martin Baulig  <martin@gnome.org>
16338
16339         * typemanager.cs (TypeManager.FilterWithClosure): Check Assembly,
16340         Family, FamANDAssem and FamORAssem permissions.
16341         (TypeManager.IsSubclassOrNestedChildOf): New public method.
16342
16343 2002-08-08  Martin Baulig  <martin@gnome.org>
16344
16345         * statement.cs (FlowBranchingType): Added LOOP_BLOCK.
16346         (UsageVector.MergeChildren): `break' breaks unless we're in a switch
16347         or loop block.
16348
16349 Thu Aug 8 10:28:07 CEST 2002 Paolo Molaro <lupus@ximian.com>
16350
16351         * driver.cs: implemented /resource option to embed managed resources.
16352
16353 2002-08-07  Martin Baulig  <martin@gnome.org>
16354
16355         * class.cs (FieldBase.Initializer): Renamed to `init' and made private.
16356         (FieldBase.HasFieldInitializer): New public property.
16357         (FieldBase.GetInitializerExpression): New public method.  Resolves and
16358         returns the field initializer and makes sure it is only resolved once.
16359         (TypeContainer.EmitFieldInitializers): Call
16360         FieldBase.GetInitializerExpression to get the initializer, this ensures
16361         that it isn't resolved multiple times.
16362
16363         * codegen.cs (EmitContext): Added `bool IsFieldInitialier'.  This tells
16364         the resolving process (SimpleName/MemberLookup) that we're currently
16365         emitting a field initializer (which must not access any instance members,
16366         this is an error CS0236).
16367
16368         * ecore.cs (SimpleName.Error_ObjectRefRequired): Added EmitContext
16369         argument, if the `IsFieldInitializer' flag is set, we must report and
16370         error CS0236 and not an error CS0120.   
16371
16372 2002-08-07  Martin Baulig  <martin@gnome.org>
16373
16374         * ecore.cs (IMemberExpr): New public interface.
16375         (FieldExpr, PropertyExpr, EventExpr): Implement IMemberExpr.
16376         (SimpleName.SimpleNameResolve): Call MemberAccess.ResolveMemberAccess
16377         if the expression is an IMemberExpr.
16378
16379         * expression.cs (MemberAccess.ResolveMemberAccess): Allow `left'
16380         to be null, implicitly default to `this' if we're non-static in
16381         this case.  Simplified the code a lot by using the new IMemberExpr
16382         interface.  Also fixed bug #28176 here.
16383
16384 2002-08-06  Martin Baulig  <martin@gnome.org>
16385
16386         * cs-parser.jay (SimpleLookup): Removed.  We need to create
16387         ParameterReferences during semantic analysis so that we can do a
16388         type-only search when resolving Cast, TypeOf and SizeOf.
16389         (block): Pass the `current_local_parameters' to the Block's
16390         constructor.
16391
16392         * class.cs (ConstructorInitializer): Added `Parameters parameters'
16393         argument to the constructor.
16394         (ConstructorInitializer.Resolve): Create a temporary implicit
16395         block with the parameters.
16396
16397         * ecore.cs (SimpleName.SimpleNameResolve): Resolve parameter
16398         references here if we aren't doing a type-only search.
16399
16400         * statement.cs (Block): Added constructor which takes a
16401         `Parameters parameters' argument.
16402         (Block.Parameters): New public property.
16403
16404         * support.cs (InternalParameters.Parameters): Renamed `parameters'
16405         to `Parameters' and made it public readonly.
16406
16407 2002-08-06  Martin Baulig  <martin@gnome.org>
16408
16409         * ecore.cs (Expression.Warning): Made this public as well.
16410
16411         * report.cs (Report.Debug): Print the contents of collections.
16412
16413 2002-08-06  Martin Baulig  <martin@gnome.org>
16414
16415         * ecore.cs (Expression.ResolveFlags): New [Flags] enum.  This is
16416         used to tell Resolve() which kinds of expressions it may return.
16417         (Expression.Resolve): Added overloaded version of this method which
16418         takes a `ResolveFlags flags' argument.  This can be used to tell
16419         Resolve() which kinds of expressions it may return.  Reports a
16420         CS0118 on error.
16421         (Expression.ResolveWithSimpleName): Removed, use Resolve() with
16422         ResolveFlags.SimpleName.
16423         (Expression.Error118): Added overloaded version of this method which
16424         takes a `ResolveFlags flags' argument.  It uses the flags to determine
16425         which kinds of expressions are allowed.
16426
16427         * expression.cs (Argument.ResolveMethodGroup): New public method.
16428         Resolves an argument, but allows a MethodGroup to be returned.
16429         This is used when invoking a delegate.
16430
16431         * TODO: Updated a bit.
16432
16433 2002-08-06  Gonzalo Paniagua Javier <gonzalo@ximian.com>
16434
16435         Fixed compilation with csc.
16436
16437         * ecore.cs: Expression.Error made public. Is this correct? Should
16438         Warning be made public too?
16439
16440         * expression.cs: use ea.Location instead of ea.loc.
16441         [FIXME:  Filed as bug #28607: MCS must report these errors.]
16442
16443 2002-08-06  Martin Baulig  <martin@gnome.org>
16444
16445         * ecore.cs (Expression.loc): Moved the location here instead of
16446         duplicating it in all derived classes.
16447         (Expression.Location): New public property.
16448         (Expression.Error, Expression.Warning): Made them non-static and
16449         removed the location argument.
16450         (Expression.Warning): Added overloaded version which takes an
16451         `int level' argument.
16452         (Expression.Error118): Make this non-static and removed the
16453         expression and location arguments.
16454         (TypeExpr): Added location argument to the constructor.
16455
16456         * expression.cs (StaticCallExpr): Added location argument to
16457         the constructor.
16458         (Indirection, PointerArithmetic): Likewise.
16459         (CheckedExpr, UnCheckedExpr): Likewise.
16460         (ArrayAccess, IndexerAccess, UserCast, ArrayPtr): Likewise.
16461         (StringPtr): Likewise.
16462
16463
16464 2002-08-05  Martin Baulig  <martin@gnome.org>
16465
16466         * expression.cs (BaseAccess.DoResolve): Actually report errors.
16467
16468         * assign.cs (Assign.DoResolve): Check whether the source
16469         expression is a value or variable.
16470
16471         * statement.cs (Try.Resolve): Set ec.InTry/InCatch/InFinally
16472         while resolving the corresponding blocks.
16473
16474         * interface.cs (Interface.GetInterfaceTypeByName): Actually report
16475         an error, don't silently return null.
16476
16477         * statement.cs (Block.AddVariable): Do the error reporting here
16478         and distinguish between CS0128 and CS0136.
16479         (Block.DoResolve): Report all unused labels (warning CS0164).
16480         (LabeledStatement): Pass the location to the constructor.
16481         (LabeledStatement.HasBeenReferenced): New property.
16482         (LabeledStatement.Resolve): Set it to true here.
16483
16484         * statement.cs (Return.Emit): Return success even after reporting
16485         a type mismatch error (CS0126 or CS0127), this is what csc does and
16486         it avoids confusing the users with any consecutive errors.
16487
16488 2002-08-05  Martin Baulig  <martin@gnome.org>
16489
16490         * enum.cs (Enum.LookupEnumValue): Catch circular definitions.
16491
16492         * const.cs (Const.LookupConstantValue): Catch circular definitions.
16493
16494         * expression.cs (MemberAccess.DoResolve): Silently return if an
16495         error has already been reported.
16496
16497         * ecore.cs (Expression.MemberLookupFinal): Silently return if an
16498         error has already been reported.
16499
16500 2002-08-05  Martin Baulig  <martin@gnome.org>
16501
16502         * statement.cs (UsageVector): Only initialize the `parameters'
16503         vector if we actually have any "out" parameters.
16504
16505 2002-08-05  Martin Baulig  <martin@gnome.org>
16506
16507         * expression.cs (Binary.ResolveOperator): When combining delegates,
16508         they must have the same type.
16509
16510 2002-08-05  Martin Baulig  <martin@gnome.org>
16511
16512         * typemanager.cs (TypeManager.GetArgumentTypes): Don't call
16513         PropertyInfo.GetIndexParameters() on dynamic types, this doesn't
16514         work with the ms runtime and we also don't need it: if we're a
16515         PropertyBuilder and not in the `indexer_arguments' hash, then we
16516         are a property and not an indexer.
16517
16518         * class.cs (TypeContainer.AsAccessible): Use Type.IsArray,
16519         Type.IsPointer and Type.IsByRef instead of Type.HasElementType
16520         since the latter one doesn't work with the ms runtime.
16521
16522 2002-08-03  Martin Baulig  <martin@gnome.org>
16523
16524         Fixed bugs #27998 and #22735.
16525
16526         * class.cs (Method.IsOperator): New public field.
16527         (Method.CheckBase): Report CS0111 if there's already a method
16528         with the same parameters in the current class.  Report CS0508 when
16529         attempting to change the return type of an inherited method.
16530         (MethodData.Emit): Report CS0179 if a method doesn't have a body
16531         and it's not marked abstract or extern.
16532         (PropertyBase): New abstract base class for Property and Indexer.
16533         (PropertyBase.CheckBase): Moved here from Property and made it work
16534         for indexers.
16535         (PropertyBase.Emit): Moved here from Property.Emit, Indexer.Emit is
16536         the same so we can reuse it there.
16537         (Property, Indexer): Derive from PropertyBase.
16538         (MethodSignature.inheritable_property_signature_filter): New delegate
16539         to find properties and indexers.
16540
16541         * decl.cs (MemberCore.CheckMethodAgainstBase): Added `string name'
16542         argument and improved error reporting.
16543
16544         * parameter.cs (Parameters.GetEmptyReadOnlyParameters): Renamed to
16545         EmptyReadOnlyParameters and made it a property.
16546
16547         * typemanager.cs (TypeManager.GetArgumentTypes): Added overloaded
16548         version of this method which takes a `PropertyInfo indexer'.
16549         (TypeManager.RegisterIndexer): New method.
16550
16551         * class.cs: Added myself as author of this file :-)
16552
16553 2002-08-03  Gonzalo Paniagua Javier <gonzalo@ximian.com>
16554
16555         * class.cs: fixed compilation on windoze.
16556
16557 2002-08-03  Martin Baulig  <martin@gnome.org>
16558
16559         * interface.cs (Interface.GetInterfaceBases): Check whether all
16560         base interfaces are at least as accessible than the current one.
16561
16562         * class.cs (TypeContainer.GetClassBases): Check whether base types
16563         are at least as accessible than the current type.
16564         (TypeContainer.AsAccessible): Implemented and made non-static.
16565         (MemberBase.CheckParameters): Report errors if the accessibility
16566         checks fail.
16567
16568         * delegate.cs (Delegate.Delegate): The default visibility is
16569         internal for top-level types and private for nested types.
16570         (Delegate.Define): Report errors if the accessibility checks fail.
16571
16572         * enum.cs (Enum.Enum): The default visibility is internal for
16573         top-level types and private for nested types.
16574         (Enum.DefineType): Compute the correct visibility.
16575
16576         * modifiers.cs (Modifiers.TypeAttr): Added a version of this
16577         function which takes a `bool is_toplevel' instead of a TypeContainer.
16578
16579         * typemanager.cs (TypeManager.IsBuiltinType): `void' is also a
16580         builtin type.
16581
16582 2002-08-02  Martin Baulig  <martin@gnome.org>
16583
16584         * expression.cs (LocalVariableReferenc): Added constructor which
16585         takes additional `VariableInfo vi' and `bool is_readonly' arguments.
16586         (LocalVariableReference.IsReadOnly): New property.
16587         (LocalVariableReference.DoResolveLValue): Report a CS1604 if the
16588         variable is readonly, use our own readonly flag to do this; you can
16589         use the new constructor to get a writable reference to a read-only
16590         variable.
16591
16592         * cs-parser.jay (foreach_statement, using_statement): Get a writable
16593         reference to the local variable.
16594
16595 2002-08-01  Miguel de Icaza  <miguel@ximian.com>
16596
16597         * rootcontext.cs (ResolveCore): Also include System.Exception
16598
16599         * statement.cs (Block.Emit): Do not emit the dead-code warnings if
16600         we reach an EmptyStatement.
16601
16602         (Catch.DoResolve, Throw.DoResolve): Throwing the System.Exception
16603         is also fine.
16604
16605         * expression.cs (Binary.ResolveOperator): Check error result in
16606         two places.
16607
16608         use brtrue/brfalse directly and avoid compares to null.
16609
16610 2002-08-02  Martin Baulig  <martin@gnome.org>
16611
16612         * class.cs (TypeContainer.Define): Define all nested interfaces here.
16613         Fixes bug #28407, added test-155.cs.
16614
16615 2002-08-01  Martin Baulig  <martin@gnome.org>
16616
16617         * class.cs (Event.EmitDefaultMethod): Make this work with static
16618         events.  Fixes #28311, added verify-3.cs.
16619
16620 2002-08-01  Martin Baulig  <martin@gnome.org>
16621
16622         * statement.cs (ForeachHelperMethods): Added `enumerator_type' and
16623         `is_disposable' fields.
16624         (Foreach.GetEnumeratorFilter): Set `hm.enumerator_type' and
16625         `hm.is_disposable' if we're using the collection pattern.
16626         (Foreach.EmitCollectionForeach): Use the correct type for the
16627         enumerator's local variable, only emit the try/finally block if
16628         necessary (fixes #27713).
16629
16630 2002-08-01  Martin Baulig  <martin@gnome.org>
16631
16632         * ecore.cs (Expression.report118): Renamed to Error118 and made
16633         it public static.
16634
16635         * statement.cs (Throw.Resolve): Check whether the expression is of
16636         the correct type (CS0118) and whether the type derives from
16637         System.Exception (CS0155).
16638         (Catch.Resolve): New method.  Do the type lookup here and check
16639         whether it derives from System.Exception (CS0155).
16640         (Catch.CatchType, Catch.IsGeneral): New public properties.
16641
16642         * typemanager.cs (TypeManager.exception_type): Added.
16643
16644 2002-07-31  Miguel de Icaza  <miguel@ximian.com>
16645
16646         * driver.cs: Updated About function.
16647
16648 2002-07-31  Martin Baulig  <martin@gnome.org>
16649
16650         Implemented Control Flow Analysis.
16651
16652         * codegen.cs (EmitContext.DoFlowAnalysis): New public variable.
16653         (EmitContext.CurrentBranching): Added.
16654         (EmitContext.StartFlowBranching): Added.
16655         (EmitContext.EndFlowBranching): Added.
16656         (EmitContext.KillFlowBranching): Added.
16657         (EmitContext.IsVariableAssigned): Added.
16658         (EmitContext.SetVariableAssigned): Added.
16659         (EmitContext.IsParameterAssigned): Added.
16660         (EmitContext.SetParameterAssigned): Added.
16661         (EmitContext.EmitTopBlock): Added `InternalParameters ip' argument.
16662         Added control flow analysis stuff here.
16663
16664         * expression.cs (Unary.DoResolve): If the operator is Oper.AddressOf,
16665         resolve the expression as lvalue.
16666         (LocalVariableReference.DoResolve): Check whether the variable has
16667         already been assigned.
16668         (ParameterReference.DoResolveLValue): Override lvalue resolve to mark
16669         the parameter as assigned here.
16670         (ParameterReference.DoResolve): Check whether the parameter has already
16671         been assigned.
16672         (Argument.Resolve): If it's a `ref' or `out' argument, resolve the
16673         expression as lvalue.
16674
16675         * statement.cs (FlowBranching): New class for the flow analysis code.
16676         (Goto): Resolve the label in Resolve, not in Emit; added flow analysis.
16677         (LabeledStatement.IsDefined): New public property.
16678         (LabeledStatement.AddUsageVector): New public method to tell flow
16679         analyis that the label may be reached via a forward jump.
16680         (GotoCase): Lookup and resolve the label in Resolve, not in Emit; added
16681         flow analysis.
16682         (VariableInfo.Number): New public field.  This is used by flow analysis
16683         to number all locals of a block.
16684         (Block.CountVariables): New public property.  This is the number of
16685         local variables in this block (including the locals from all parent
16686         blocks).
16687         (Block.EmitMeta): Number all the variables.
16688
16689         * statement.cs: Added flow analysis support to all classes.
16690
16691 2002-07-31  Martin Baulig  <martin@gnome.org>
16692
16693         * driver.cs: Added "--mcs-debug" argument if MCS_DEBUG is defined.
16694         To get debugging messages, compile mcs with /define:MCS_DEBUG and
16695         then use this argument.
16696
16697         * report.cs (Report.Debug): Renamed to conditional to "MCS_DEBUG".
16698
16699         * makefile.gnu (MCS_FLAGS): Include $(MCS_DEFINES), the user may
16700         use this to specify /define options.
16701
16702 2002-07-29  Martin Baulig  <martin@gnome.org>
16703
16704         * statement.cs (Fixed): Moved all code that does variable lookups
16705         and resolvings from Emit to Resolve.
16706
16707         * statement.cs (For): Moved all code that does variable lookups
16708         and resolvings from Emit to Resolve.
16709
16710         * statement.cs (Using): Moved all code that does variable lookups
16711         and resolvings from Emit to Resolve.
16712
16713 2002-07-29  Martin Baulig  <martin@gnome.org>
16714
16715         * attribute.cs (Attribute.Resolve): Explicitly catch a
16716         System.NullReferenceException when creating the
16717         CustromAttributeBuilder and report a different warning message.
16718
16719 2002-07-29  Martin Baulig  <martin@gnome.org>
16720
16721         * support.cs (ParameterData.ParameterName): Added method to
16722         get the name of a parameter.
16723
16724         * typemanager.cs (TypeManager.IsValueType): New public method.
16725
16726 2002-07-29  Martin Baulig  <martin@gnome.org>
16727
16728         * parameter.cs (Parameter.Modifier): Added `ISBYREF = 8'.  This
16729         is a flag which specifies that it's either ref or out.
16730         (Parameter.GetParameterInfo (DeclSpace, int, out bool)): Changed
16731         the out parameter to `out Parameter.Modifier mod', also set the
16732         Parameter.Modifier.ISBYREF flag on it if it's either ref or out.
16733
16734         * support.cs (InternalParameters.ParameterModifier): Distinguish
16735         between Parameter.Modifier.OUT and Parameter.Modifier.REF, set the
16736         Parameter.Modifier.ISBYREF flag if it's either ref or out.
16737
16738         * expression.cs (Argument.GetParameterModifier): Distinguish
16739         between Parameter.Modifier.OUT and Parameter.Modifier.REF, set the
16740         Parameter.Modifier.ISBYREF flag if it's either ref or out.
16741
16742 2002-07-29  Martin Baulig  <martin@gnome.org>
16743
16744         * expression.cs (ParameterReference.ParameterReference): Added
16745         `Location loc' argument to the constructor.
16746
16747         * cs-parser.jay: Pass location to ParameterReference.
16748
16749 2002-07-28  Miguel de Icaza  <miguel@ximian.com>
16750
16751         * statement.cs (Try): Initialize the location.
16752
16753         * cs-parser.jay: pass location to Try.
16754
16755         * expression.cs (Unary.Reduce): Change the prototype to return
16756         whether a constant fold could be performed or not.  The result is
16757         returned in an out parameters.  In the case of Indirection and
16758         AddressOf, we want to perform the full tests.
16759
16760 2002-07-26  Miguel de Icaza  <miguel@ximian.com>
16761
16762         * statement.cs (Statement.Emit): Flag dead code.
16763
16764 2002-07-27  Andrew Birkett  <andy@nobugs.org>
16765
16766         * expression.cs (Unary.Reduce): Handle AddressOf and Indirection.
16767
16768 2002-07-27  Martin Baulig  <martin@gnome.org>
16769
16770         * class.cs (MethodData.Define): Put back call to
16771         TypeManager.AddMethod(), accidentally commented this out.
16772
16773         * report.cs (Debug): New public method to print debugging information,
16774         this is `[Conditional ("DEBUG")]'.
16775
16776 2002-07-26  Martin Baulig  <martin@gnome.org>
16777
16778         * cs-parser.jay (CSharpParser): Added `Stack switch_stack'.
16779         (switch_statement): Push the current_block to the switch_stack and
16780         pop it again when we're done with the switch.
16781         (switch_section): The new block is a child of the current_block.
16782         Fixes bug #24007, added test-152.cs.
16783
16784 2002-07-27  Martin Baulig  <martin@gnome.org>
16785
16786         * expression.cs (Invocation.EmitArguments): When calling a varargs
16787         function with only its fixed arguments, we need to pass an empty
16788         array.
16789
16790 2002-07-27  Martin Baulig  <martin@gnome.org>
16791
16792         Mono 0.13 has been released.
16793
16794 2002-07-25  Miguel de Icaza  <miguel@ximian.com>
16795
16796         * driver.cs: Rename --resource to --linkres, because that is what
16797         we do currently, we dont support --resource yet.
16798
16799         * cs-tokenizer.cs: Fix test for reporting endif mismatches.
16800
16801 2002-07-25  Martin Baulig  <martin@gnome.org>
16802
16803         * class.cs (MethodData): New public class.  This is a `method builder'
16804         class for a method or one accessor of a Property/Indexer/Event.
16805         (MethodData.GetMethodFlags): Moved here from MemberBase.
16806         (MethodData.ApplyAttributes): Likewise.
16807         (MethodData.ApplyObsoleteAttribute): Likewise.
16808         (MethodData.ApplyConditionalAttribute): Likewise.
16809         (MethodData.ApplyDllImportAttribute): Likewise.
16810         (MethodData.CheckAbstractAndExternal): Likewise.
16811         (MethodData.Define): Formerly knows as MemberBase.DefineMethod().
16812         (MethodData.Emit): Formerly known as Method.Emit().
16813         (MemberBase): Moved everything which was specific to a single
16814         accessor/method to MethodData.
16815         (Method): Create a new MethodData and call Define() and Emit() on it.
16816         (Property, Indexer, Event): Create a new MethodData objects for each
16817         accessor and call Define() and Emit() on them.
16818
16819 2002-07-25  Martin Baulig  <martin@gnome.org>
16820
16821         Made MethodCore derive from MemberBase to reuse the code from there.
16822         MemberBase now also checks for attributes.
16823
16824         * class.cs (MethodCore): Derive from MemberBase, not MemberCore.
16825         (MemberBase.GetMethodFlags): Moved here from class Method and marked
16826         as virtual.
16827         (MemberBase.DefineAccessor): Renamed to DefineMethod(), added
16828         `CallingConventions cc' and `Attributes opt_attrs' arguments.
16829         (MemberBase.ApplyAttributes): New virtual method; applies the
16830         attributes to a method or accessor.
16831         (MemberBase.ApplyObsoleteAttribute): New protected virtual method.
16832         (MemberBase.ApplyConditionalAttribute): Likewise.
16833         (MemberBase.ApplyDllImportAttribute): Likewise.
16834         (MemberBase.CheckAbstractAndExternal): Likewise.
16835         (MethodCore.ParameterTypes): This is now a property instead of a
16836         method, it's initialized from DoDefineParameters().
16837         (MethodCore.ParameterInfo): Removed the set accessor.
16838         (MethodCore.DoDefineParameters): New protected virtual method to
16839         initialize ParameterTypes and ParameterInfo.
16840         (Method.GetReturnType): We can now simply return the MemberType.
16841         (Method.GetMethodFlags): Override the MemberBase version and add
16842         the conditional flags.
16843         (Method.CheckBase): Moved some code from Define() here, call
16844         DoDefineParameters() here.
16845         (Method.Define): Use DoDefine() and DefineMethod() from MemberBase
16846         here to avoid some larger code duplication.
16847         (Property.Emit, Indexer.Emit): Call CheckAbstractAndExternal() to
16848         ensure that abstract and external accessors don't declare a body.
16849
16850         * attribute.cs (Attribute.GetValidPieces): Make this actually work:
16851         `System.Attribute.GetCustomAttributes (attr.Type)' does a recursive
16852         lookup in the attribute's parent classes, so we need to abort as soon
16853         as we found the first match.
16854         (Attribute.Obsolete_GetObsoleteMessage): Return the empty string if
16855         the attribute has no arguments.
16856
16857         * typemanager.cs (TypeManager.AddMethod): Now takes a MemberBase instead
16858         of a Method.
16859
16860 2002-07-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
16861
16862         * cs-parser.jay: reverted previous patch.
16863
16864 2002-07-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
16865
16866         * cs-parser.jay: fixed bug #22119.
16867
16868 2002-07-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
16869
16870         * attribute.cs: fixed compilation. The error was:
16871         "attribute.cs(571,17): error CS0177: The out parameter 'is_error' must 
16872         be assigned to before control leaves the current method."
16873         [FIXME:  Filed as bug #28186: MCS must report this error.]
16874
16875 2002-07-25  Martin Baulig  <martin@gnome.org>
16876
16877         * attribute.cs (Attribute.Conditional_GetConditionName): New static
16878         method to pull the condition name ouf of a Conditional attribute.
16879         (Attribute.Obsolete_GetObsoleteMessage): New static method to pull
16880         the obsolete message and error flag out of an Obsolete attribute.
16881
16882         * class.cs (Method.GetMethodFlags): New public method to get the
16883         TypeManager.MethodFlags for this method.
16884         (Method.ApplyConditionalAttribute, Method.ApplyObsoleteAttribute): New
16885         private methods.
16886         (Method.Define): Get and apply the Obsolete and Conditional attributes;
16887         if we're overriding a virtual function, set the new private variable
16888         `parent_method'; call the new TypeManager.AddMethod().
16889
16890         * typemanager.cs (TypeManager.AddMethod): New static method.  Stores
16891         the MethodBuilder and the Method in a PtrHashtable.
16892         (TypeManager.builder_to_method): Added for this purpose.
16893         (TypeManager.MethodFlags): Added IsObsoleteError.
16894         (TypeManager.GetMethodFlags): Added `Location loc' argument.  Lookup
16895         Obsolete and Conditional arguments in MethodBuilders.  If we discover
16896         an Obsolete attribute, emit an appropriate warning 618 / error 619 with
16897         the message from the attribute.
16898
16899 2002-07-24  Martin Baulig  <martin@gnome.org>
16900
16901         * cs-tokenizer.cs: Eat up trailing whitespaces and one-line comments in
16902         preprocessor directives, ensure that the argument to #define/#undef is
16903         exactly one identifier and that it's actually an identifier.
16904
16905         Some weeks ago I did a `#define DEBUG 1' myself and wondered why this
16906         did not work ....
16907
16908 2002-07-24  Martin Baulig  <martin@gnome.org>
16909
16910         * statement.cs (Foreach.ForeachHelperMethods): Added `Type element_type',
16911         initialize it to TypeManager.object_type in the constructor.
16912         (Foreach.GetEnumeratorFilter): Set `hm.element_type' to the return type
16913         of the `hm.get_current' method if we're using the collection pattern.
16914         (Foreach.EmitCollectionForeach): Use `hm.element_type' as the source type
16915         for the explicit conversion to make it work when we're using the collection
16916         pattern and the `Current' property has a different return type than `object'.
16917         Fixes #27713.
16918
16919 2002-07-24  Martin Baulig  <martin@gnome.org>
16920
16921         * delegate.cs (Delegate.VerifyMethod): Simply return null if the method
16922         does not match, but don't report any errors.  This method is called in
16923         order for all methods in a MethodGroupExpr until a matching method is
16924         found, so we don't want to bail out if the first method doesn't match.
16925         (NewDelegate.DoResolve): If none of the methods in the MethodGroupExpr
16926         matches, report the 123.  Fixes #28070.
16927
16928 2002-07-24  Martin Baulig  <martin@gnome.org>
16929
16930         * expression.cs (ArrayAccess.EmitStoreOpcode): Moved the
16931         TypeManager.TypeToCoreType() to the top of the method so the
16932         following equality checks will work.  Fixes #28107.
16933
16934 2002-07-24  Martin Baulig  <martin@gnome.org>
16935
16936         * cfold.cs (ConstantFold.DoConstantNumericPromotions): "If either
16937         operand is of type uint, and the other operand is of type sbyte,
16938         short or int, the operands are converted to type long." -
16939         Actually do what this comment already told us.  Fixes bug #28106,
16940         added test-150.cs.
16941
16942 2002-07-24  Martin Baulig  <martin@gnome.org>
16943
16944         * class.cs (MethodBase): New abstract class.  This is now a base
16945         class for Property, Indexer and Event to avoid some code duplication
16946         in their Define() and DefineMethods() methods.
16947         (MethodBase.DoDefine, MethodBase.DefineAccessor): Provide virtual
16948         generic methods for Define() and DefineMethods().
16949         (FieldBase): Derive from MemberBase, not MemberCore.
16950         (Property): Derive from MemberBase, not MemberCore.
16951         (Property.DefineMethod): Moved all the code from this method to the
16952         new MethodBase.DefineAccessor(), just call it with appropriate
16953         argumetnts.
16954         (Property.Define): Call the new Property.DoDefine(), this does some
16955         sanity checks and we don't need to duplicate the code everywhere.
16956         (Event): Derive from MemberBase, not MemberCore.
16957         (Event.Define): Use the new MethodBase.DefineAccessor() to define the
16958         accessors, this will also make them work with interface events.
16959         (Indexer): Derive from MemberBase, not MemberCore.
16960         (Indexer.DefineMethod): Removed, call MethodBase.DefineAccessor() insstead.
16961         (Indexer.Define): Use the new MethodBase functions.
16962
16963         * interface.cs (InterfaceEvent.InterfaceEvent): Added `Location loc'
16964         argument to the constructor.
16965         (Interface.FindMembers): Added support for interface events.
16966         (Interface.PopluateEvent): Implemented.
16967
16968         Added test-149.cs for this.  This also fixes bugs #26067 and #24256.
16969
16970 2002-07-22  Miguel de Icaza  <miguel@ximian.com>
16971
16972         * class.cs (TypeContainer.AddMethod): Adding methods do not use IsValid,
16973         but this is required to check for a method name being the same as
16974         the containing class.  
16975
16976         Handle this now.
16977
16978 2002-07-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
16979
16980         * interface.cs: initialize variable.
16981
16982 2002-07-23  Martin Baulig  <martin@gnome.org>
16983
16984         Implemented the IndexerName attribute in interfaces.
16985
16986         * class.cs (TypeContainer.DefineIndexers): Don't set the indexer
16987         name if this is an explicit interface implementation.
16988         (Indexer.InterfaceIndexerName): New public variable.  If we're
16989         implementing an interface indexer, this is the IndexerName in that
16990         interface.  Otherwise, it's the IndexerName.
16991         (Indexer.DefineMethod): If we're implementing interface indexer,
16992         set InterfaceIndexerName.  Use the new Pending.IsInterfaceIndexer
16993         and Pending.ImplementIndexer methods.
16994         (Indexer.Define): Also define the PropertyBuilder if we're
16995         implementing an interface indexer and this is neither an explicit
16996         interface implementation nor do the IndexerName match the one in
16997         the interface.
16998
16999         * pending.cs (TypeAndMethods): Added `MethodInfo [] need_proxy'.
17000         If a method is defined here, then we always need to create a proxy
17001         for it.  This is used when implementing interface indexers.
17002         (Pending.IsInterfaceIndexer): New public method.
17003         (Pending.ImplementIndexer): New public method.
17004         (Pending.InterfaceMethod): Added `MethodInfo need_proxy' argument.
17005         This is used when implementing interface indexers to define a proxy
17006         if necessary.
17007         (Pending.VerifyPendingMethods): Look in the `need_proxy' array and
17008         define a proxy if necessary.
17009
17010         * interface.cs (Interface.IndexerName): New public variable.
17011         (Interface.PopulateIndexer): Set the IndexerName.
17012         (Interface.DefineIndexers): New private method.  Populate all the
17013         indexers and make sure their IndexerNames match.
17014
17015         * typemanager.cs (IndexerPropertyName): Added support for interface
17016         indexers.
17017
17018 2002-07-22  Martin Baulig  <martin@gnome.org>
17019
17020         * codegen.cs (EmitContext.HasReturnLabel): New public variable.
17021         (EmitContext.EmitTopBlock): Always mark the ReturnLabel and emit a
17022         ret if HasReturnLabel.
17023         (EmitContext.TryCatchLevel, LoopBeginTryCatchLevel): New public
17024         variables.
17025
17026         * statement.cs (Do.Emit, While.Emit, For.Emit, Foreach.Emit): Save
17027         and set the ec.LoopBeginTryCatchLevel.
17028         (Try.Emit): Increment the ec.TryCatchLevel while emitting the block.
17029         (Continue.Emit): If the ec.LoopBeginTryCatchLevel is smaller than
17030         the current ec.TryCatchLevel, the branch goes out of an exception
17031         block.  In this case, we need to use Leave and not Br.
17032
17033 2002-07-22  Martin Baulig  <martin@gnome.org>
17034
17035         * statement.cs (Try.Emit): Emit an explicit ret after the end of the
17036         block unless the block does not always return or it is contained in
17037         another try { ... } catch { ... } block.  Fixes bug #26506.
17038         Added verify-1.cs to the test suite.
17039
17040 2002-07-22  Martin Baulig  <martin@gnome.org>
17041
17042         * statement.cs (Switch.TableSwitchEmit): If we don't have a default,
17043         then we do not always return.  Fixes bug #24985.
17044
17045 2002-07-22  Martin Baulig  <martin@gnome.org>
17046
17047         * expression.cs (Invocation.OverloadedResolve): Do the BetterFunction()
17048         lookup on a per-class level; ie. walk up the class hierarchy until we
17049         found at least one applicable method, then choose the best among them.
17050         Fixes bug #24463 and test-29.cs.
17051
17052 2002-07-22  Martin Baulig  <martin@gnome.org>
17053
17054         * typemanager.cs (TypeManager.ArrayContainsMethod): Don't check the
17055         return types of the methods.  The return type is not part of the
17056         signature and we must not check it to make the `new' modifier work.
17057         Fixes bug #27999, also added test-147.cs.
17058         (TypeManager.TypeToCoreType): Added TypeManager.type_type.
17059
17060         * expression.cs (Invocation.DoResolve): Call TypeManager.TypeToCoreType()
17061         on the method's return type.
17062
17063 2002-07-21  Martin Baulig  <martin@gnome.org>
17064
17065         * assign.cs: Make this work if the rightmost source is a constant and
17066         we need to do an implicit type conversion.  Also adding a few more tests
17067         to test-38.cs which should have caught this.
17068
17069         * makefile.gnu: Disable debugging, there's already the mcs-mono2.exe
17070         target in the makefile for this.  The makefile.gnu is primarily intended
17071         for end-users who don't want to debug the compiler.
17072
17073 2002-07-21  Martin Baulig  <martin@gnome.org>
17074
17075         * assign.cs: Improved the Assign class so it can now handle embedded
17076         assignments (X = Y = Z = something).  As a side-effect this'll now also
17077         consume less local variables.  test-38.cs now passes with MCS, added
17078         a few new test cases to that test.
17079
17080 2002-07-20  Martin Baulig  <martin@gnome.org>
17081
17082         * expression.cs (Binary.EmitBranchable): Emit correct unsigned branch
17083         instructions.  Fixes bug #27977, also added test-146.cs.
17084
17085 2002-07-19  Gonzalo Paniagua Javier <gonzalo@ximian.com>
17086
17087         * cs-tokenizer.cs: fixed getHex ().
17088
17089 2002-07-19  Martin Baulig  <martin@gnome.org>
17090
17091         * expression.cs (Invocation.EmitParams): Use TypeManager.LookupType(),
17092         not Type.GetType() to lookup the array type.  This is needed when
17093         we're constructing an array of a user-defined type.
17094         (ArrayAccess.EmitDynamicInitializers): Only emit the Ldelema for
17095         single-dimensional arrays, but also for single-dimensial arrays of
17096         type decimal.
17097
17098 2002-07-19  Martin Baulig  <martin@gnome.org>
17099
17100         * expression.cs (New.DoEmit): Create a new LocalTemporary each time
17101         this function is called, it's not allowed to share LocalBuilders
17102         among ILGenerators.
17103
17104 2002-07-19  Martin Baulig  <martin@gnome.org>
17105
17106         * expression.cs (Argument.Resolve): Report an error 118 when trying
17107         to pass a type as argument.
17108
17109 2002-07-18  Martin Baulig  <martin@gnome.org>
17110
17111         * ecore.cs (Expression.ImplicitNumericConversion): Don't emit a
17112         Conv_R_Un for the signed `long' type.
17113
17114 2002-07-15  Miguel de Icaza  <miguel@ximian.com>
17115
17116         * expression.cs (MemberAccess.DoResolve): Do not reuse the field
17117         `expr' for the temporary result, as that will fail if we do
17118         multiple resolves on the same expression.
17119
17120 2002-07-05  Miguel de Icaza  <miguel@ximian.com>
17121
17122         * ecore.cs (SimpleNameResolve): Use ec.DeclSpace instead of
17123         ec.TypeContainer for looking up aliases. 
17124
17125         * class.cs (TypeContainer): Remove LookupAlias from here.
17126
17127         * decl.cs (DeclSpace); Move here.
17128
17129 2002-07-01  Miguel de Icaza  <miguel@ximian.com>
17130
17131         * class.cs (FindMembers): Only call filter if the constructor
17132         bulider is not null.
17133
17134         Also handle delegates in `NestedTypes' now.  Now we will perform
17135         type lookups using the standard resolution process.  This also
17136         fixes a bug.
17137
17138         * decl.cs (DeclSpace.ResolveType): New type resolution routine.
17139         This uses Expressions (the limited kind that can be parsed by the
17140         tree) instead of strings.
17141
17142         * expression.cs (ComposedCast.ToString): Implement, used to flag
17143         errors since now we have to render expressions.
17144
17145         (ArrayCreation): Kill FormElementType.  Use ComposedCasts in
17146         FormArrayType. 
17147
17148         * ecore.cs (SimpleName.ToString): ditto.
17149
17150         * cs-parser.jay: Instead of using strings to assemble types, use
17151         Expressions to assemble the type (using SimpleName, ComposedCast,
17152         MemberAccess).  This should fix the type lookups in declarations,
17153         because we were using a different code path for this.
17154
17155         * statement.cs (Block.Resolve): Continue processing statements
17156         even when there is an error.
17157
17158 2002-07-17  Miguel de Icaza  <miguel@ximian.com>
17159
17160         * class.cs (Event.Define): Also remove the `remove' method from
17161         the list of pending items.
17162
17163         * expression.cs (ParameterReference): Use ldarg.N (0..3) to
17164         generate more compact code. 
17165
17166 2002-07-17  Martin Baulig  <martin@gnome.org>
17167
17168         * const.cs (Const.LookupConstantValue): Add support for constant
17169         `unchecked' and `checked' expressions.
17170         Also adding test case test-140.cs for this.
17171
17172 2002-07-17  Martin Baulig  <martin@gnome.org>
17173
17174         * statement.cs (Foreach.GetEnumeratorFilter): When compiling corlib,
17175         check whether mi.ReturnType implements the IEnumerator interface; the
17176         `==' and the IsAssignableFrom() will fail in this situation.
17177
17178 2002-07-16  Ravi Pratap  <ravi@ximian.com>
17179
17180         * ecore.cs (SimpleName.SimpleNameResolve) : Apply Gonzalo's fix 
17181         here too.
17182
17183 2002-07-16  Gonzalo Paniagua Javier <gonzalo@ximian.com>
17184
17185         * expression.cs: fixed bug #27811.
17186
17187 2002-07-14  Miguel de Icaza  <miguel@ximian.com>
17188
17189         * expression.cs (ParameterReference.AddressOf): Patch from Paolo
17190         Molaro: when we are a ref, the value already contains a pointer
17191         value, do not take the address of it.
17192
17193 2002-07-14 Rafael Teixeira <rafaelteixeirabr@hotmail.com>
17194         * removed mb-parser.jay and mb-tokenizer.cs
17195
17196 Sat Jul 13 19:38:03 CEST 2002 Paolo Molaro <lupus@ximian.com>
17197
17198         * expression.cs: check against the building corlib void type.
17199
17200 Sat Jul 13 19:35:58 CEST 2002 Paolo Molaro <lupus@ximian.com>
17201
17202         * ecore.cs: fix for valuetype static readonly fields: when 
17203         initializing them, we need their address, not the address of a copy.
17204
17205 Sat Jul 13 17:32:53 CEST 2002 Paolo Molaro <lupus@ximian.com>
17206
17207         * typemanager.cs: register also enum_type in corlib.
17208
17209 Sat Jul 13 15:59:47 CEST 2002 Paolo Molaro <lupus@ximian.com>
17210
17211         * class.cs: allow calling this (but not base) initializers in structs.
17212
17213 Sat Jul 13 15:12:06 CEST 2002 Paolo Molaro <lupus@ximian.com>
17214
17215         * ecore.cs: make sure we compare against the building base types
17216         in GetTypeSize ().
17217
17218 Sat Jul 13 15:10:32 CEST 2002 Paolo Molaro <lupus@ximian.com>
17219
17220         * typemanager.cs: fix TypeToCoreType() to handle void and object
17221         (corlib gets no more typerefs after this change).
17222
17223 2002-07-12  Miguel de Icaza  <miguel@ximian.com>
17224
17225         * expression.cs (ArrayCreation.EmitArrayArguments): use
17226         Conv.Ovf.U4 for unsigned and Conv.Ovf.I4 for signed.
17227
17228         (ArrayAccess.LoadArrayAndArguments): Use Conv_Ovf_I and
17229         Conv_Ovf_I_Un for the array arguments.  Even if C# allows longs as
17230         array indexes, the runtime actually forbids them.
17231
17232         * ecore.cs (ExpressionToArrayArgument): Move the conversion code
17233         for array arguments here.
17234
17235         * expression.cs (EmitLoadOpcode): System.Char is a U2, use that
17236         instead of the default for ValueTypes.
17237
17238         (New.DoEmit): Use IsValueType instead of
17239         IsSubclassOf (value_type)
17240         (New.DoResolve): ditto.
17241         (Invocation.EmitCall): ditto.
17242
17243         * assign.cs (Assign): ditto.
17244
17245         * statement.cs (Unsafe): Ok, so I got the semantics wrong.
17246         Statements *are* currently doing part of their resolution during
17247         Emit.  
17248
17249         Expressions do always resolve during resolve, but statements are
17250         only required to propagate resolution to their children.
17251
17252 2002-07-11  Miguel de Icaza  <miguel@ximian.com>
17253
17254         * driver.cs (CSCParseOption): Finish the /r: and /lib: support.
17255
17256         (LoadAssembly): Do not add the dll if it is already specified
17257
17258         (MainDriver): Add the System directory to the link path at the end,
17259         after all the other -L arguments. 
17260
17261         * expression.cs (ArrayAccess.EmitLoadOpcode): I was using the
17262         wrong opcode for loading bytes and bools (ldelem.i1 instead of
17263         ldelem.u1) and using the opposite for sbytes.
17264
17265         This fixes Digger, and we can finally run it.
17266
17267         * driver.cs (UnixParseOption): Move the option parsing here.  
17268         (CSCParseOption): Implement CSC-like parsing of options.
17269
17270         We now support both modes of operation, the old Unix way, and the
17271         new CSC-like way.  This should help those who wanted to make cross
17272         platform makefiles.
17273
17274         The only thing broken is that /r:, /reference: and /lib: are not
17275         implemented, because I want to make those have the same semantics
17276         as the CSC compiler has, and kill once and for all the confussion
17277         around this.   Will be doing this tomorrow.
17278
17279         * statement.cs (Unsafe.Resolve): The state is checked during
17280         resolve, not emit, so we have to set the flags for IsUnsfe here.
17281
17282 2002-07-10  Miguel de Icaza  <miguel@ximian.com>
17283
17284         * expression.cs (MemberAccess.ResolveMemberAccess): Since we can
17285         not catch the Error_ObjectRefRequired in SimpleName (as it is
17286         possible to have a class/instance variable name that later gets
17287         deambiguated), we have to check this here.      
17288
17289 2002-07-10  Ravi Pratap  <ravi@ximian.com>
17290
17291         * class.cs (TypeContainer.GetFieldFromEvent): Move away from here,
17292         make static and put into Expression.
17293
17294         (Event.Define): Register the private field of the event with the 
17295         TypeManager so that GetFieldFromEvent can get at it.
17296
17297         (TypeManager.RegisterPrivateFieldOfEvent): Implement to
17298         keep track of the private field associated with an event which
17299         has no accessors.
17300
17301         (TypeManager.GetPrivateFieldOfEvent): Implement to get at the
17302         private field.
17303
17304         * ecore.cs (GetFieldFromEvent): RE-write to use the above methods.
17305
17306 2002-07-10  Miguel de Icaza  <miguel@ximian.com>
17307
17308         * expression.cs (Binary.EmitBranchable): this routine emits the
17309         Binary expression in a branchable context.  This basically means:
17310         we need to branch somewhere, not just get the value on the stack.
17311
17312         This works together with Statement.EmitBoolExpression.
17313
17314         * statement.cs (Statement.EmitBoolExpression): Use
17315         EmitBranchable. 
17316
17317 2002-07-09  Miguel de Icaza  <miguel@ximian.com>
17318
17319         * statement.cs (For): Reduce the number of jumps in loops.
17320
17321         (For): Implement loop inversion for the For statement.
17322
17323         (Break): We can be breaking out of a Try/Catch controlled section
17324         (foreach might have an implicit try/catch clause), so we need to
17325         use Leave instead of Br.
17326
17327         * ecore.cs (FieldExpr.AddressOf): Fix for test-139 (augmented
17328         now).  If the instace expression supports IMemoryLocation, we use
17329         the AddressOf method from the IMemoryLocation to extract the
17330         address instead of emitting the instance.
17331
17332         This showed up with `This', as we were emitting the instance
17333         always (Emit) instead of the Address of This.  Particularly
17334         interesting when This is a value type, as we dont want the Emit
17335         effect (which was to load the object).
17336
17337 2002-07-08  Miguel de Icaza  <miguel@ximian.com>
17338
17339         * attribute.cs: Pass the entry point to the DefinePInvokeMethod
17340
17341         * statement.cs (Checked): Set the CheckedState during the resolve
17342         process too, as the ConvCast operations track the checked state on
17343         the resolve process, and not emit.
17344
17345         * cs-parser.jay (namespace_member_declaration): Flag that we have
17346         found a declaration when we do.  This is used to flag error 1529
17347
17348         * driver.cs: Report ok when we display the help only.
17349
17350 2002-07-06  Andrew Birkett  <adb@tardis.ed.ac.uk>
17351
17352         * cs-tokenizer.cs (xtoken): Improve handling of string literals.
17353
17354 2002-07-04  Miguel de Icaza  <miguel@ximian.com>
17355
17356         * cs-tokenizer.cs (define): We also have to track locally the
17357         defines.  AllDefines is just used for the Conditional Attribute,
17358         but we also need the local defines for the current source code. 
17359
17360 2002-07-03  Miguel de Icaza  <miguel@ximian.com>
17361
17362         * statement.cs (While, For, Do): These loops can exit through a
17363         Break statement, use this information to tell whether the
17364         statement is the last piece of code.
17365
17366         (Break): Flag that we break.
17367
17368         * codegen.cs (EmitContexts): New `Breaks' state variable.
17369
17370 2002-07-03  Martin Baulig  <martin@gnome.org>
17371
17372         * class.cs (TypeContainer.MethodModifiersValid): Allow override
17373         modifiers in method declarations in structs.  Otherwise, you won't
17374         be able to override things like Object.Equals().
17375
17376 2002-07-02  Miguel de Icaza  <miguel@ximian.com>
17377
17378         * class.cs (Method, Property, Indexer): Do not allow the public
17379         modifier to be used in explicit interface implementations.
17380
17381         (TypeContainer.MethodModifiersValid): Catch virtual, abstract and
17382         override modifiers in method declarations in structs
17383
17384 2002-07-02   Andrew Birkett <adb@tardis.ed.ac.uk>
17385
17386         * cs-tokenizer.cs (adjust_int, adjust_real): Do not abort on
17387         integer or real overflow, report an error
17388
17389 2002-07-02  Martin Baulig  <martin@gnome.org>
17390
17391         * typemanager.cs (TypeManager.InitCoreTypes): When compiling
17392         corlib, dynamically call AssemblyBuilder.SetCorlibTypeBuilders()
17393         to tell the runtime about our newly created System.Object and
17394         System.ValueType types.
17395
17396 2002-07-02  Miguel de Icaza  <miguel@ximian.com>
17397
17398         * expression.cs (This): Use Stobj/Ldobj when we are a member of a
17399         struct instead of Ldarg/Starg.
17400
17401 2002-07-02  Martin Baulig  <martin@gnome.org>
17402
17403         * expression.cs (Indirection.Indirection): Call
17404         TypeManager.TypeToCoreType() on `expr.Type.GetElementType ()'.
17405
17406 2002-07-02  Martin Baulig  <martin@gnome.org>
17407
17408         * expression.cs (ArrayAccess.EmitStoreOpcode): If the type is a
17409         ValueType, call TypeManager.TypeToCoreType() on it.
17410         (Invocations.EmitParams): Call TypeManager.TypeToCoreType() on
17411         the OpCodes.Newarr argument.
17412
17413 2002-07-02  Martin Baulig  <martin@gnome.org>
17414
17415         * expression.cs (Invocation.EmitCall): When compiling corlib,
17416         replace all calls to the system's System.Array type to calls to
17417         the newly created one.
17418
17419         * typemanager.cs (TypeManager.InitCodeHelpers): Added a few more
17420         System.Array methods.
17421         (TypeManager.InitCoreTypes): When compiling corlib, get the methods
17422         from the system's System.Array type which must be replaced.
17423
17424 Tue Jul 2 19:05:05 CEST 2002 Paolo Molaro <lupus@ximian.com>
17425
17426         * typemanager.cs: load unverifiable_code_ctor so we can build
17427         corlib using the correct type. Avoid using GetTypeCode() with
17428         TypeBuilders.
17429         * rootcontext.cs: uses TypeManager.unverifiable_code_ctor and
17430         TypeManager.object_type to allow building corlib.
17431
17432 Tue Jul 2 19:03:19 CEST 2002 Paolo Molaro <lupus@ximian.com>
17433
17434         * ecore.cs: handle System.Enum separately in LoadFromPtr().
17435
17436 2002-07-01  Martin Baulig  <martin@gnome.org>
17437
17438         * class.cs: Make the last change actually work, we need to check
17439         whether `ifaces != null' to avoid a crash.
17440
17441 Mon Jul 1 16:15:03 CEST 2002 Paolo Molaro <lupus@ximian.com>
17442
17443         * class.cs: when we build structs without fields that implement
17444         interfaces, we need to add the interfaces separately, since there is
17445         no API to both set the size and add the interfaces at type creation
17446         time.
17447
17448 Mon Jul 1 14:50:47 CEST 2002 Paolo Molaro <lupus@ximian.com>
17449
17450         * expression.cs: the dimension arguments to the array constructors
17451         need to be converted if they are a long.
17452
17453 Mon Jul 1 12:26:12 CEST 2002 Paolo Molaro <lupus@ximian.com>
17454
17455         * class.cs: don't emit ldarg.0 if there is no parent constructor
17456         (fixes showstopper for corlib).
17457
17458 2002-06-29  Martin Baulig  <martin@gnome.org>
17459
17460         MCS now compiles corlib on GNU/Linux :-)
17461
17462         * attribute.cs (Attribute.ApplyAttributes): Treat Accessors like Method,
17463         ie. check for MethodImplOptions.InternalCall.
17464
17465         * class.cs (TypeContainer.DefineType): When compiling corlib, both parent
17466         and TypeManager.attribute_type are null, so we must explicitly check
17467         whether parent is not null to find out whether it's an attribute type.
17468         (Property.Emit): Always call Attribute.ApplyAttributes() on the GetBuilder
17469         and SetBuilder, not only if the property is neither abstract nor external.
17470         This is necessary to set the MethodImplOptions on the accessor methods.
17471         (Indexer.Emit): Call Attribute.ApplyAttributes() on the GetBuilder and
17472         SetBuilder, see Property.Emit().
17473
17474         * rootcontext.cs (RootContext.PopulateTypes): When compiling corlib, don't
17475         populate "System.Object", "System.ValueType" and "System.Attribute" since
17476         they've already been populated from BootCorlib_PopulateCoreTypes().
17477
17478 2002-06-29  Martin Baulig  <martin@gnome.org>
17479
17480         * ecore.cs (Expression.ImplicitReferenceConversionExists): If expr
17481         is the NullLiteral, we also need to make sure that target_type is not
17482         an enum type.   
17483
17484 2002-06-29  Martin Baulig  <martin@gnome.org>
17485
17486         * rootcontext.cs (RootContext.ResolveCore): We must initialize
17487         `TypeManager.multicast_delegate_type' and `TypeManager.delegate_type'
17488         before calling BootstrapCorlib_ResolveDelegate ().
17489
17490 2002-06-27  Gonzalo Paniagua Javier <gonzalo@ximian.com>
17491
17492         * statement.cs: fixed build-breaker. All tests passed ok.
17493
17494 2002-06-27  Martin Baulig  <martin@gnome.org>
17495
17496         * typemanager.cs (TypeManager.VerifyUnManaged): Added explicit check
17497         for System.Decimal when compiling corlib.
17498
17499 2002-06-27  Martin Baulig  <martin@gnome.org>
17500
17501         * statement.cs (Switch.TableSwitchEmit): Make this work with empty
17502         switch blocks which contain nothing but a default clause.
17503
17504 2002-06-26  Andrew  <adb@tardis.ed.ac.uk>
17505
17506        * ../errors/cs1501-3.cs: Added new test for struct ctr typechecks.
17507
17508 2002-06-27  Martin Baulig  <martin@gnome.org>
17509
17510         * ecore.cs (PropertyExpr.PropertyExpr): Call
17511         TypeManager.TypeToCoreType() on the `pi.PropertyType'.
17512
17513         * typemanager.cs (TypeManager.TypeToCoreType): Return if the type
17514         is already a TypeBuilder.
17515
17516 2002-06-27  Martin Baulig  <martin@gnome.org>
17517
17518         * ecore.cs (Expression.ImplicitReferenceConversionExists): Use
17519         `target_type == TypeManager.array_type', not IsAssignableFrom() in
17520         the "from an array-type to System.Array" case.  This makes it work
17521         when compiling corlib.
17522
17523 2002-06-27  Martin Baulig  <martin@gnome.org>
17524
17525         * ecore.cs (Expression.SimpleNameResolve): If the expression is a
17526         non-static PropertyExpr, set its InstanceExpression.  This makes
17527         the `ICollection.Count' property work in System/Array.cs.
17528
17529 2002-06-25  Andrew Birkett  <adb@tardis.ed.ac.uk>
17530
17531         * driver.cs: Made error handling more consistent.  Errors now
17532         tracked by Report class, so many methods which used to return int
17533         now return void.  Main() now prints success/failure and 
17534         errors/warnings message.
17535
17536         Renamed '--probe' compiler argument to '--expect-error'.  Removed
17537         the magic number return values (123 and 124).  Now, if the
17538         expected error occurs, the compiler exits with success (exit value
17539         0).  If the compilation completes without seeing that particular
17540         error, the compiler exits with failure (exit value 1).  The
17541         makefile in mcs/errors has been changed to handle the new behaviour.
17542
17543         * report.cs: Made 'expected error' number a property and renamed
17544         it from 'Probe' to 'ExpectedError'.
17545
17546         * genericparser.cs: Removed error handling support, since it is
17547         now all done by Report class.
17548
17549         * cs-parser.jay, mb-parser.jay: Errors are tracked by Report
17550         class, so parse() no longer returns an int.
17551
17552         * namespace.cs: Use Report.Error instead of GenericParser.error
17553
17554 2002-06-22  Miguel de Icaza  <miguel@ximian.com>
17555
17556         * class.cs (TypeContainer.AddMethod, TypeContainer.AddIndexer,
17557         TypeContainer.AddOperator): At the front of the list put the
17558         explicit implementations, so they get resolved/defined first. 
17559
17560 2002-06-21  Miguel de Icaza  <miguel@ximian.com>
17561
17562         * class.cs (TypeContainer.VerifyImplements): Verifies that a given
17563         interface type is implemented by this TypeContainer.  Used during
17564         explicit interface implementation.
17565
17566         (Property.Define, Indexer.Define, Method.Define): Validate that
17567         the given interface in the explicit implementation is one of the
17568         base classes for the containing type.
17569
17570         Also if we are explicitly implementing an interface, but there is
17571         no match in the pending implementation table, report an error.
17572
17573         (Property.Define): Only define the property if we are
17574         not explicitly implementing a property from an interface.  Use the
17575         correct name also for those properties (the same CSC uses,
17576         although that is really not needed).
17577
17578         (Property.Emit): Do not emit attributes for explicitly implemented
17579         properties, as there is no TypeBuilder.
17580
17581         (Indexer.Emit): ditto.
17582
17583         Hiding then means that we do not really *implement* a pending
17584         implementation, which makes code fail.
17585
17586 2002-06-22  Martin Baulig  <martin@gnome.org>
17587
17588         * ecore.cs (Expression.Constantify): Call TypeManager.TypeToCoreType() on
17589         the return value of Object.GetType().  [FIXME: we need to do this whenever
17590         we get a type back from the reflection library].
17591
17592 Fri Jun 21 13:37:57 CEST 2002 Paolo Molaro <lupus@ximian.com>
17593
17594         * typemanager.cs: make ExpandInterfaces() slip duplicated interfaces.
17595
17596 2002-06-20  Miguel de Icaza  <miguel@ximian.com>
17597
17598         * attribute.cs: Return null if we can not look up the type.
17599
17600         * class.cs (TypeContainer.GetClassBases): Use ExpandInterfaces on
17601         the interface types found.
17602
17603         * interface.cs (Interface.GetInterfaceBases): Use ExpandInterfaces on the
17604         interface types found.
17605
17606         * typemanager.cs (GetInterfaces): Make this routine returns alll
17607         the interfaces and work around the lame differences between
17608         System.Type and System.Reflection.Emit.TypeBuilder in the results
17609         result for GetInterfaces.
17610
17611         (ExpandInterfaces): Given an array of interface types, expand and
17612         eliminate repeated ocurrences of an interface.  This expands in
17613         context like: IA; IB : IA; IC : IA, IB; the interface "IC" to
17614         be IA, IB, IC.
17615
17616 2002-06-21  Martin Baulig  <martin@gnome.org>
17617
17618         * typemanager.cs (TypeManager.EnumToUnderlying): It's now safe to call this function
17619         on System.Enum.
17620
17621 2002-06-21  Martin Baulig  <martin@gnome.org>
17622
17623         * typemanager.cs (TypeManager.TypeToCoreType): New function.  When compiling corlib
17624         and called with one of the core types, return the corresponding typebuilder for
17625         that type.
17626
17627         * expression.cs (ArrayAccess.DoResolve): Call TypeManager.TypeToCoreType() on the
17628         element type.
17629
17630 2002-06-21  Martin Baulig  <martin@gnome.org>
17631
17632         * ecore.cs (Expression.ExplicitReferenceConversionExists): Use
17633         `target_type.IsArray' instead of `target_type.IsSubclassOf (TypeManager.array_type)'.
17634         (Expression.ConvertReferenceExplicit): Likewise.
17635
17636         * expression.cs (ElementAccess.DoResolve): Likewise.
17637         (ElementAccess.DoResolveLValue): Likewise.
17638
17639 2002-06-10  Martin Baulig  <martin@gnome.org>
17640
17641         * interface.cs (Interface.PopulateIndexer): When creating the setter, we need to
17642         add the "value" parameter to the parameter list.
17643
17644         * statement.cs (Fixed.Emit): Pass the return value of the child block's Emit()
17645         to our caller.
17646
17647 2002-06-19  Miguel de Icaza  <miguel@ximian.com>
17648
17649         * expression.cs (ArrayCreation.ExpressionToArrayArgument): Convert
17650         the argument to an int, uint, long or ulong, per the spec.  Also
17651         catch negative constants in array creation.
17652
17653 Thu Jun 20 17:56:48 CEST 2002 Paolo Molaro <lupus@ximian.com>
17654
17655         * class.cs: do not allow the same interface to appear twice in
17656         the definition list.
17657
17658 Wed Jun 19 22:33:37 CEST 2002 Paolo Molaro <lupus@ximian.com>
17659
17660         * ecore.cs: don't use ldlen with System.Array.
17661
17662 Wed Jun 19 20:57:40 CEST 2002 Paolo Molaro <lupus@ximian.com>
17663
17664         * ecore.cs: stobj requires a type argument. Handle indirect stores on enums.
17665
17666 Wed Jun 19 20:17:59 CEST 2002 Paolo Molaro <lupus@ximian.com>
17667
17668         * modifiers.cs: produce correct field attributes for protected
17669         internal. Easy fix so miguel can work on ther harder stuff:-)
17670
17671 2002-06-18  Miguel de Icaza  <miguel@ximian.com>
17672
17673         * pending.cs: New file.  Move the code from class.cs here.
17674         Support clearning the pending flag for all methods (when not doing
17675         explicit interface implementation).
17676
17677 Tue Jun 18 10:36:22 CEST 2002 Paolo Molaro <lupus@ximian.com>
17678
17679         * rootcontext.cs: added a couple more types needed to bootstrap.
17680
17681 2002-06-17  Miguel de Icaza  <miguel@ximian.com>
17682
17683         * typemanager.cs (GetConstructor): Use DeclaredOnly to look the
17684         constructor in the type, instead of any constructor in the type
17685         hierarchy.  Thanks to Paolo for finding this bug (it showed up as
17686         a bug in the Mono runtime when applying the params attribute). 
17687
17688 2002-06-16  Rafael Teixeira  <rafaelteixeirabr@hotmail.com>
17689         * changed namespace.cs to use "GenericParser.error(...)" instead of "CSharpParser.error(...)"
17690
17691 2002-06-14  Rachel Hestilow  <hestilow@ximian.com>
17692
17693         * expression.cs (Unary.ResolveOperator): Use TypeManager
17694         to resolve the type.
17695
17696 2002-06-13  Ravi Pratap  <ravi@ximian.com>
17697
17698         * cs-parser.jay (enum_member_declaration): Pass in the attributes
17699         attached.
17700
17701         * enum.cs (AddEnumMember): Add support to store the attributes associated 
17702         with each member too.
17703
17704         * attribute.cs (CheckAttribute, ApplyAttributes): Update to handle
17705         field builders too - this takes care of the enum member case.
17706
17707 2002-06-10  Rachel Hestilow  <hestilow@ximian.com>
17708
17709         * typemanager.cs (TypeManager.VerifyUnManaged): Allow
17710         address-of operator on both value types and pointers.
17711
17712 2002-06-10  Martin Baulig  <martin@gnome.org>
17713
17714         * interface.cs (Interface.PopulateIndexer): Add the indexer's
17715         PropertyBuilder to the `property_builders' list.
17716
17717         * expression.cs (Indexers.GetIndexersForTypeOrInterface): New private method.
17718         (Indexers.GetIndexersForType): Call GetIndexersForTypeOrInterface() on the
17719         `lookup_type' and all its interfaces.  Unfortunately, Type.FindMembers() won't
17720         find any indexers which are inherited from an interface.
17721
17722 2002-06-09  Martin Baulig  <martin@gnome.org>
17723
17724         * const.cs (Const.LookupConstantValue): Convert `Expr' to a literal of
17725         the same type as the constant if necessary.  There's also a test-130.cs
17726         for this.
17727
17728         * enum.cs (Enum.ChangeEnumType): Moved to typemanager.cs and made public.
17729
17730         * typemanager.cs (TypeManager.ChangeType): Previously known as
17731         Enum.ChangeEnumType().
17732
17733 2002-06-09  Martin Baulig  <martin@gnome.org>
17734
17735         * expression.cs (Cast.TryReduce): Added support for consts.
17736
17737 2002-06-08  Ravi Pratap  <ravi@ximian.com>
17738
17739         * class.cs (Accessor): Hold attributes information so we can pass
17740         it along.
17741
17742         * cs-parser.jay (get_accessor_declaration, set_accessor_declaration):
17743         Modify to pass in attributes attached to the methods.
17744
17745         (add_accessor_declaration, remove_accessor_declaration): Ditto.
17746
17747         * attribute.cs (ApplyAttributes, CheckAttribute): Update accordingly
17748         to handle the Accessor kind :-)
17749
17750         * class.cs (Property.Emit, Event.Emit): Apply attributes to the accessors
17751
17752 2002-06-08  Martin Baulig  <martin@gnome.org>
17753
17754         * expression.cs (Unary.TryReduceNegative): Added support for
17755         ULongConstants.
17756
17757 2002-06-08  Martin Baulig  <martin@gnome.org>
17758
17759         * enum.cs (Enum.LookupEnumValue): Don't report an error if the
17760         name can't be found in the `defined_names' - the caller will do a
17761         MemberLookup in this case and thus find methods in System.Enum
17762         such as Enum.IsDefined().
17763
17764 2002-06-08  Martin Baulig  <martin@gnome.org>
17765
17766         * enum.cs (Enum.ChangeEnumType): This is a custom version of
17767         Convert.ChangeType() which works with TypeBuilder created types.
17768         (Enum.LookupEnumValue, Enum.Define): Use it here.
17769
17770         * class.cs (TypeContainer.RegisterRequiredImplementations): Added
17771         `TypeBuilder.BaseType != null' check.
17772         (TypeContainer.FindMembers): Only lookup parent members if we
17773         actually have a parent.
17774         (Method.EmitDestructor): Added `ec.ContainerType.BaseType != null' check.
17775         (ConstructorInitializer.Resolve): Likewise.
17776
17777         * interface.cs (Interface.FindMembers): Added
17778         `TypeBuilder.BaseType != null' check.
17779
17780         * rootcontext.cs (RootContext.ResolveCore): Added
17781         "System.Runtime.CompilerServices.IndexerNameAttribute" to
17782         classes_second_stage.
17783
17784         * typemanager.cs (TypeManager.InitCoreTypes): Don't initialize
17785         debug_type and trace_type when compiling with --nostdlib.       
17786
17787 2002-06-07  Martin Baulig  <martin@gnome.org>
17788
17789         * class.cs (TypeContainer): Added `have_nonstatic_fields' field.
17790         (AddField): Set it to true when adding a non-static field.
17791         (DefineType): Use `have_nonstatic_fields' to find out whether we
17792         have non-static fields, not `Fields != null'.
17793
17794 2002-06-02  Miguel de Icaza  <miguel@ximian.com>
17795
17796         * ecore.cs (SimpleNameResolve): Removed simple bug (we were
17797         dereferencing a null on the static-field code path)
17798
17799 2002-05-30  Martin Baulig  <martin@gnome.org>
17800
17801         * codegen.cs (InitMonoSymbolWriter): Added `string[] args' argument
17802         to take command line arguments.  Use reflection to call the new
17803         custom `Initialize' function on the symbol writer and pass it the
17804         command line arguments.
17805
17806         * driver.cs (--debug-args): New command line argument to pass command
17807         line arguments to the symbol writer.
17808
17809 2002-05-28  Miguel de Icaza  <miguel@ximian.com>
17810
17811         * assign.cs (DoResolve): Forgot to do the implicit conversion to
17812         the target type for indexers and properties.  Thanks to Joe for
17813         catching this.
17814
17815 2002-05-27  Miguel de Icaza  <miguel@ximian.com>
17816
17817         * typemanager.cs (MethodFlags): returns the method flags
17818         (Obsolete/ShouldIgnore) that control warning emission and whether
17819         the invocation should be made, or ignored. 
17820
17821         * expression.cs (Invocation.Emit): Remove previous hack, we should
17822         not do this on matching a base type, we should do this based on an attribute
17823
17824         Only emit calls to System.Diagnostics.Debug and
17825         System.Diagnostics.Trace if the TRACE and DEBUG defines are passed
17826         on the command line.
17827
17828         * rootcontext.cs: Global settings for tracing and debugging.
17829
17830         * cs-tokenizer.cs (define): New utility function to track
17831         defines.   Set the global settings for TRACE and DEBUG if found.
17832
17833 2002-05-25  Ravi Pratap  <ravi@ximian.com>
17834
17835         * interface.cs (Populate*): Pass in the TypeContainer as well as
17836         the DeclSpace as parameters so that we can create EmitContexts and
17837         then use that to apply attributes etc.
17838
17839         (PopulateMethod, PopulateEvent, PopulateProperty)
17840         (PopulateIndexer): Apply attributes everywhere.
17841
17842         * attribute.cs (CheckAttribute): Include InterfaceMethod, InterfaceEvent
17843         etc.
17844
17845         (ApplyAttributes): Update accordingly.
17846
17847         We now apply interface attributes for all members too.
17848
17849 2002-05-26  Miguel de Icaza  <miguel@ximian.com>
17850
17851         * class.cs (Indexer.Define); Correctly check if we are explicit
17852         implementation (instead of checking the Name for a ".", we
17853         directly look up if the InterfaceType was specified).
17854
17855         Delay the creation of the PropertyBuilder.
17856
17857         Only create the PropertyBuilder if we are not an explicit
17858         interface implementation.   This means that explicit interface
17859         implementation members do not participate in regular function
17860         lookups, and hence fixes another major ambiguity problem in
17861         overload resolution (that was the visible effect).
17862
17863         (DefineMethod): Return whether we are doing an interface
17864         implementation. 
17865
17866         * typemanager.cs: Temporary hack until we get attributes in
17867         interfaces (Ravi is working on that) and we get IndexerName
17868         support in interfaces.
17869
17870         * interface.cs: Register the indexers as properties.
17871
17872         * attribute.cs (Attribute.Resolve): Catch the error, and emit a
17873         warning, I have verified that this is a bug in the .NET runtime
17874         (JavaScript suffers of the same problem).
17875
17876         * typemanager.cs (MemberLookup): When looking up members for
17877         interfaces, the parent of an interface is the implicit
17878         System.Object (so we succeed in searches of Object methods in an
17879         interface method invocation.  Example:  IEnumerable x;  x.ToString
17880         ()) 
17881
17882 2002-05-25  Miguel de Icaza  <miguel@ximian.com>
17883
17884         * class.cs (Event): Events should also register if they do
17885         implement the methods that an interface requires.
17886
17887         * typemanager.cs (MemberLookup); use the new GetInterfaces
17888         method. 
17889
17890         (GetInterfaces): The code used to lookup interfaces for a type is
17891         used in more than one place, factor it here. 
17892
17893         * driver.cs: Track the errors at the bottom of the file, we kept
17894         on going.
17895
17896         * delegate.cs (NewDelegate.Emit): We have to emit a null as the
17897         instance if the method we are calling is static!
17898
17899 2002-05-24  Miguel de Icaza  <miguel@ximian.com>
17900
17901         * attribute.cs (ApplyAttributes): Make this function filter out
17902         the IndexerName attribute (as that attribute in reality is never
17903         applied) and return the string constant for the IndexerName
17904         attribute. 
17905
17906         * class.cs (TypeContainer.Emit): Validate that all the indexers
17907         have the same IndexerName attribute, and if so, set the
17908         DefaultName attribute on the class. 
17909
17910         * typemanager.cs: The return value might contain other stuff (not
17911         only methods).  For instance, consider a method with an "Item"
17912         property and an Item method.
17913
17914         * class.cs: If there is a problem with the parameter types,
17915         return. 
17916
17917 2002-05-24  Ravi Pratap  <ravi@ximian.com>
17918
17919         * ecore.cs (ImplicitConversionExists): Wrapper function which also
17920         looks at user defined conversion after making a call to 
17921         StandardConversionExists - we need this for overload resolution.
17922
17923         * expression.cs : Update accordingly the various method calls.
17924
17925         This fixes 2 bugs filed against implicit user defined conversions 
17926
17927 2002-05-22  Miguel de Icaza  <miguel@ximian.com>
17928
17929         * statement.cs: Track the result of the assignment.
17930
17931 2002-05-21  Miguel de Icaza  <miguel@ximian.com>
17932
17933         * expression.cs (MemberAccess): Improved error reporting for
17934         inaccessible members.
17935
17936 2002-05-22  Martin Baulig  <martin@gnome.org>
17937
17938         * makefile (mcs-mono2.exe): New target.  This is mcs compiled with
17939         itself with debugging support.
17940
17941 2002-05-22  Martin Baulig  <martin@gnome.org>
17942
17943         * typemanager.cs ("System.Runtime.InteropServices.StructLayoutAttribute"):
17944         Removed, this isn't needed anymore.
17945
17946 2002-05-20  Martin Baulig  <martin@gnome.org>
17947
17948         * typemanager.cs (InitEnumUnderlyingTypes): "System.Char" can't
17949         be underlying type for an enum.
17950
17951 2002-05-20  Miguel de Icaza  <miguel@ximian.com>
17952
17953         * typemanager.cs (InitEnumUnderlyingTypes): New helper function
17954         that splits out the loading of just the core types.
17955
17956         * rootcontext.cs (ResolveCore): Split the struct resolution in
17957         two, so we can load the enumeration underlying types before any
17958         enums are used.
17959
17960         * expression.cs (Is): Bandaid until we fix properly Switch (see
17961         bug #24985 for details).
17962
17963         * typemanager.cs (ImplementsInterface): The hashtable will contain
17964         a null if there are no interfaces implemented.
17965
17966 2002-05-18  Miguel de Icaza  <miguel@ximian.com>
17967
17968         * cs-parser.jay (indexer_declarator): It is fine to have array
17969         parameters
17970
17971 2002-05-17  Miguel de Icaza  <miguel@ximian.com>
17972
17973         * typemanager.cs: (RegisterBuilder): New function used to register
17974         TypeBuilders that implement interfaces.  Since
17975         TypeBuilder.GetInterfaces (as usual) does not work with lame
17976         Reflection.Emit. 
17977         (AddUserType): register interfaces.
17978
17979         (ImplementsInterface): Use the builder_to_ifaces hash if we are
17980         dealing with TypeBuilder.  Also, arrays are showing up as
17981         SymbolTypes, which are not TypeBuilders, but whose GetInterfaces
17982         methods can not be invoked on them!
17983
17984         * ecore.cs (ExplicitReferenceConversionExists): Made public.
17985         (ImplicitReferenceConversionExists): Split out from
17986         StandardConversionExists. 
17987
17988         * expression.cs (As): We were only implementing one of the three
17989         cases for the as operator.  We now implement them all.
17990         (Is): Implement the various other cases for Is as well.
17991
17992         * typemanager.cs (CACHE): New define used to control if we want or
17993         not the FindMembers cache.  Seems to have a negative impact on
17994         performance currently
17995
17996         (MemberLookup): Nested types have full acess to
17997         enclosing type members
17998
17999         Remove code that coped with instance/static returns for events, we
18000         now catch this in RealFindMembers.
18001
18002         (RealFindMembers): only perform static lookup if the instance
18003         lookup did not return a type or an event.  
18004
18005 2002-05-17  Miguel de Icaza  <miguel@ximian.com>
18006
18007         * assign.cs (CompoundAssign): We pass more semantic information
18008         now to Compound Assignments than we did before: now we have all
18009         the information at hand, and now we resolve the target *before* we
18010         do the expression expansion, which allows the "CacheValue" method
18011         to have the effect we intended (before, a [x] += 1 would generate
18012         two differen ArrayAccess expressions from the ElementAccess,
18013         during the resolution process).
18014
18015         (CompoundAssign.DoResolve): Resolve target and original_source here.
18016
18017 2002-05-16  Miguel de Icaza  <miguel@ximian.com>
18018
18019         * expression.cs (ArrayAccess): dropped debugging information. 
18020
18021         * typemanager.cs: Small bug fix: I was always returning i_members,
18022         instead of one of i_members or s_members (depending on which had
18023         the content).
18024
18025         * assign.cs (IAssignMethod.CacheTemporaries): New method.  This
18026         method is invoked before any code generation takes place, and it
18027         is a mechanism to inform that the expression will be invoked more
18028         than once, and that the method should use temporary values to
18029         avoid having side effects
18030
18031         (Assign.Emit): Call CacheTemporaries in the IAssignMethod.
18032
18033         * ecore.cs (Expression.CacheTemporaries): Provide empty default
18034         implementation.
18035
18036         * expression.cs (Indirection, ArrayAccess): Add support for
18037         CacheTemporaries in these two bad boys. 
18038
18039         * ecore.cs (LoadFromPtr): figure out on our own if we need to use
18040         ldobj or ldind_ref.  
18041         (StoreFromPtr): Handle stobj as well.
18042
18043         * expression.cs (UnaryMutator): Share more code.
18044
18045         * typemanager.cs (FindMembers): Thanks to Paolo for tracking this
18046         down: I was not tracking the Filter function as well, which
18047         was affecting the results of the cache.
18048
18049 2002-05-15  Miguel de Icaza  <miguel@ximian.com>
18050
18051         * attribute.cs: Remove the hack to handle the CharSet property on
18052         StructLayouts. 
18053
18054 2002-05-14  Miguel de Icaza  <miguel@ximian.com>
18055
18056         * attribute.cs (DoResolve): More uglyness, we now only try to
18057         resolve the attribute partially, to extract the CharSet
18058         information (only if we are a StructLayout attribute).  Otherwise 
18059
18060         (GetExtraTypeInfo): Add some code to conditionally kill in the
18061         future this.   I am more and more convinced that the .NET
18062         framework has special code to handle the attribute setting on
18063         certain elements.
18064
18065         * expression.cs (IsParamsMethodApplicable): Revert my previous
18066         foreach change here, it was wrong.
18067
18068 2002-05-13  Miguel de Icaza  <miguel@ximian.com>
18069
18070         * cs-tokenizer.cs: (pp_primary): Eat the ')' at the end.
18071         (pp_expr): do not abort on unknown input, just return.
18072         (eval): abort if there are pending chars.
18073
18074         * attribute.cs (Attribute.Resolve): Positional parameters are
18075         optional.  Deal with that case.
18076
18077         * class.cs (DefineType): Call Attribute.GetExtraTypeInfo to fetch
18078         the Ansi/Unicode/Auto information for the type.
18079
18080         (TypeContainer.DefineType): instantiate the EmitContext here, as
18081         we will be using it during the type definition (to resolve
18082         attributes) and during the emit phase.
18083
18084         * attribute.cs (Attribute.GetExtraTypeInfo): This routine is used
18085         to pull type information out of the attributes
18086
18087         (Attribute.Resolve): track the constructor builder, and allow for
18088         multiple invocations (structs and classes will use this).
18089
18090         * ecore.cs (MemberLookupFinal): new version with all the
18091         parameters customizable.
18092
18093         * expression.cs (New.DoResolve): Use MemberLookupFinal to locate
18094         constructors.  Return if the result value is null (as the error
18095         would have been flagged already by MemberLookupFinal)
18096
18097         Do not allow instances of abstract classes or interfaces to be
18098         created.
18099
18100         * class.cs: (MethodSignature.InheritableMemberSignatureCompare):
18101         We have to compare the assembly property here when dealing with
18102         FamANDAssem and Assembly access modifiers, because we might be
18103         creating an assembly from *modules* (that means that we are not
18104         getting TypeBuilders for types defined in other modules that are
18105         part of this assembly).
18106
18107         (Method.Emit): If the method is marked abstract and has a body,
18108         emit an error. 
18109
18110         (TypeContainer.DefineMembers): If both the defined member and the
18111         parent name match are methods, then do not emit any warnings: let
18112         the Method.Define routine take care of flagging warnings.  But if
18113         there is a mismatch (method overrides something else, or method is
18114         overriwritten by something, then emit warning).
18115
18116         (MethodSignature.MemberSignatureCompare): If the sig.ret_type is
18117         set to null, this means `do not check for the return type on the
18118         signature'. 
18119
18120         (Method.Define): set the return type for the method signature to
18121         null, so that we get methods with the same name and parameters and
18122         different return types.  This is used to flag warning 114 (you are
18123         hiding a method, and you probably want to use the new/override
18124         keywords instead).
18125
18126         * typemanager.cs (MemberLookup): Implemented proper access
18127         control, closing a long standing set of bug reports.  The problem
18128         was that the Framework only has two bits: Public and NonPublic,
18129         and NonPublic includes private and protected methods, but we need
18130         to enforce the FamANDAssem, FamOrAssem and Family. 
18131
18132 2002-05-11  Miguel de Icaza  <miguel@ximian.com>
18133
18134         * statement.cs (GotoCase): Return true: Ammounts to giving up
18135         knowledge on whether we return or not, and letting the other case
18136         be responsible for it.
18137
18138 2002-05-10  Miguel de Icaza  <miguel@ximian.com>
18139
18140         * driver.cs: Do not load directories for each file processed, only
18141         do it if there is a pattern.
18142
18143         * ecore.cs: Report readonly assigns here as well, as we might have
18144         been resolved only by MemberAccess.
18145
18146         (SimpleName.SimpleNameResolve): Also be useful for LValue
18147         resolution.   We need this to propagate assign to local readonly variables
18148
18149         * typemanager.cs: Use a ptrhashtable for the criteria, because we
18150         do not want to reuse potential criteria memory.
18151
18152         * class.cs (MyEventBuilder): Set reflected_type;
18153
18154         * ecore.cs (Constantify): Added support for constifying bools.
18155
18156         (RootContext.LookupType): Added a cache for values looked up in
18157         the declaration space.
18158
18159         * typemanager.cs (FindMembers): Now is a front-end to
18160         RealFindMembers, and provides a two-level hashtable-based cache to
18161         the request.  
18162
18163         15% performance improvement: from 22.5 to 19.2 seconds.
18164
18165         * expression.cs (IsParamsMethodApplicable): use foreach.
18166         (Invocation.DoResolve): ditto.
18167         (New.DoResolve): ditto.
18168         (ArrayCreation.DoResolve): ditto.
18169
18170         * ecore.cs (FindMostEncompassingType): use foreach.
18171
18172         * delegate.cs (NewDelegate.DoResolve): Use foreach
18173
18174         * ecore.cs (Expression.FindMostSpecificSource): Use foreach.
18175         (RemoveMethods): use foreach.
18176
18177         * expression.cs (Invocation.MakeUnionSet): Optimization: Use two
18178         nested foreach statements instead of for, and also break out of
18179         the inner loop once a match is found.
18180
18181         (Invocation.OverloadResolve): Use foreach, simplify the code. 
18182
18183 2002-05-08  Miguel de Icaza  <miguel@ximian.com>
18184
18185         * cfold.cs (BinaryFold): During an enumeration evaluation context,
18186         we actually unwrap the expression to allow for extra information
18187         to be extracted. 
18188
18189         * expression.cs: Use Shr_Un on unsigned operations. 
18190
18191 2002-05-08  Ravi Pratap  <ravi@ximian.com>
18192
18193         * ecore.cs (FindMostEncompass*): Fix trivial bug where the set of 
18194         applicable operators was not being considered correctly. This closes
18195         the bug Miguel reported.
18196
18197 Wed May 8 16:40:50 CEST 2002 Paolo Molaro <lupus@ximian.com>
18198
18199         * attribute.cs: check that the type derives from System.Attribute
18200         and report the correct error in that case (moved the duplicate code to
18201         its own method, too).
18202
18203 Wed May 8 11:50:31 CEST 2002 Paolo Molaro <lupus@ximian.com>
18204
18205         * attribute.cs: lookup attribute type name as the spec says: first the
18206         bare attribute name and then name + "Attribute" (nant compiles with
18207         mcs after this fix).
18208
18209 2002-05-07  Miguel de Icaza  <miguel@ximian.com>
18210
18211         * expression.cs (Unary.TryReduceNegative): Ah!  Tricky!  Tricky!
18212         Because of the way we parse things, we should try to see if a
18213         UIntConstant can fit in an integer.
18214
18215 2002-05-07  Ravi Pratap  <ravi@ximian.com>
18216
18217         * ecore.cs (GetConversionOperators): Do not pick up op_True operators
18218         when we are in an explicit context.
18219
18220         (ConvertReferenceExplicit): When converting from Iface type S to Class
18221         T make sure the rules are implemented as an OR.
18222
18223         * parameter.cs (ParameterType): Make it a property for now although the
18224         purpose really isn't anything immediate.
18225
18226         * expression.cs (Is*Applicable): Do better checking on the parameter type
18227         of a ref/out parameter. The ones from the system assemblies are already 
18228         marked with the correct type so we don't need to do any correction.
18229
18230         * ecore.cs (StandardConversionExists): Conversion from Interface types to 
18231         the object type is standard too so include that.
18232
18233 2002-05-06  Miguel de Icaza  <miguel@ximian.com>
18234
18235         * ecore.cs (StandardConversionExists): Augment with missing code:
18236         deal with IntConstant, LongConstants and Enumerations.
18237
18238         * assign.cs: Report the error, instead of failing silently
18239
18240         * rootcontext.cs (AddGlobalAttributes): Track attributes on the
18241         typecontainer that they are declared, because the
18242         typecontainer/namespace will have the list of using clauses that
18243         need to be applied.
18244
18245         Assembly Attributes were escaping the normal registration
18246         mechanism. 
18247
18248         (EmitCode): Apply attributes within an EmitContext that represents
18249         the container they were declared on.
18250
18251         * cs-parser.jay: Track bases for structs.  How did I get this wrong?
18252
18253 2002-05-06  Ravi Pratap  <ravi@ximian.com>
18254
18255         * ecore.cs (FindMostEncompassingType, FindMostEncompassedType):
18256         Revamp completely - make much cleaner as we now operate only
18257         on a set of Types.
18258
18259         (FindMostSpecificSource, FindMostSpecificTarget): New methods
18260         to implement the logic detailed in the spec more correctly.
18261
18262         (UserDefinedConversion): Update accordingly.
18263
18264 2002-05-06  Miguel de Icaza  <miguel@ximian.com>
18265
18266         * statement.cs: Return flow analysis information up.
18267
18268         * cs-tokenizer.cs (adjust_real): Share code between LITERAL_DOUBLE
18269         and the default.
18270
18271         (token): Do not consume an extra character before calling
18272         decimal_digits.
18273
18274 2002-05-06  Piers Haken <piersh@friskit.com>
18275
18276         * cs-parser.jay: add 'override' attribute to System.Object.Finalize
18277
18278 2002-05-06  Miguel de Icaza  <miguel@ximian.com>
18279
18280         * class.cs (Constructor.Emit): Set the IsStatic flag in the
18281         EmitContext during the instance constructor initializer
18282         resolution, to stop access to instance variables.
18283
18284         This is mandated by the spec, last paragraph of the `constructor
18285         initializers' section. 
18286
18287 2002-05-05  Miguel de Icaza  <miguel@ximian.com>
18288
18289         * cs-parser.jay, class.cs (Accessor): new class used to represent
18290         an accessor (get or set).  In the past we used `null' to represent
18291         a missing accessor.  But this is ambiguous because there was no
18292         way to tell in abstract indexers/properties if one of them was
18293         specified.
18294
18295         Now there is a way of addressing that.
18296
18297         * expression.cs (Indexers.GetIndexersForType): Use TypeManager.MemberLookup
18298         instead of FindMembers.
18299
18300         * class.cs (TypeContainer.EmitFieldInitializer): Do not typecast
18301         the result of Assign.Resolve as Assign, but rather as ExpressionStatement.
18302
18303         * attribute.cs: Treat indexers and properties as the same in terms
18304         of applying attributes
18305
18306         * ecore.cs (FindMostEncompassedType): Use statically initialized
18307         EmptyExpressions()s like we do elsewhere to avoid creating useless
18308         objects (and we take this out of the tight loop).
18309
18310         (GetConversionOperators): Move the code to extract the actual
18311         operators to a separate routine to clean things up.
18312
18313 2002-05-04  Miguel de Icaza  <miguel@ximian.com>
18314
18315         * ecore.cs (FieldExpr): Remove un-needed tests for null, since now
18316         events are always registered FieldBuilders.
18317
18318         * class.cs (FieldBase): New class shared by Fields 
18319
18320         * delegate.cs: If we are a toplevel delegate, use our full name.
18321         If we are a nested delegate, then only use our tail name.
18322
18323 2002-05-02  Ravi Pratap  <ravi@ximian.com>
18324
18325         * expression.cs (IsApplicable): Ensure that we add the "&" to
18326         ref/out types before comparing it with the type of the argument.
18327
18328         (IsParamsMethodApplicable): Ditto.
18329
18330         (Argument.Type): Use TypeManager.LookupType instead of Type.GetType - 
18331         silly me ;-)
18332
18333         * delegate.cs : Handle the case when we have more than one applicable
18334         method. Flag an error only when we finish checking all.
18335
18336 2002-05-02  Miguel de Icaza  <miguel@ximian.com>
18337
18338         * expression.cs: Add support for boolean static initializers.
18339
18340 2002-05-01  Miguel de Icaza  <miguel@ximian.com>
18341
18342         * attribute.cs: Use proper cast for Events, since we use a MyEventBuilder.
18343
18344         * parameter.cs (ComputeParameterTypes,
18345         ComputeAndDefineParameterTypes): Better error handling: now we
18346         clear the `types' cache if we fail during any of the type lookups.
18347         We also return the status code correctly to our caller
18348
18349         * delegate.cs: If we fail to define a delegate, abort the extra
18350         steps. 
18351
18352         * expression.cs (Binary.ResolveOperator): for
18353         operator==(object,object) and operator !=(object, object) we also
18354         have to verify that there is an implicit conversion from one to
18355         the other.
18356
18357         (ArrayAccess.DoResolve): Array Access can operate on
18358         non-variables. 
18359
18360 2002-04-30  Miguel de Icaza  <miguel@ximian.com>
18361
18362         * assign.cs (CompoundAssign): A new class used as a "flag" that
18363         the assignment actually is happening as part of a compound
18364         assignment operator.
18365
18366         During compound assignment, a few new rules exist to enable things
18367         like:
18368
18369         byte b |= 1 + 2
18370
18371         From the spec:
18372
18373         x op= y can be evaluated as x = (T) (x op y) (ie, an explicit cast
18374         to the type of x) if y is implicitly convertible to the type of x,
18375         and the operator is a builtin operator and the return type of the
18376         operator is explicitly convertible to the type of x. 
18377
18378         * rootcontext.cs: Reset warning level to 2.  4 catches various
18379         "interesting" features in mcs, we must clean this up at some
18380         point, but currently am trying to kill other bugs ;-)
18381
18382         * ecore.cs (SimpleName.SimpleNameResolve): Perform member lookups
18383         in container classes as well.  
18384
18385         * expression.cs (Binary.ResolveOperator): Handle string case
18386         before anything else (as operator overloading does emit an error
18387         before doing anything else).
18388
18389         This code could go away when we move to a table driven model, but
18390         i could not come up with a good plan last night.
18391
18392 2002-04-30  Lawrence Pit <loz@cable.a2000.nl>
18393
18394         * typemanager.cs (CSharpName): reimplementation using regex.
18395         * class.cs: added null check for fields in Emit
18396         * rootcontext.cs: set warninglevel to 4
18397
18398 2002-04-29  Miguel de Icaza  <miguel@ximian.com>
18399
18400         * typemanager.cs (CSharpName): reimplemented with Lupus
18401         suggestion.
18402
18403 2002-04-28  Miguel de Icaza  <miguel@ximian.com>
18404
18405         * statement.cs (If): correclty implement Resolve, because we were
18406         not catching sem errors in there.  The same process is needed
18407         everywhere else. 
18408         (Return, StatementExpression, For, While, Do, Throw, Lock): Implement Resolve
18409
18410
18411         (Statement.Warning_DeadCodeFound): Factorize code.
18412         (While): Report dead code here too.
18413
18414         (Statement): Added Resolve virtual method to allow
18415         for resolution split from the emit code.
18416
18417 2002-04-26  Miguel de Icaza  <miguel@ximian.com>
18418
18419         * statement.cs (EmitBoolExpression): No longer try to resolve the
18420         expression here.    
18421         (MakeBoolean): New utility function that resolve, implicitly
18422         converts to boolean and tags the expression. 
18423
18424
18425         (If, Do): Implement dead code elimination.
18426         (While): Implement loop inversion
18427
18428         (Do, While, For, If): Resolve the expression prior to calling our
18429         code generation.
18430
18431 2002-04-22  Lawrence Pit <loz@cable.a2000.nl>
18432
18433         * class.cs:
18434           - added method Report28 (warning: program has more than one entry point)
18435           - added method IsEntryPoint, implements paragraph 10.1 of the spec
18436           - modified method Method.Define, the part at the end of the method
18437
18438         * rootcontext.cs: added static public Location EntryPointLocation;
18439           
18440         * ../errors/cs0028.cs : Add test case for the above warning.              
18441
18442         * typemanager.cs:
18443           - modified method CSharpName to allow arrays of primitive type to
18444             be printed nicely (e.g. instead of System.Int32[][] it now prints
18445             int[][])
18446           - added method CSharpSignature: returns the signature of a method
18447             in string format to be used in reporting errors, warnings, etc.
18448
18449         * support.cs: InternalParameters.ParameterDesc variable tmp initialized
18450         with String.Empty.
18451
18452 2002-04-26  Ravi Pratap  <ravi@ximian.com>
18453
18454         * delegate.cs (Define): Fix extremely silly bug where I was
18455         setting the type of the 'object' parameter of the BeginInvoke
18456         method to System.IAsyncResult instead of System.Object ;-)
18457
18458 2002-04-26  Miguel de Icaza  <miguel@ximian.com>
18459
18460         * class.cs (ConstructorInitializer.Resolve): Also use DeclaredOnly
18461         here. 
18462
18463         (Constructor.Emit): return if we fail to initialize the
18464         constructor.  Another door closed!  
18465
18466         * expression.cs (New.DoResolve): Improve error message (from -6 to
18467         1501).  Use DeclaredOnly lookup to find the exact constructor.
18468
18469         * typemanager.cs (MemberLookup): If DeclaredOnly is set, do not
18470         loop.  This is useful.
18471
18472         * cs-parser.jay: Adjust the default parameters so that destructors
18473         have the proper signature.
18474
18475 2002-04-26  Martin Baulig  <martin@gnome.org>
18476
18477         * driver.cs (LoadAssembly): If `assembly' contains any characters
18478         which are only valid in path names and not in assembly names
18479         (currently slash, backslash and point), use Assembly.LoadFrom ()
18480         instead of Assembly.Load () on the `assembly' (before iteration
18481         over the link_paths).
18482
18483 2002-04-26  Martin Baulig  <martin@gnome.org>
18484
18485         * cs-tokenizer.cs (is_hex): Correctly handle lowercase chars.
18486
18487 2002-04-25  Miguel de Icaza  <miguel@ximian.com>
18488
18489         * class.cs (Property): use the new typemanager.MemberLookup
18490
18491         (TypeContainer.MemberLookup): Implement using the
18492         TypeManager.MemberLookup now. 
18493
18494         * typemanager.cs: Make MemberLookup a function of the TypeManager,
18495         and return MemberInfos, so that these can be used without an
18496         EmitContext (what we had before).
18497
18498 2002-04-24  Miguel de Icaza  <miguel@ximian.com>
18499
18500         * expression.cs: Fix the case where the argument to params if the
18501         type of the params.  I omitted handling this before.   Fixed
18502
18503 2002-04-22  Miguel de Icaza  <miguel@ximian.com>
18504
18505         * driver.cs: Call BootCorlib_PopulateCoreType
18506
18507         * class.cs (Property.CheckBase): Check for properties only, not
18508         for all members. 
18509
18510         * interface.cs: Temporary hack: try/catch around the
18511         CustomAttributeBuilder, because I am getting an exception that I
18512         do not understand.
18513
18514         * rootcontext.cs (BootCorlib_PopulateCoreType): Populate some
18515         types whose definitions are required to be there (attributes are
18516         defined before standard types).
18517
18518         Compute definitions as we boot the various types, as they are used
18519         immediately (value_type class will need object_type, but if we do
18520         not initialize object_type, we will pass a null, which will let
18521         the runtime pick the System.Object from the existing corlib, which
18522         is not what we want).
18523
18524 2002-04-22  Patrik Torstensson <totte@labs2.com>
18525
18526         * cs-tokenizer.cs: fixed a number of trim() issues.
18527
18528 2002-04-22  Ravi Pratap  <ravi@ximian.com>
18529
18530         * expression.cs (Argument.Type): Ensure that we return the correct
18531         type when we have out or ref parameters [in which case we 
18532         append a "&"].
18533
18534 2002-04-22  Miguel de Icaza  <miguel@ximian.com>
18535
18536         * class.cs (Property, Indexer): Allow extern modifier in there. 
18537
18538         * typemanager.cs (InitBaseTypes): Initializes object_type and
18539         value_type, since those will be used early on during the bootstrap
18540         process to compile corlib.
18541
18542         (InitCoreTypes): Move code from here to InitBaseTypes.
18543
18544 2002-04-21  Miguel de Icaza  <miguel@ximian.com>
18545
18546         * ecore.cs (PropertyExpr): Optimize calls to Array::get_Length on
18547         single-dimension arrays as using the ldlen opcode.  
18548
18549         Daniel Lewis discovered this optimization.  
18550
18551         * typemanager.cs: Add signature for System.Array::get_Length
18552
18553 2002-04-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
18554
18555         * statement.cs: report the error when the foreach does not apply to an
18556         array nor a collection.
18557
18558 2002-04-19  Miguel de Icaza  <miguel@ximian.com>
18559
18560         * expression.cs: Add implicit conversions to the operator ~.
18561
18562         * constant.cs (DecimalConstant.Emit): Emit decimal value.
18563
18564         * typemanager.cs: Locate the decimal constructor.
18565
18566 2002-04-17  Gonzalo Paniagua Javier <gonzalo@ximian.com>
18567
18568         * attribute.cs: use the new property of TypeOf.
18569         * expression.cs: added 'get' property around typearg.
18570
18571         These changes fix a build breaker reported by NickD. Is this the
18572         correct way to fix?  If not, please, revert my changes and make it
18573         work :-).
18574
18575 2002-04-17  Miguel de Icaza  <miguel@ximian.com>
18576
18577         * attribute.cs: Add support for typeof in attribute invocations.
18578         I am not sure that this is right though.
18579
18580 2002-04-14  Duncan Mak  <duncan@ximian.com>
18581
18582         * cfold.cs (BinaryFold): Catch DivideByZeroException in the
18583         Binary.Operator.Division case.
18584
18585 2002-04-13  Ravi Pratap  <ravi@ximian.com>
18586
18587         * class.cs (DefineType): Ensure that we do a proper check on
18588         attribute types and also register it with the TypeManager.
18589
18590         (TypeContainer.Targets): The default for attribute types is
18591         AttributeTargets.All.
18592
18593         * attribute.cs (ApplyAttributes): Registering the attribute type
18594         is done elsewhere, not when we discover we have a Usage attribute.
18595
18596 2002-04-12  Ravi Pratap  <ravi@ximian.com>
18597
18598         * expression.cs (VerifyArgumentsCompat): Implement Miguel's suggestion
18599         and get rid of is_delegate parameter.
18600
18601         * everywhere : update.
18602
18603 2002-04-12  Ravi Pratap  <ravi@ximian.com>
18604
18605         * cs-parser.jay (compilation_unit): Revamp completely to use
18606         some new ideas that I got from Rhys' grammar to solve the problems
18607         with assembly level attributes.
18608
18609         (outer_declaration): New grammar production.
18610
18611         (attribute_sections): Add.
18612
18613         (opt_attributes): Base on attribute_sections
18614
18615         (namespace_declaration): Allow opt_attributes to tackle the case
18616         when we have assembly level attributes - we are clever in this
18617         regard now ;-)
18618
18619         * attribute.cs (ApplyAttributes): Do not worry about assembly 
18620         attributes in the non-global context.
18621
18622         * rootcontext.cs (AddGlobalAttributes): Go back to using this
18623         instead of SetGlobalAttributes.
18624
18625         * class.cs, rootcontext.cs : Ensure we define and generate 
18626         attribute types before anything else.
18627
18628         * attribute.cs (CheckAttribute and GetValidPlaces): Handle the exception
18629         and flag the new error -20 for the case when the attribute type
18630         does not have valid targets specified. csc does not catch this.
18631
18632         * ../errors/errors.txt : update for error # -20
18633
18634 2002-04-11  Ravi Pratap  <ravi@ximian.com>
18635
18636         * support.cs (InternalParameters.ParameterModifier): Do some null
18637         checking and return sane values.
18638
18639         * class.cs (Method.Define): If we are a PInvoke method, ensure
18640         that we are static and extern. Report error # 601
18641
18642         * ../errors/cs0601.cs : Add test case for the above error.
18643
18644 2002-04-07  Ravi Pratap  <ravi@ximian.com>
18645
18646         * rootcontext.cs (attribute_types): We need to keep type of
18647         all attribute types separately and emit code for them first.
18648
18649         (RegisterAttribute) : Implement.
18650
18651         * class.cs (DefineType): Check if the current Type is a custom
18652         attribute type and register it accordingly.
18653
18654         * rootcontext.cs (AddGlobalAttributes): Fix silly bug where we were
18655         adding the first attribute twice and rename to
18656
18657         (SetGlobalAttributes): this.
18658
18659         * rootcontext.cs (NamespaceLookup): Run through the aliases too and perform
18660         lookups.
18661
18662         * attribute.cs (ApplyAttributes): Take an additional argument telling us
18663         if we are processing global arguments. Hmm, I am unsure of this.
18664
18665 2002-04-12  Gonzalo Paniagua Javier <gonzalo@ximian.com>
18666
18667         * expression.cs: added static array of strings to avoid calling
18668         Enum.ToString () for Operator in Binary. Significant recover of
18669         performance.
18670
18671 2002-04-10  Miguel de Icaza  <miguel@ximian.com>
18672
18673         * class.cs (FindMembers): Allow the Builders of the various
18674         members to be null.  If they are skip them.  This only happens
18675         during the PInvoke declaration.
18676
18677 2002-04-09  Miguel de Icaza  <miguel@ximian.com>
18678
18679         * parameter.cs (Parameters.ComputeParameterTypes): Flag the
18680         failure, so we do not keep going afterwards.
18681
18682         * expression.cs: (Invocation.OverloadResolve): I believe Ravi
18683         wanted to pass `false' as the `is_delegate' argument.  If this is
18684         the case, why not use delegate_type == null to mean `is_delegate =
18685         false' and anything else as is_delegate = true.
18686
18687 Tue Apr  9 05:40:12  2002 Piers Haken <piersh@friskit.com>
18688
18689         * statement.cs: fixed SimpleSwitchEmit to make 'goto case' goto the
18690         code for the section, not the beginning of the tests.
18691
18692 2002-04-08  Miguel de Icaza  <miguel@ximian.com>
18693
18694         * cfold.cs: Handle operator + (Enum x, Underlying x) 
18695
18696         * expression.cs (Binary): same.  Warn about errors where we have
18697         Enum/Enum in operator + as well.
18698
18699 Mon Apr  8 06:29:03  2002 Piers Haken <piersh@friskit.com>
18700
18701         * statement.cs:
18702                 - added support for switch(bool)
18703                 - optimize loading of I8/U8 constants (ldc.i4, iconv_i8)
18704                 - add TableSwitchEmit() to handle table-based switch statements
18705
18706 2002-04-05  Ravi Pratap  <ravi@ximian.com>
18707
18708         * expression.cs (Invocation.OverloadResolve): Factor out code which
18709         does parameter compatibility checking with arguments so that we can 
18710         re-use the code even from Delegate.VerifyApplicability
18711
18712         (VerifyArgumentsCompat): Move above code here.
18713
18714         * delegate.cs (VerifyApplicability): Get rid of duplicate code
18715         and instead make a call to the above method.
18716
18717 2002-03-31  Ravi Pratap  <ravi@ximian.com>
18718
18719         * typemanager.cs (attribute_type): Corresponds to System.Attribute.
18720         We use it to keep track of classes which are attribute types.
18721
18722 2002-04-02  Miguel de Icaza  <miguel@ximian.com>
18723
18724         * delegate.cs (Delegate.Define): Correctly define the types in the
18725         presence of fixed and array parameters.
18726
18727         * class.cs (TypeContainers.FindMembers): Use NonPublic flag while
18728         doing FindMembers.
18729
18730         * ecore.cs (Expression.MemberLookup): Reset binding flags to not
18731         include NonPublic after the first iteration.
18732
18733         * class.cs (Indexer.CheckBase): Only check if both parents are
18734         non-null. 
18735
18736         * cs-parser.jay (accessor_body): If empty, set to null.
18737
18738         * ecore.cs (SimpleName.SimpleNameResolve): We did not have the
18739         same code path here to resolve constants names that we did have in
18740         MemberAccess.DoResolve.  There is too much code duplicated here.
18741
18742 2002-04-01  Miguel de Icaza  <miguel@ximian.com>
18743
18744         * statement.cs, makefile: Drop Statementcollection and just use ArrayLists
18745
18746         * ecore.cs: Optimize UserDefinedConversion by minimizing the calls
18747         to MakeUnionSet.
18748
18749         * cs-tokenizer.cs: Reuse a single StringBuilder for assembling
18750         tokens, numbers and strings.
18751
18752         * ecore.cs (MethodGroupExpr): Make Emit warn about missing
18753         parenthesis.
18754
18755         * delegate.cs: Use ComputeAndDefineParameterTypes for both the
18756         asyncronous parameters and the regular parameters.  
18757
18758         * codegen.cs (CodeGen.Init): Use the constructor that allows us to
18759         specify the target directory.
18760
18761         * expression.cs: (This.DoResolve): Simplify
18762         (As.Emit): Optimize, do not generate IsInst if the expression is
18763         always of the given type.
18764
18765         (Is.DoResolve): Bug fix, we were reporting both always/never for
18766         the is expression.
18767
18768         * (Invocation.MakeUnionSet): Simplify vastly and optimize, we were
18769         creating too many unnecessary arrays.
18770
18771 2002-03-31  Miguel de Icaza  <miguel@ximian.com>
18772
18773         * class.cs (EmitFieldInitializer): Use Assign expression to assign
18774         fields instead of rolling our own initializer.   Takes care of all
18775         implicit conversions, and drops unnecessary static checks/argument.
18776
18777 2002-03-31  Dick Porter  <dick@ximian.com>
18778
18779         * driver.cs: use the GetDirectories() return values properly, and
18780         use "/" as path separator.
18781
18782 2002-03-30  Miguel de Icaza  <miguel@ximian.com>
18783
18784         * expression.cs (Unary): Optimize - - expr into expr.
18785         (Binary): Optimize a + (-b) into a -b.
18786
18787         * codegen.cs (CodeGen): Made all methods static.
18788
18789 2002-03-29  Miguel de Icaza  <miguel@ximian.com>
18790
18791         * rootcontext.cs: 
18792
18793         * decl.cs: Rename `definition' into `TypeBuilder' and drop the
18794         TypeBuilder property.
18795
18796         * cs-parser.jay: Drop the use of RecordXXX and use RecordDecl
18797         instead. 
18798
18799         * tree.cs: Removed the various RecordXXXX, and replaced with a
18800         single RecordDecl.  Removed all the accessor methods, and just
18801         left a single access point Type 
18802
18803         * enum.cs: Rename DefineEnum to DefineType.
18804
18805         * decl.cs: New abstract method `DefineType' used to unify the
18806         Defines for Enumerations, Interfaces, TypeContainers and
18807         Delegates.
18808
18809         (FindType): Moved LookupInterfaceOrClass here.  Moved the
18810         LookupBaseClasses method that used to live in class.cs and
18811         interface.cs here, and renamed to FindType.
18812
18813         * delegate.cs: Implement DefineType.  Take advantage of the
18814         refactored pattern for locating the parent builder without taking
18815         the parent_builder argument (which we know does not work if we are
18816         nested, and triggering a toplevel definition).
18817
18818 2002-03-28  Miguel de Icaza  <miguel@ximian.com>
18819
18820         * decl.cs (MemberCore.CheckMethodAgainstBase): Test if the
18821         accessibility of a member has changed during override and report
18822         an error if so.
18823
18824         * class.cs (Method.Define, Property.Define): Only complain on
18825         overrides if the method is private, any other accessibility is
18826         fine (and since we just checked the permission is the same, we are
18827         good to go).
18828
18829         * cs-tokenizer.cs: only line, region, endregion, if, endif, else
18830         and elif are processed always.  The other pre-processing
18831         directives are only processed if we are "taking" the path
18832
18833 2002-03-29  Martin Baulig  <martin@gnome.org>
18834
18835         * class.cs (Method.Emit): Only emit symbolic debugging info if the
18836         current location is not Null.
18837
18838         * codegen.cs (CodeGen.SaveSymbols): Split out symbol writing code into
18839         a separate method so we can profile it.
18840
18841         * driver.cs (ShowTime): We need to use `(int) span.TotalSeconds' since
18842         `span.Seconds' are just seconds, but no minutes or hours.
18843         (MainDriver): Profile the CodeGen.SaveSymbols calls.
18844
18845 2002-03-28  Miguel de Icaza  <miguel@ximian.com>
18846
18847         * class.cs (Method.Define), (Property.Define), (Indexer.Define):
18848         Remove the gratuitous set of Final:
18849
18850                                 // If an interface implementation, then we can set Final.
18851                                 if (((flags & MethodAttributes.Abstract) == 0) &&
18852                                     implementing.DeclaringType.IsInterface)
18853                                         flags |= MethodAttributes.Final;
18854
18855         I do not know what I was smoking when I used that.
18856
18857
18858         * cs-parser.jay, delegate.cs: Make Delegate be a DeclSpace, first
18859         step into fixing the name resolution issues for delegates and
18860         unifying the toplevel name resolution.
18861
18862 2002-03-28  Martin Baulig  <martin@gnome.org>
18863
18864         * class.cs (Method.Emit): If we have a symbol writer, call its
18865         OpenMethod(), CloseMethod() and SetMethodSourceRange() methods to
18866         tell it about the current method.
18867
18868         * codegen.cs (EmitContext.Mark): New public method. Tell the symbol
18869         writer that we're going to emit the first byte of IL code for a new
18870         statement (a new source line).
18871         (EmitContext.EmitTopBlock): If we have a symbol writer, call
18872         EmitContext.Mark() before emitting any code.
18873
18874         * location.cs (SymbolDocument): Return null when we're Null.
18875
18876         * statement.cs (Statement): Moved the `Location loc' variable here.
18877         (Statement.EmitBoolExpression): If we have a symbol writer, call
18878         ec.Mark() before emitting any code to tell it that we're at the
18879         beginning of a new statement.
18880         (StatementExpression): Added `Location' argument to the constructor.
18881         (Block): Added public readonly variable `StartLocation' and public
18882         variable `EndLocation'.  The latter is to be set using SetEndLocation().
18883         (Block): Added constructor which takes a start and end location.
18884         (Block.SetEndLocation): New method. This sets the end location.
18885         (Block.EmitMeta): If we have a symbol writer, tell it the names of the
18886         local variables we create.
18887         (Block.Emit): If we have a symbol writer, call ec.Mark() before emitting
18888         each statement and do also mark the begin and end of the block.
18889
18890         * cs-parser.jay (block : OPEN_BRACE): Use the new `Block' constructor to
18891         tell it the current lexer.Location, use Location.Null for the end of the
18892         block.
18893         (block : OPEN_BRACE opt_statement_list CLOSE_BRACE): When closing the
18894         current block, set its end location using SetEndLocation().
18895         (statement_expression): StatementExpression constructor now takes the
18896         lexer.Location as additional argument.
18897         (for_statement, declare_local_variables): Likewise.
18898         (declare_local_variables): When creating a new implicit block, use the
18899         new Block constructor and pass it the lexer.Location.
18900
18901 2002-03-28  Miguel de Icaza  <miguel@ximian.com>
18902
18903         * ecore.cs (Expression.MemberLookup): On interfaces, lookup
18904         members also on the parent interfaces recursively.
18905
18906 2002-03-27  Miguel de Icaza  <miguel@ximian.com>
18907
18908         * report.cs: Use new formats, since Gonzalo finished the missing
18909         bits. 
18910
18911         * expression.cs (Binary.ResolveOperator): added missing operator|
18912         operator& and operator^ for bool/bool.
18913
18914         * cs-parser.jay: CheckDef now takes a Location argument that is
18915         used to report errors more precisly (instead of reporting the end
18916         of a definition, we try to track something which is a lot closer
18917         to the source of the problem).
18918
18919         * cs-tokenizer.cs: Track global token use, so we can properly flag
18920         the use of #define/#undef after the first token has been seen.
18921
18922         Also, rename the reportXXXX to Error_DescriptiveName
18923
18924         * decl.cs (DeclSpace.IsTopLevel): Move property here from
18925         TypeContainer, so that Enum and Interface can use this too.
18926
18927         * class.cs (TypeContainer.LookupInterfaceOrClass,
18928         GetInterfaceOrClass, GetClassBases, DefineType): Drop the
18929         `builder' argument.  Typically this was used to pass the parent
18930         builder (a ModuleBuilder or a TypeBuilder from whoever triggered
18931         the definition).  
18932
18933         The problem is that a nested class could trigger the definition of
18934         a toplevel class, and the builder would be obviously wrong in that
18935         case. 
18936
18937         So we drop this argument, and we compute dynamically the
18938         TypeBuilder/ModuleBuilder (the correct information was available
18939         to us anyways from DeclSpace.Parent)
18940
18941         * interface.cs (Interface.DefineInterface): Drop builder
18942         parameter cleanup like class.cs
18943
18944         * enum.cs (Enum.DefineEnum): Drop builder parameter.  Clean up
18945         like class.cs
18946
18947         * statement.cs (Switch.EmitObjectInteger): Emit short/ushort
18948         values. 
18949
18950         (Try.Emit): Propagate the returns value from the statement.
18951
18952         (Return.Emit): Even if we are leavning 
18953
18954         * driver.cs: Catch IOExpcetion for Directory.GetFiles as well.
18955
18956         * modifiers.cs: Fix the computation of MethodAttributes flags.
18957
18958 Tue Mar 26 21:14:36 CET 2002 Paolo Molaro <lupus@ximian.com>
18959
18960         * driver.cs: allow compilation of files that start with '/'.
18961         Add a default case when checking the argument of --target.
18962
18963 2002-03-25  Miguel de Icaza  <miguel@ximian.com>
18964
18965         * interface.cs: Implement the same search algorithm for types in
18966         the interface code.
18967
18968         * delegate.cs: Do not allow multiple definition.
18969
18970         * Recovered ChangeLog that got accidentally amputated
18971
18972         * interface.cs (Interface.DefineInterface): Prevent from double definitions.
18973
18974         * rootcontext.cs: Load manually enum to allow core classes to
18975         contain enumerations.
18976
18977         * enum.cs, ecore.cs, driver.cs, attribute.cs, class.cs, expression.cs:
18978         Update to new static methods in TypeManager.
18979
18980         * typemanager.cs (GetMethod, GetConstructor): Use our
18981         implementation of FindMembers to find the members, since during
18982         corlib compilation, the types are TypeBuilders and GetMethod and
18983         GetConstructor do not work.
18984
18985         Make all methods in TypeManager static.
18986
18987         (InitCodeHelpers): Split the functionality from
18988         the InitCodeTypes function.
18989
18990         * driver.cs: Call InitCodeHelpers after we have populated the
18991         types. 
18992
18993         * cs-parser.jay (delegate_declaration): we did not used to compute
18994         the delegate name correctly for void delegates.
18995
18996 2002-03-24  Miguel de Icaza  <miguel@ximian.com>
18997
18998         * rootcontext.cs (RootContext): Init the interface_resolve_order
18999         and type_container_resolve_order always.
19000
19001         (ResolveCore, BootstrapCorlib_ResolveClass,
19002         BootstrapCorlib_ResolveStruct): New functions to bootstrap the
19003         compiler when compiling with --nostdlib
19004
19005         * class.cs (TypeContainer.DefineType): Check that our parent is
19006         not null.  This test is most important when we are bootstraping
19007         the core types.
19008
19009         * codegen.cs: Split out the symbol writing code.
19010
19011 2002-03-25  Martin Baulig  <martin@gnome.org>
19012
19013         * driver.cs (-g): Made -g an alias for --debug.
19014
19015 2002-03-24  Martin Baulig  <martin@gnome.org>
19016
19017         * codegen.cs (SymbolWriter): New public variable. Returns the
19018         current symbol writer.
19019         (CodeGen): Added `bool want_debugging_support' argument to the
19020          constructor. If true, tell the ModuleBuild that we want debugging
19021         support and ask it for the ISymbolWriter.
19022         (Save): If we have a symbol writer, call it's Close() method after
19023         saving the assembly.
19024
19025         * driver.c (--debug): New command line argument to create a
19026         debugger information file.
19027
19028         * location.cs (SymbolDocument): New public property. Returns an
19029         ISymbolDocumentWriter object for the current source file or null
19030         if we don't have a symbol writer.
19031
19032 2002-03-21  Miguel de Icaza  <miguel@ximian.com>
19033
19034         * driver.cs (LoadAssembly): Correctly return when all the paths
19035         have been tried and not before.
19036
19037         * statement.cs (Switch.Emit): return the actual coverage for this
19038         statement (returns/not-returns)
19039
19040         (Switch.SimpleSwitchEmit): Do not generate jumps to the end of the
19041         switch of the statement if we are the last switch section.  That
19042         kills two problems: try/catch problems (we used to emit an empty
19043         nop at the end) and switch statements where all branches would
19044         return. 
19045
19046 2002-03-19  Miguel de Icaza  <miguel@ximian.com>
19047
19048         * driver.cs: Add default assemblies (the equivalent to the
19049         Microsoft CSC.RSP file)
19050
19051         * cs-tokenizer.cs: When updating `cols and setting it to zero,
19052         also update tokens_seen and set it to false.
19053
19054         * driver.cs: Implement --recurse for Mike.
19055
19056         * driver.cs (SplitPathAndPattern): Small bug fix, I was not
19057         correctly splitting out the paths.
19058
19059 2002-03-18  Miguel de Icaza  <miguel@ximian.com>
19060
19061         * interface.cs (Interface.PopulateProperty): Instead of using
19062         `parent' as the declaration space for the set parameters, use
19063         `this' 
19064
19065         * support.cs (InternalParameters): InternalParameters constructor
19066         takes a DeclSpace instead of a TypeContainer.
19067
19068         * expression.cs (ArrayCreation.EmitDynamicInitializers): If value
19069         types are being initialized, load the address of it before calling
19070         the function.  
19071
19072         (New): Provide a mechanism to disable the generation of local
19073         value type temporaries when the caller will be providing us with
19074         an address to store it.
19075
19076         (ArrayCreation.EmitDynamicInitializers): Use it.
19077
19078 2002-03-17  Miguel de Icaza  <miguel@ximian.com>
19079
19080         * expression.cs (Invocation.EmitArguments): Only probe for array
19081         property if there is more than one argument.  Sorry about that.
19082
19083         * class.cs (Invocation.EmitArguments): Fix to emit arguments for
19084         empty param arrays.
19085
19086         * class.cs (Method.LabelParameters): Fix incorrect code path that
19087         prevented the `ParamArrayAttribute' from being applied to the
19088         params attribute.
19089
19090 2002-03-16  Miguel de Icaza  <miguel@ximian.com>
19091
19092         * support.cs (ReflectionParameters): Correctly compute whether the
19093         last argument is a params array.  Fixes the problem with
19094         string.Split ('a')
19095
19096         * typemanager.cs: Make the assemblies array always be non-null
19097         (empty, but non-null)
19098
19099         * tree.cs (RecordDecl): New function that abstracts the recording
19100         of names.  This reports error 101, and provides a pointer to the
19101         previous declaration.  Fixes a crash in the compiler.
19102
19103         * cs-parser.jay (constructor_declaration): Update to new grammar,
19104         and provide a constructor_body that can be empty.
19105
19106 2002-03-15  Miguel de Icaza  <miguel@ximian.com>
19107
19108         * driver.cs: Add support for --resources.
19109
19110         * expression.cs: (FetchGetMethod, FetchAddressMethod, EmitAssign):
19111         Make all types for the various array helper methods be integer.
19112
19113         * ecore.cs (Expression.ConvertNumericExplicit): Pass the
19114         CheckState to ConvCast.
19115
19116         (ConvCast): Now it takes a `checked' state argument, to avoid
19117         depending on the emit context for the conversion, and just using
19118         the resolve time setting.
19119
19120         * expression.cs (ArrayCreation.EmitArrayArguments): New function,
19121         instead of Invocation.EmitArguments.  We do not emit the original
19122         arguments, instead we emit those which have been converted to
19123         unsigned int expressions.
19124
19125         * statement.cs (Block.EmitMeta): Drop tracking of indexes.
19126
19127         * codegen.cs: ditto.
19128
19129         * expression.cs (LocalVariableReference): Drop the use of the
19130         Store function that depended on the variable index.
19131
19132         * statement.cs (VariableInfo): Drop the `Idx' property from this
19133         class, as this is not taking into account the indexes for
19134         temporaries tat we generate during the execution, getting the
19135         indexes wrong.
19136
19137         * class.cs: First emit class initializers, then call the parent
19138         constructor. 
19139
19140         * expression.cs (Binary): Fix opcode emision.
19141         (UnaryMutator.EmitCode): Support checked code generation
19142
19143         * ecore.cs (MemberLookup): TypeManager.FindMembers will return
19144         matches for events for both the Static and Instance scans,
19145         pointing to the same element.   Fix that.
19146
19147 2002-03-14  Miguel de Icaza  <miguel@ximian.com>
19148
19149         * rootcontext.cs (ResolveTree): Always set the
19150         interface_resolve_order, because nested interfaces will be calling
19151         into us.
19152
19153         * class.cs (GetInterfaceOrClass): Track the same resolution
19154         process used by TypeManager.LookupType.  This fixes the nested
19155         type lookups in class declarations (separate path from
19156         LookupType). 
19157
19158         (TypeContainer.DefineType): Also define nested interfaces.
19159         (TypeContainer.RegisterOrder): New public function used to
19160         register the order in which child interfaces need to be closed.
19161
19162         Nested interfaces need to be closed after their parents have been
19163         created. 
19164
19165         * interface.cs (InterfaceAttr): Put all the logic for computing
19166         the interface attribute here. 
19167
19168         (DefineInterface): Register our interface order with the
19169         RootContext or with the TypeContainer depending on the case.
19170
19171 2002-03-12  Miguel de Icaza  <miguel@ximian.com>
19172
19173         * cs-parser.jay: rework foreach statement to work with the new
19174         changes to the policy on SimpleNames.
19175
19176         * report.cs: support Stacktrace on warnings as well.
19177
19178         * makefile: drop --unsafe and /unsafe from the compile.
19179
19180 2002-03-13  Ravi Pratap  <ravi@ximian.com>
19181
19182         * ecore.cs (StandardConversionExists): Modify to take an Expression
19183         as the first parameter. Ensure we do null -> reference type conversion
19184         checking.
19185
19186         * Everywhere : update calls accordingly, making use of MyEmptyExpr to store
19187         temporary Expression objects.
19188
19189 Wed Mar 13 12:32:40 CET 2002 Paolo Molaro <lupus@ximian.com>
19190
19191         * interface.cs: workaround bug in method overloading resolution
19192         (there is already a bugzilla bug for it).
19193
19194 2002-03-12  Miguel de Icaza  <miguel@ximian.com>
19195
19196         We could also solve this problem by having a separate path for
19197         performing type lookups, instead of DoResolve, we could have a
19198         ResolveType entry point, and only participating pieces of the
19199         production (simplename, deref, array) would implement this. 
19200
19201         * codegen.cs (EmitContext): New field OnlyLookupTypes used to
19202         signal SimpleName to only resolve type names and not attempt to
19203         resolve anything else.
19204
19205         * expression.cs (Cast): Set the flag.
19206
19207         * ecore.cs (SimpleName): Use the OnlyLookupTypes flag
19208
19209         * class.cs: Only report 108 if there is no `new' modifier.
19210
19211         * cs-parser.jay: rework foreach statement to work with the new
19212         changes to the policy on SimpleNames.
19213         
19214         * report.cs: support Stacktrace on warnings as well.
19215
19216         * makefile: drop --unsafe and /unsafe from the compile.
19217
19218 2002-03-11  Miguel de Icaza  <miguel@ximian.com>
19219
19220         * ecore.cs (SimpleName.SimpleNameResolve): Perform local variable
19221         lookups here, instead of doing that at parse time.  This means
19222         that our grammar will not introduce `LocalVariableReferences' as
19223         expressions at this point.  That solves the problem of code like
19224         this:
19225
19226         class X {
19227            static void Main ()
19228            { int X = 1;
19229             { X x = null }}}
19230
19231         This is only half the fix.  The full fix requires parameters to
19232         also be handled in this way.
19233
19234         * Everywhere: Use ec.DeclSpace on calls to LookupType, as this
19235         makes the use more obvious of the DeclSpace.  The
19236         ec.TypeContainer.TypeBuilder is now only used to pull the
19237         TypeBuilder for it.
19238
19239         My theory is that I can get rid of the TypeBuilder completely from
19240         the EmitContext, and have typecasts where it is used (from
19241         DeclSpace to where it matters).  
19242
19243         The only pending problem is that the code that implements Aliases
19244         is on TypeContainer, and probably should go in DeclSpace.
19245
19246         * ecore.cs (SimpleName.SimpleNameResolve): Perform local variable
19247         lookups here, instead of doing that at parse time.  This means
19248         that our grammar will not introduce `LocalVariableReferences' as
19249         expressions at this point.  That solves the problem of code like
19250         this:
19251
19252         class X {
19253            static void Main ()
19254            { int X = 1;
19255             { X x = null }}}
19256
19257         This is only half the fix.  The full fix requires parameters to
19258         also be handled in this way.
19259
19260         * class.cs (Property.DefineMethod): When implementing an interface
19261         method, set newslot, when implementing an abstract method, do not
19262         set the flag (before we tried never setting it, or always setting
19263         it, which is the difference).
19264         (Indexer.DefineMethod): same.
19265         (Method.DefineMethod): same.
19266
19267         * ecore.cs: Only set the status used flag if we get back a Field.
19268
19269         * attribute.cs: Temporary hack, so Paolo can keep working.
19270
19271 2002-03-08  Ravi Pratap  <ravi@ximian.com>
19272
19273         * attribute.cs (Attribute.UnmanagedType): This is to keep track of
19274         the unmanaged type in the case we have a MarshalAs attribute.
19275
19276         (Resolve): Handle the case when we are parsing the special MarshalAs
19277         attribute [we need to store the unmanaged type to use later]
19278
19279         * typemanager.cs (marshal_as_attr_type): Built in type for the 
19280         MarshalAs Attribute.
19281
19282         * attribute.cs (ApplyAttributes): Recognize the MarshalAs attribute 
19283         on parameters and accordingly set the marshalling info.
19284
19285 2002-03-09  Miguel de Icaza  <miguel@ximian.com>
19286
19287         * class.cs: Optimizing slightly by removing redundant code after
19288         we switched to the `NoTypes' return value.
19289         (Property.DefineMethod): use NoTypes here too.
19290
19291         This fixes the bug I introduced in my last batch of changes.
19292
19293 2002-03-05  Ravi Pratap  <ravi@ximian.com>
19294
19295         * tree.cs (RecordEnum): Add. We now keep track of enums too.
19296
19297         * class.cs (LookupInterfaceOrClass): Check against the list of recorded
19298         Enums since those are types too. 
19299
19300         * cs-parser.jay (enum_declaration): Record enums as we parse them.
19301
19302         * enum.cs (DefineEnum): Return if the TypeBuilder has already been defined 
19303         thanks to a call during the lookup process.
19304
19305 2002-03-07  Miguel de Icaza  <miguel@ximian.com>
19306
19307         * statement.cs (Foreach): Lots of work to accomodate a particular
19308         kind of foreach statement that I had not kept in mind.  It is
19309         possible to have foreachs on classes that provide a GetEnumerator
19310         method that return objects that implement the "pattern" for using
19311         a foreach, there is no need to support GetEnumerator
19312         specifically. 
19313
19314         This is needed to compile nant.
19315
19316         * decl.cs: Only report 114 if the member is not `Finalize' and if
19317         the warning level is at least 2.
19318
19319         * class.cs: Moved the compare function from Method to
19320         MethodSignature. 
19321
19322         (MethodSignature.InheritableMemberSignatureCompare): Add new
19323         filter function that is used to extract inheritable methods from a
19324         class. 
19325
19326         (Method.Define): Use the new `inheritable_method_signature_filter'
19327         delegate
19328
19329         * cs-tokenizer.cs (get_cmd_arg): Do not add white space to the
19330         command. 
19331
19332 2002-03-06  Miguel de Icaza  <miguel@ximian.com>
19333
19334         * ecore.cs (Expression.ConvertReferenceExplicit): Removed dead code.
19335
19336         * cs-parser.jay: Add opt_semicolon to the interface declaration.
19337
19338         * expression.cs: Pass location information to
19339         ConvertImplicitStandard. 
19340
19341         * class.cs: Added debugging code to track return values from
19342         interfaces. 
19343
19344 2002-03-05  Miguel de Icaza  <miguel@ximian.com>
19345
19346         * expression.cs (Is.DoResolve): If either side of the `is' is an
19347         interface, do not flag the warning.
19348
19349         * ecore.cs (ImplicitReferenceConversion): We need a separate test
19350         for interfaces
19351
19352         * report.cs: Allow for --fatal to be used with --probe.
19353
19354         * typemanager.cs (NoTypes): Move the definition for the empty Type
19355         array here. 
19356
19357         * class.cs (TypeContainer.FindMembers): Also look for methods defined by
19358         properties. 
19359         (TypeContainer.DefineProxy): New function used to proxy to parent
19360         implementations when implementing interfaces.
19361         (TypeContainer.ParentImplements): used to lookup if our parent
19362         implements a public function that is required by an interface.
19363         (TypeContainer.VerifyPendingMethods): Hook this up.
19364
19365         * typemanager.cs (TypeManager, AddModule, AddAssembly): Make the
19366         `modules' and `assemblies' arraylists into arrays.  We only grow
19367         these are the very early start up of the program, so this improves
19368         the speedof LookupType (nicely measured).
19369
19370         * expression.cs (MakeByteBlob): Replaced unsafe code with
19371         BitConverter, as suggested by Paolo.
19372
19373         * cfold.cs (ConstantFold.Binary): Special case: perform constant
19374         folding of string concatenation, but if either side is a string,
19375         and the other is not, then return null, and let the runtime use
19376         the concatenation on the string plus the object (using
19377         `Object.ToString'). 
19378
19379 2002-03-04  Miguel de Icaza  <miguel@ximian.com>
19380
19381         Constant Folding has been implemented now.
19382
19383         * expression.cs (Unary.Reduce): Do not throw an exception, catch
19384         the error instead on types that are not supported in one's
19385         complement. 
19386
19387         * constant.cs (Constant and all children): New set of functions to
19388         perform implict and explicit conversions.
19389
19390         * ecore.cs (EnumConstant): Implement the new functions to perform
19391         conversion by proxying to the child expression.
19392
19393         * codegen.cs: (ConstantCheckState): Constant evaluation has its
19394         own separate setting that can not be turned off from the command
19395         line using --unchecked or --checked and is only controlled using
19396         the checked/unchecked statements and expressions.  This setting is
19397         used by the constant folder to flag errors.
19398
19399         * expression.cs (CheckedExpr, UncheckedExpr): Set the
19400         ConstantCheckState as well.   
19401
19402         During Resolve, they also have to flag the state, because the
19403         constant folder runs completely in the Resolve phase.
19404
19405         * statement.cs (Checked, Unchecked): Set the ConstantCheckState as
19406         well.
19407
19408 2002-03-01  Miguel de Icaza  <miguel@ximian.com>
19409
19410         * cfold.cs: New file, this file contains the constant folder.
19411
19412         * ecore.cs (IMemoryLocation.AddressOf): Now takes an extra
19413         argument to track whether we are using the resulting address to
19414         load or store a value and provide better error messages. 
19415
19416         (FieldExpr.Emit, FieldExpr.EmitAssign, FieldExpr.AddressOf): Use
19417         new AddressOf arguments.
19418
19419         * statement.cs (Foreach.EmitCollectionForeach): Update
19420
19421         * expression.cs (Argument.Emit): Call AddressOf with proper
19422         arguments to track usage.
19423
19424         (New.DoEmit): Call AddressOf with new arguments.
19425
19426         (Unary.Emit): Adjust AddressOf call.
19427
19428 2002-03-01  Ravi Pratap  <ravi@ximian.com>
19429
19430         * cs-parser.jay (member_access): Change the case for pre-defined types
19431         to use a MemberAccess instead of a SimpleName. Thanks to Felix again for 
19432         this suggestion.
19433
19434         * class.cs (Operator::Emit): If we are abstract or extern, we don't have
19435         a method body.
19436
19437         * attribute.cs (CheckAttribute, ApplyAttribute): Ensure that we treat operators
19438         essentially like methods and apply attributes like MethodImplOptions to them too.
19439
19440         * ecore.cs (SimpleName.SimpleNameResolve): Perform a check on ec.TypeContainer.TypeBuilder
19441         not being null.
19442
19443         * codegen.cs (EmitContext): The constructor now takes in an extra argument specifying the
19444         DeclSpace as the distinction is important. We provide sane defaults as usually the TypeContainer
19445         is the DeclSpace.
19446
19447         * Update code everywhere accordingly.
19448
19449         * ecore.cs : Change references to ec.TypeContainer to ec.DeclSpace where appropriate.
19450
19451         * cs-parser.jay (enum_declaration): Set the current namespace of the enum.
19452
19453 2002-02-28  Ravi Pratap  <ravi@ximian.com>
19454
19455         * rootcontext.cs (LookupType): As we cycle through the chain of namespaces
19456         try performing lookups against those instead of jumping straight into using
19457         the 'using' clauses.
19458
19459         (ImplicitParent): Add. Thanks to Felix Arrese-Igor for this idea.
19460
19461         (LookupType): Perform lookups in implicit parents too.
19462
19463         * class.cs (GetInterfaceOrClass): Modify to perform the exact same lookup
19464         sequence as RootContext.LookupType. 
19465
19466         * rootcontext.cs (NamespaceLookup): Split out code from LookupType which tries 
19467         the various cases of namespace lookups into this method.
19468
19469 2002-03-01  Miguel de Icaza  <miguel@ximian.com>
19470
19471         * cs-parser.jay: Add support for [Attribute ()] (empty arguments
19472         in positional arguments)
19473
19474         * class.cs (Operator): Update the AllowedModifiers to contain
19475         extern. 
19476
19477         * cs-parser.jay: Update operator declaration to allow for the
19478         operator body to be empty.
19479
19480         * cs-tokenizer.cs: Added '\u' unicode support in strings and hex
19481         values. 
19482
19483 2002-02-27  Miguel de Icaza  <miguel@ximian.com>
19484
19485         * class.cs (Method.Emit): Label parameters.
19486
19487         * driver.cs: Return 1 or 0 as the program exit code.
19488
19489 2002-02-26  Miguel de Icaza  <miguel@ximian.com>
19490
19491         * expression.cs: Special case the `null' object when trying to
19492         auto-compute the type, as anything can be explicitly converted to
19493         that. 
19494
19495         * ecore.cs (Expression.ConvertExplicit): Bug fix, thanks for
19496         spotting this Paolo.
19497
19498         (Expression.ImplicitNumericConversion): Perform comparissions of
19499         the type using the underlying type in the case of an enumeration
19500         rather than using the enumeration type for the compare.
19501
19502         Cope with the underlying == type case, which is not possible to
19503         catch before. 
19504
19505         (Expression.ConvertNumericExplicit): Perform comparissions of
19506         the type using the underlying type in the case of an enumeration
19507         rather than using the enumeration type for the compare.
19508
19509         * driver.cs: If the user does not supply an extension, assume .exe
19510
19511         * cs-parser.jay (if_statement): Rewrote so that we can track the
19512         location for the if statement.
19513
19514         * expression.cs (Binary.ConstantFold): Only concat strings when
19515         the operation is "+", not everything ;-)
19516
19517         * statement.cs (Statement.EmitBoolExpression): Take a location
19518         argument. 
19519         (If, While, Do): Track location.
19520
19521         * expression.cs (Binary.ResolveOperator): In the object + string
19522         case, I was missing a call to ConvertImplicit
19523
19524 2002-02-25  Ravi Pratap  <ravi@ximian.com>
19525
19526         * parameter.cs (Parameter.ExternalType): Take in extra DeclSpace and
19527         Location arguments. Ensure we use RootContext.LookupType to do our work
19528         and not try to do a direct Type.GetType and ModuleBuilder.GetType
19529
19530         * interface.cs (PopulateMethod): Handle the type of the parameter being
19531         null gracefully.
19532
19533         * expression.cs (Invocation.BetterFunction): Handle the case when we 
19534         have a params method with no fixed arguments and a call is made with no
19535         arguments.
19536
19537 2002-02-25  Miguel de Icaza  <miguel@ximian.com>
19538
19539         * cs-tokenizer.cs: Add support for the quote-escape-sequence in
19540         the verbatim-string-literal
19541
19542         * support.cs (InternalParameters.ParameterModifier): handle null
19543         fixed parameters.
19544         (InternalParameters.ParameterType): ditto.
19545
19546         * parameter.cs (VerifyArgs): Also check if the fixed parameter is
19547         duplicating the name of the variable parameter.
19548         (GetParameterByName): Fix bug where we were not looking up array
19549         paramters if they were the only present (thanks Paolo!).
19550         (GetParameterInfo): We only have an empty set of types if both
19551         fixed and array are set to null.
19552         (GetParameterInfo-idx): Handle FixedParameter == null
19553
19554         * cs-parser.jay: Handle the case where there is no catch
19555         statements (missing null test).
19556
19557 2002-02-22  Miguel de Icaza  <miguel@ximian.com>
19558
19559         * driver.cs (MainDriver): Be conservative on our command line
19560         handling.
19561
19562         Catch DirectoryNotFoundException when calling GetFiles.
19563
19564         (SplitPathAndPattern): Used to split the input specification into
19565         a path and a pattern that we can feed to Directory.GetFiles.
19566
19567 2002-02-21  Miguel de Icaza  <miguel@ximian.com>
19568
19569         * statement.cs (Fixed): Implement the last case of the Fixed
19570         statement (string handling).
19571
19572         * expression.cs (StringPtr): New class used to return a char * to
19573         a string;  Used by the Fixed statement.
19574
19575         * typemanager.cs: Add char_ptr_type.  Add get_OffsetToStringData method.
19576
19577         * expression.cs (Binary.ResolveOperator): Remove redundant
19578         MemberLookup pn parent type.
19579         Optimize union call, we do not need a union if the types are the same.
19580         (Unary.ResolveOperator): REmove redundant MemberLookup on parent
19581         type.
19582
19583         Specialize the use of MemberLookup everywhere, instead of using
19584         the default settings. 
19585
19586         (StackAlloc): Implement stackalloc keyword.
19587
19588         * cs-parser.jay: Add rule to parse stackalloc.
19589
19590         * driver.cs: Handle /h, /help, /?
19591
19592         * expression.cs (MakeByteBlob): Removed the hacks we had in place
19593         before we supported unsafe code.
19594
19595         * makefile: add --unsafe to the self compilation of mcs.
19596
19597 2002-02-20  Miguel de Icaza  <miguel@ximian.com>
19598
19599         * expression.cs (PointerArithmetic): New class that is used to
19600         perform pointer arithmetic.
19601         (Binary.Resolve): Handle pointer arithmetic
19602         Handle pointer comparission.
19603         (ArrayPtr): Utility expression class that is used to take the
19604         address of an array.
19605
19606         (ElementAccess): Implement array access for pointers
19607
19608         * statement.cs (Fixed): Implement fixed statement for arrays, we
19609         are missing one more case before we are done.
19610
19611         * expression.cs (Indirection): Implement EmitAssign and set the
19612         ExprClass to Variable.  This allows pointer dereferences to be
19613         treated as variables, and to have values assigned to them.
19614
19615         * ecore.cs (Expression.StoreFromPtr): New utility function to
19616         store values dereferencing.
19617
19618 2002-02-20  Ravi Pratap  <ravi@ximian.com>
19619
19620         * expression.cs (Binary.ResolveOperator): Ensure that we are
19621         not trying to operate on a void type - this fixes the reported
19622         bug.
19623
19624         * decl.cs (CheckMethodAgainstBase): Do not allow overriding if
19625         the parent implementation is sealed.
19626
19627         * ../errors/cs0239.cs : Add.
19628
19629         * attribute.cs (ApplyAttributes): Handle Modulebuilders too.
19630
19631         * typemanager.cs (unverifiable_code_type): Corresponds to 
19632         System.Security.UnverifiableCodeAttribute. We need to emit this for modules
19633         which have unsafe code in them.
19634
19635         * rootcontext.cs (EmitCode): Emit the above attribute when we are in an 
19636         unsafe context.
19637
19638 2002-02-19  Miguel de Icaza  <miguel@ximian.com>
19639
19640         * cs-tokenizer.cs: Add support for @"litreal strings"
19641
19642         Make tokenizer accept pre-processor directives
19643         on any column (remove the old C-like limitation). 
19644
19645         * rootcontext.cs (EmitCode): Emit any global attributes.
19646         (AddGlobalAttributes): Used to keep track of assembly attributes. 
19647
19648         * attribute.cs (ApplyAttributes): Support AssemblyAttributes.
19649
19650         * cs-parser.jay: Add support for global attributes.  
19651
19652 2002-02-17  Miguel de Icaza  <miguel@ximian.com>
19653
19654         * expression.cs (Indirection): New helper class.  Unary will
19655         create Indirection classes to be able to implement the
19656         IMemoryLocation interface on it.
19657
19658 2002-02-16  Miguel de Icaza  <miguel@ximian.com>
19659
19660         * cs-parser.jay (fixed_statement): reference the right statement.
19661
19662         * statement.cs (Fixed.Emit): Finish implementing the fixed
19663         statement for the &x case.
19664
19665 2002-02-14  Miguel de Icaza  <miguel@ximian.com>
19666
19667         * class.cs (Property.Define, Method.Define): Remove newslot when
19668         `implementing'.  
19669
19670         * modifiers.cs: My use of NewSlot when `Abstract' was set was
19671         wrong.  NewSlot should only be used if the `new' keyword is present.
19672
19673         * driver.cs (GetSystemDir): Use CodeBase instead of FullName for
19674         locating our system dir.  Sorry about this.
19675
19676 2002-02-13  Miguel de Icaza  <miguel@ximian.com>
19677
19678         * driver.cs (GetSystemDir): Compute correctly the location of our
19679         system assemblies.  I was using the compiler directory instead of
19680         the library directory.
19681
19682 2002-02-13  Ravi Pratap  <ravi@ximian.com>
19683
19684         * expression.cs (BetterFunction): Put back in what Miguel commented out
19685         since it is the correct fix. The problem is elsewhere ;-)
19686
19687         (IsParamsMethodApplicable): Fix bug where we were not checking that the fixed
19688         parameters of the parms method are themselves compatible or not !
19689
19690         (StandardConversionExists): Fix very dangerous bug where we were forgetting
19691         to check that a class implements an interface before saying that an implicit
19692         conversion was allowed. Use ImplementsInterface to do the checking.
19693
19694 2002-02-13  Miguel de Icaza  <miguel@ximian.com>
19695
19696         * class.cs (Method.Define): Track whether we are an explicit
19697         implementation or not.  And only call DefineMethodOverride if we
19698         are an explicit implementation.
19699
19700         (Property.DefineMethod): Ditto.
19701
19702 2002-02-11  Ravi Pratap  <ravi@ximian.com>
19703
19704         * expression.cs (BetterFunction): Catch hideous bug which was
19705          preventing us from detecting ambiguous calls due to implicit casts i.e
19706         cs0121.
19707
19708 2002-01-29  Miguel de Icaza  <miguel@ximian.com>
19709
19710         * support.cs (Pair): Remove un-needed method.  I figured why I was
19711         getting the error in cs-parser.jay, the variable in a foreach loop
19712         is readonly, and the compiler does not really treat this as a variable.
19713
19714         * cs-parser.jay (fixed_statement): Fix grammar.  Use ASSIGN
19715         instead of EQUALS in grammar.  
19716
19717         * typemanager.cs (VerifyUnmanaged): Report correct error (208)
19718
19719         * expression.cs (Unary.DoResolve): Check whether the argument is
19720         managed or not.
19721
19722 2002-01-28  Miguel de Icaza  <miguel@ximian.com>
19723
19724         * support.cs: Api for Pair to set a value.  Despite the fact that
19725         the variables are public the MS C# compiler refuses to compile
19726         code that accesses the field if the variable is part of a foreach
19727         statement. 
19728
19729         * statement.cs (Fixed): Begin implementation of the fixed
19730         statement.
19731
19732         (Block.AddVariable): Return the VariableInfo on success and null
19733         on failure instead of true/false. 
19734
19735         * cs-parser.jay (foreach): Catch errors on variables already
19736         defined (we were ignoring this value before) and properly unwind
19737         the block hierarchy
19738
19739         (fixed_statement): grammar for the fixed statement.
19740
19741 2002-01-25  Miguel de Icaza  <miguel@ximian.com>
19742
19743         * expression.cs (UnaryMutator.IsIncrementableNumber): Allow also
19744         pointer types to be incretemented.
19745
19746         (SizeOf): Implement.
19747
19748         * cs-parser.jay (pointer_member_access): Implement
19749         expr->IDENTIFIER production.
19750
19751         * expression.cs (IndexerAccess.DoResolve, ArrayAccess.DoResolve,
19752         MemberAccess.DoResolve, Invocation.DoResolve): Check for pointers
19753         on safe contexts.
19754
19755         (Unary): Implement indirection.
19756
19757         * ecore.cs (Expression.UnsafeError): Reports error 214 (pointer
19758         use in non-unsafe context).
19759
19760         (SimpleName.DoResolve): Check for pointers in field access on safe
19761         contexts. 
19762
19763         (Expression.LoadFromPtr): Factor the load-indirect code in this
19764         function.  This was duplicated in UnboxCast and ParameterReference
19765
19766 2002-01-24  Miguel de Icaza  <miguel@ximian.com>
19767
19768         * expression.cs (ComposedCast): report an error if a pointer cast
19769         is used in a safe region.
19770
19771         * ecore.cs (Expression.ConvertExplicit): Add rules for implicit
19772         pointer type casts in unsafe context.
19773
19774         * codegen.cs (EmitContext): Set up IsUnsafe.
19775
19776         * cs-parser.jay (non_expression_type): Add productions for pointer
19777         casts. 
19778
19779         * expression.cs (Invocation.EmitCall): Remove chunk of buggy
19780         code.  We should not use force into static mode if the method is
19781         not virtual.  Fixes bug in MIS
19782
19783         * statement.cs (Do.Emit, While.Emit, For.Emit,
19784         Statement.EmitBoolExpression): Add support to Do and While to
19785         propagate infinite loop as `I do return' semantics.
19786
19787         Improve the For case to also test for boolean constants.
19788
19789         * attribute.cs (Attribute.ApplyAttributes): Add ParameterBuilder
19790         to the list of attributes we can add.
19791
19792         Remove `EmitContext' argument.
19793
19794         * class.cs (Method.Define): Apply parameter attributes.
19795         (Constructor.Define): Apply parameter attributes.
19796         (MethodCore.LabelParameters): Move here the core of labeling
19797         parameters. 
19798
19799         * support.cs (ReflectionParameters.ParameterModifier,
19800         InternalParameters.ParameterModifier): Use IsByRef on the type and
19801         only return the OUT bit for these parameters instead of in/out/ref
19802         flags.
19803
19804         This is because I miss-understood things.  The ParameterInfo.IsIn
19805         and IsOut represent whether the parameter has the [In] and [Out]
19806         attributes set.  
19807
19808 2002-01-22  Miguel de Icaza  <miguel@ximian.com>
19809
19810         * ecore.cs (FieldExpr.Emit): Release temporaries.
19811
19812         * assign.cs (LocalTemporary.Release): new function.
19813
19814         * codegen.cs (EmitContext.GetTemporaryStorage,
19815         EmitContext.FreeTemporaryStorage): Rework the way we deal with
19816         temporary storage.  Now we can "put back" localbuilders when we
19817         are done with them
19818
19819 2002-01-21  Miguel de Icaza  <miguel@ximian.com>
19820
19821         * ecore.cs (FieldExpr.Emit): Handle initonly fields specially: we
19822         need to make a copy of the variable to generate verifiable code.
19823
19824 2002-01-19  Miguel de Icaza  <miguel@ximian.com>
19825
19826         * driver.cs: Compute dynamically the system directory.
19827
19828         * ecore.cs (CopyNewMethods): reworked, exposed, made public.
19829         Slower, but more generally useful.  Used by the abstract
19830         registering implementation. 
19831
19832         * expression.cs (ResolveMemberAccess): Reorder the way we evaluate
19833         the rules for the special rule on Type/instances.  First check if
19834         we have the same name, and if so, try that special static path
19835         rather than the instance path.
19836
19837 2002-01-18  Miguel de Icaza  <miguel@ximian.com>
19838
19839         * cs-parser.jay: Emit 642 (warning: possible empty statement) for
19840         for, while and if.
19841
19842         * class.cs (TypeBuilder.DefineType): Do not allow inheritance from
19843         Enum, ValueType, Delegate or Array for non-corlib compiles.
19844
19845         * cs-tokenizer.cs: Catch long identifiers (645)
19846
19847         * typemanager.cs (IndexerPropetyName): Ravi never tested this
19848         piece of code.
19849
19850         * class.cs (TypeContainer.RegisterRequiredImplementations): Bug
19851         fix, we were returning too early, so we were not registering
19852         pending methods from abstract classes.
19853
19854         Do not register pending methods if the class is abstract.
19855
19856         * expression.cs (Conditional.DoResolve): Report circular implicit
19857         conversions when we neecd to compute it for conditional
19858         expressions. 
19859
19860         (Is.DoResolve): If the expression is always of the provided type,
19861         flag warning 183.  If the expression can not ever be of the
19862         provided type flag warning 184.
19863
19864         * class.cs: Catch 169 as well.
19865
19866         * ecore.cs (FieldExpr): For now in AddressOf mark as assigned and
19867         read. 
19868
19869 2002-01-18  Nick Drochak  <ndrochak@gol.com>
19870
19871         * makefile: remove path to beta2 csc.exe.  path to csc.exe must be in PATH instead.
19872
19873 2002-01-17  Miguel de Icaza  <miguel@ximian.com>
19874
19875         * interface.cs: (PopulateMethod): Check for pointers being defined
19876         only if the unsafe context is active.
19877         (PopulateProperty): ditto.
19878         (PopulateIndexer): ditto.
19879
19880         * class.cs (Method, Method.Define): Allow `unsafe' modifier to be
19881         specified.  If pointers are present, make sure that they are
19882         present in an unsafe context.
19883         (Constructor, Constructor.Define): ditto.
19884         (Field, Field.Define): ditto.
19885         (Property, Property.Define): ditto.
19886         (Event, Event.Define): ditto.
19887
19888         * interface.cs (Interface.GetInterfaceTypeByName): Only lookup the
19889         hashtable if there are classes or structs defined.
19890
19891         * expression.cs (LocalVariableReference.DoResolve): Simplify this
19892         code, as the constant resolution moved.
19893
19894         * statement.cs (Block.EmitMeta): Resolve all constants as we emit
19895         the metadata, so we can flag error 133. 
19896
19897         * decl.cs (MemberCore.UnsafeOK): New function to test that a
19898         pointer is being declared in an unsafe context.
19899
19900 2002-01-16  Miguel de Icaza  <miguel@ximian.com>
19901
19902         * modifiers.cs (Modifiers.Check): Require a Location argument.
19903         Report error 227 for Unsafe use.
19904
19905         * typemanager.cs: Remove IsPointerType, we should be using Type.IsPointer
19906
19907         * statement.cs (For.Emit): If the test is null, then report that
19908         we do `return', as we wont reach anything afterwards.
19909
19910         (Switch.SwitchGoverningType): Track the expression that matched
19911         the conversion.
19912
19913         * driver.cs: Allow negative numbers as an error code to flag.
19914
19915         * cs-parser.jay: Handle 1551.
19916
19917         * namespace.cs: Add 1537 checking (repeated using alias namespaces).
19918
19919 2002-01-15  Miguel de Icaza  <miguel@ximian.com>
19920
19921         * cs-parser.jay: Report 1518 (type declaration can only contain
19922         class, struct, interface, enum or delegate)
19923
19924         (switch_label): Report 1523 (keywords `case' or `default' must
19925         preced code)
19926
19927         (opt_switch_sections): Report 1522 (empty switch)
19928
19929         * driver.cs: Report 1515 (response file specified multiple times)
19930         Report 1516 (Source file specified multiple times).
19931
19932         * expression.cs (Argument.Resolve): Signal 1510
19933
19934         (BaseAccess.Resolve, BaseIndexer.Resolve): Signal 1511 (base
19935         access not allowed in static code)
19936
19937 2002-01-11  Ravi Pratap  <ravi@ximian.com>
19938
19939         * typemanager.cs (IsPointerType): Utility method which we are going
19940         to need a lot.
19941
19942         * ecore.cs (ImplicitReferenceConversion): A pointer type cannot be cast to
19943         the object type, so we take care of that.
19944
19945         * expression.cs (FullMethodDesc): Also include the return type in descriptions.
19946
19947         * support.cs (ParameterDesc): Fix minor bug which was causing params tags to be
19948         added to non-params parameters :-)
19949
19950         * typemanager.cs (CSharpName): Include 'void' type too. 
19951
19952         (void_ptr_type): Include in the set of core types.
19953
19954         * ecore.cs (ConvertImplicit): Make use of ConvertImplicitStandard instead of 
19955         duplicating code.
19956
19957         (ConvertImplicitStandard): Handle standard implicit pointer conversions when we have 
19958         an unsafe context.
19959
19960         * cs-parser.jay (local_variable_pointer_type): Add support for 'void *' as I had 
19961         completely forgotten about it.
19962
19963 2002-01-10  Ravi Pratap  <ravi@ximian.com>
19964
19965         * cs-parser.jay (pointer_type): Add. This begins our implementation
19966         of parsing rules for unsafe code.
19967
19968         (unsafe_statement): Implement.
19969
19970         (embedded_statement): Modify to include the above.
19971
19972         * statement.cs (Unsafe): Implement new class for unsafe blocks.
19973
19974         * codegen.cs (EmitContext.InUnsafe): Add. This determines
19975         if the current context is an unsafe one.
19976
19977         * cs-parser.jay (local_variable_pointer_type): Since local variable types
19978         are handled differently, we need separate rules for them.
19979
19980         (local_variable_declaration): Update to use local_variable_pointer_type
19981         to allow variable declarations of unmanaged pointer types.
19982
19983         * expression.cs (Unary.ResolveOperator): Ensure that the '&' operator is used only
19984         in unsafe contexts.
19985
19986         * ../errors/cs0214.cs : Add.
19987
19988 2002-01-16  Nick Drochak  <ndrochak@gol.com>
19989
19990         * makefile: remove 'response' file when cleaning.
19991
19992 2002-01-15  Miguel de Icaza  <miguel@ximian.com>
19993
19994         * cs-parser.jay: Report 1524.
19995
19996 2002-01-14  Miguel de Icaza  <miguel@ximian.com>
19997
19998         * typemanager.cs (RegisterMethod): drop checking if we have
19999         registered this from here
20000
20001 2002-01-12  Miguel de Icaza  <miguel@ximian.com>
20002
20003         * class.cs (Method.EmitDestructor): Implement calling our base
20004         destructor. 
20005
20006         * statement.cs (Try.Emit): Fix to reset the InFinally to the old
20007         value of InFinally.
20008
20009         * codegen.cs (EmitContext.EmitTopBlock): Destructors will call
20010         this routine and will wrap the call in a try/catch block.  Deal
20011         with the case.
20012
20013 2002-01-11  Miguel de Icaza  <miguel@ximian.com>
20014
20015         * ecore.cs (Expression.MemberLookup): instead of taking a
20016         parameter `same_type' that was used to tell whether we could
20017         access private members we compute our containing type from the
20018         EmitContext.
20019
20020         (FieldExpr): Added partial support for volatile fields.  This does
20021         not work for volatile fields exposed from assemblies, as I can not
20022         figure out how to extract the modreq from it.
20023
20024         Updated all the source files to use this.
20025
20026         * codegen.cs (EmitContext): Compute ContainerType ahead of time,
20027         because it is referenced by MemberLookup very often. 
20028
20029 2002-01-09  Ravi Pratap  <ravi@ximian.com>
20030
20031         * typemanager.cs (IndexerPropertyName): If we have a TypeBuilder, use
20032         TypeBuilder.GetCustomAttributes to retrieve what we need.
20033
20034         Get rid of redundant default_member_attr_type as this is the same as
20035         default_member_type which already exists.
20036
20037         * interface.cs, attribute.cs : Update accordingly.
20038
20039 2002-01-08  Miguel de Icaza  <miguel@ximian.com>
20040
20041         * typemanager.cs: Enable IndexerPropertyName again.  It does not
20042         work for TYpeBuilders though.  Ravi, can you please fix this?
20043
20044         * cs-tokenizer.cs: Accept _ as a name in pp-expressions.
20045
20046         * expression.cs (Argument.Emit): Handle the case of ref objects
20047         being passed to ref functions;  
20048
20049         (ParameterReference.EmitLoad): Loads the content of the pointer
20050         without dereferencing.
20051
20052 2002-01-07  Miguel de Icaza  <miguel@ximian.com>
20053
20054         * cs-tokenizer.cs: Implemented the pre-processing expressions.
20055
20056 2002-01-08  Ravi Pratap  <ravi@ximian.com>
20057
20058         * class.cs (Indexer.DefineMethod): Incorporate the interface
20059         type in the name of the method if we are doing explicit interface
20060         implementation.
20061
20062         * expression.cs (ConversionExists): Remove as it is completely obsolete.
20063
20064         (BetterConversion): Fix extremely trivial bug where we were referring to
20065         ConversionExists instead of StandardConversionExists ! Hooray, things are fine
20066         again !
20067
20068         * ../errors/bug16.cs : Add although we have fixed it.
20069
20070 2002-01-07  Miguel de Icaza  <miguel@ximian.com>
20071
20072         * expression.cs (BaseIndexer): Begin implementation.
20073
20074         * class.cs (TypeContainer.IsInterfaceMethod): Bug fix.
20075
20076         * cs-parser.jay (indexer_declarator): Use qualified_identifier
20077         production directly to remove a shift/reduce, and implement
20078         explicit interface implementation.
20079
20080         * cs-tokenizer.cs: Fix tokenizer, it was consuming one extra char
20081         after a floating point suffix.
20082
20083         * expression.cs (DoNumericPromotions): Improved the conversion for
20084         uint/uint.  If we have a constant, we avoid doing a typecast to a
20085         larger type.
20086
20087         * class.cs (Indexer): Implement explicit interface implementation
20088         for indexers.
20089
20090 Sat Jan 5 16:08:23 CET 2002 Paolo Molaro <lupus@ximian.com>
20091
20092         * class.cs: make the default instance constructor public and hidebysig.
20093
20094 2001-01-03  Ravi Pratap  <ravi@ximian.com>
20095
20096         * interface.cs (EmitDefaultMemberAttr): Make this helper method static
20097         so we can call it from elsewhere.
20098
20099         * class.cs (TypeContainer.Emit): Emit the attribute here too. The rule is that
20100         we emit it internally if the class has a defined indexer; otherwise the user
20101         emits it by decorating the class definition with the DefaultMemberAttribute.
20102
20103         * attribute.cs (ApplyAttributes): Perform checks to see that the DefaultMember
20104         attribute is not used on a type which defines an indexer.
20105
20106         * cs-tokenizer.cs (get_cmd_arg): Ensure we trim whitespace and also include the tab
20107         character when we skip whitespace.
20108
20109         * ../errors/cs0646.cs : Add.
20110
20111 2002-01-03  Miguel de Icaza  <miguel@ximian.com>
20112
20113         * ecore.cs (SimpleName.ResolveSimpleName): Report error 120
20114         again. 
20115
20116         * makefile: Add practical target `mcs3.exe' which builds the third
20117         generation compiler. 
20118
20119         * expression.cs (New): Fix structures constructor calling.
20120
20121         * class.cs (Property, Method, Indexer): Emit Final flag on the
20122         method if we are an interface implementation and we are not
20123         abstract. 
20124
20125         * ecore.cs (PropertyExpr): New public field `IsBase', tells
20126         whether this property is referencing a `base' method.
20127
20128         * expression.cs (Invocation.EmitCall): take an extra argument:
20129         is_base, this is used to determine whether the `call' or
20130         `callvirt' opcode should be used.
20131
20132
20133         * delegate.cs: update EmitCall.
20134
20135         * class.cs (Method.Define): Set NewSlot for the cases where we are
20136         not implementing an interface method.
20137
20138         (Property.Define): ditto.
20139
20140 2002-01-02  Miguel de Icaza  <miguel@ximian.com>
20141
20142         * cs-tokenizer.cs: (Tokenizer.escape): Escape '\r' as '\r' not as
20143         'r'.  Allows mcs to parse itself fully.
20144
20145 2002-01-02  Ravi Pratap  <ravi@ximian.com>
20146
20147         * expression.cs (ArrayCreation.num_automatic_initializers): Keep track
20148         of the number of initializers that require the InitializeArray method.
20149
20150         (CheckIndices): Store the Expression in all cases - not the plain value. Also
20151         update the above field where necessary.
20152
20153         (MakeByteBlob): Update accordingly.
20154
20155         (DoEmit): Call EmitStaticInitializers only if the number of initializers is 
20156         greater than 2.
20157
20158         (EmitDynamicInitializers): Update in accordance with the new optimization.
20159
20160         (ArrayAccess.EmitStoreOpcode): Include char type along with short and ushort - the
20161         same OpCode applies.
20162
20163         * cs-parser.jay : Fix some glaring errors I introduced.
20164
20165 2002-01-01  Ravi Pratap  <ravi@ximian.com> 
20166
20167         * parameters.cs (AddVariable, AddConstant): Pass in current_local_parameters
20168         so that we can check for name clashes there too.
20169
20170         * typemanager.cs (default_member_attr_type): The attribute that we need to emit
20171         for interface indexers.
20172
20173         * interfaces.cs (Define): Emit the default member attribute.
20174
20175         * expression.cs (MakeByteBlob): Fix extremely trivial bug where the wrong
20176         variable was being referred to while setting the value ;-)
20177
20178 2002-01-01  Miguel de Icaza  <miguel@ximian.com>
20179
20180         * expression.cs (MakeByteBlob): Optimize: we do not need to fill
20181         byte-by-byte information when we know the data is zero.
20182
20183         Make the block always a multiple of 4, because
20184         DefineInitializedData has a bug.
20185
20186         * assign.cs: Fix, we should assign from the temporary, not from
20187         the source. 
20188
20189         * expression.cs (MakeByteBlob): Fix my incorrect code.
20190
20191 2001-12-31  Miguel de Icaza  <miguel@ximian.com>
20192
20193         * typemanager.cs (EnumToUnderlying): This function is used to get
20194         the underlying type from an enumeration, because it does not
20195         always work. 
20196
20197         * constant.cs: Use the I4_S form for values between -128 and 127.
20198
20199         * statement.cs (Block.LookupLabel): Looks up a label.
20200         (Block): Drop support for labeled blocks.
20201
20202         (LabeledStatement): New kind of statement that represents a label
20203         only.
20204
20205         (Goto): Finally implement this bad boy.
20206
20207         * cs-parser.jay: Update to reflect new mechanism to implement
20208         labels.
20209
20210 2001-12-30  Miguel de Icaza  <miguel@ximian.com>
20211
20212         * codegen.cs (EmitContext.This): a codegen property that keeps the
20213         a single instance of this instead of creating many different this
20214         instances. 
20215
20216         * delegate.cs (Delegate.DoResolve): Update to use the property;
20217
20218         * ecore.cs (SimpleName.SimpleNameResolve): Ditto
20219
20220         * expression.cs (BaseAccess.DoResolve): Ditto.
20221
20222 2001-12-29  Ravi Pratap  <ravi@ximian.com>
20223
20224         * typemanager.cs (methodimpl_attr_type): Add to hold the type
20225         corresponding to System.Runtime.CompilerServices.MethodImplAttribute.
20226
20227         (InitCoreTypes): Update accordingly.
20228
20229         * attribute.cs (Resolve): Remember if the attribute is a MethodImplAttribute
20230         so we can quickly store the state.
20231
20232         (ApplyAttributes): Set the correct implementation flags
20233         for InternalCall methods.
20234
20235 2001-12-29  Miguel de Icaza  <miguel@ximian.com>
20236
20237         * expression.cs (EmitCall): if a method is not virtual, then do
20238         not use callvirt on it.
20239
20240         (ArrayAccess.EmitAssign): storing non-builtin value types (ie,
20241         user defined stuff) requires the use of stobj, which takes an
20242         address on the stack instead of an array and an index.  So emit
20243         the Ldelema operation for it.
20244
20245         (EmitStoreOpcode): Use stobj for valuetypes.
20246
20247         (UnaryMutator.EmitCode): Use the right 1 value depending on
20248         whether we are dealing with int64/uint64, float or doubles.
20249
20250         * class.cs (TypeContainer.AddConstructor): Fix the logic to define
20251         constructors that I implemented last night.
20252
20253         (Constructor.IsDefault): Fix to work properly for static
20254         constructors.
20255
20256         * cs-parser.jay (CheckDef): report method signature errors.
20257         Update error number 103 to be 132.
20258
20259         * decl.cs: New AdditionResult enumeration value: MethodExists.
20260         Although we do this check for methods later on in the semantic
20261         analysis, catching repeated default constructors is so easy that
20262         we catch these here. 
20263
20264         * expression.cs (Binary.DoNumericPromotions): Fix the uint64 type
20265         promotions code.
20266
20267         (ParameterReference.EmitAssign, Emit): handle
20268         bools as bytes.
20269
20270         (ArrayAccess.EmitLoadOpcode): Handle bool type here.
20271         (ArrayAccess.EmitStoreOpcode): ditto.
20272
20273         * cs-tokenizer.cs (is_punct): Eliminated empty computation.
20274
20275         * expression.cs (MakeByteBlob): Complete all the missing types
20276         (uint, short, ushort, byte, sbyte)
20277
20278         * class.cs: Only init instance field initializers on instance
20279         constructors. 
20280
20281         Rename `constructors' to instance_constructors. 
20282
20283         (TypeContainer.AddConstructor): Only add constructors to the list
20284         if it is not static.
20285
20286         Make sure that we handle default_static_constructor independently
20287         everywhere where we handle instance_constructors
20288
20289 2001-12-28  Miguel de Icaza  <miguel@ximian.com>
20290
20291         * class.cs: Do not lookup or create a base initializer for a
20292         static constructor.
20293
20294         (ConstructorInitializer.Resolve): use the proper type to lookup
20295         for constructors.
20296
20297         * cs-parser.jay: Report error 1585 (modifiers between type and name).
20298
20299         * enum.cs, interface.cs: Remove CloseType, this is taken care by
20300         in DeclSpace. 
20301
20302         * decl.cs: CloseType is now an virtual method, the default
20303         implementation just closes this type.
20304
20305 2001-12-28  Ravi Pratap  <ravi@ximian.com>
20306
20307         * attribute.cs (DefinePInvokeMethod): Set the implementation flags
20308         to PreserveSig by default. Also emit HideBySig on such methods.
20309
20310         Basically, set the defaults to standard values.
20311
20312         * expression.cs (Invocation.BetterFunction): We need to make sure that for each
20313         argument, if candidate is better, it can't be worse than the best !
20314
20315         (Invocation): Re-write bits to differentiate between methods being
20316         applicable in their expanded form and their normal form - for params
20317         methods of course.
20318
20319         Get rid of use_standard everywhere as only standard conversions are allowed
20320         in overload resolution. 
20321
20322         More spec conformance.
20323
20324 2001-12-27  Miguel de Icaza  <miguel@ximian.com>
20325
20326         * driver.cs: Add --timestamp, to see where the compiler spends
20327         most of its time.
20328
20329         * ecore.cs (SimpleName.DoResolve): Do not create an implicit
20330         `this' in static code.
20331
20332         (SimpleName.DoResolve): Implement in terms of a helper function
20333         that allows static-references to be passed upstream to
20334         MemberAccess.
20335
20336         (Expression.ResolveWithSimpleName): Resolve specially simple
20337         names when called by MemberAccess to implement the special
20338         semantics. 
20339
20340         (Expression.ImplicitReferenceConversion): Handle conversions from
20341         Null to reference types before others, as Null's type is
20342         System.Object. 
20343
20344         * expression.cs (Invocation.EmitCall): Handle the special case of
20345         calling methods declared on a reference type from a ValueType
20346         (Base classes System.Object and System.Enum)
20347
20348         (MemberAccess.Resolve): Only perform lookups on Enumerations if
20349         the left hand side is a TypeExpr, not on every enumeration. 
20350
20351         (Binary.Resolve): If types are reference types, then do a cast to
20352         object on operators != and == of both arguments.
20353
20354         * typemanager.cs (FindMembers): Extract instance and static
20355         members if requested.
20356
20357         * interface.cs (PopulateProperty): Use void_type instead of null
20358         as the return type for the setter method.
20359
20360         (PopulateIndexer): ditto.
20361
20362 2001-12-27  Ravi Pratap  <ravi@ximian.com>
20363
20364         * support.cs (ReflectionParameters): Fix minor bug where we
20365         were examining the wrong parameter for the ParamArray attribute.
20366
20367         Cope with requests for the type of the parameter at position
20368         greater than the params parameter's. We now return the element
20369         type of the params array as that makes more sense.
20370
20371         * expression.cs (Invocation.IsParamsMethodApplicable): Update 
20372         accordingly as we no longer have to extract the element type
20373         ourselves.
20374
20375         (Invocation.OverloadResolve): Update.
20376
20377 2001-12-27  Miguel de Icaza  <miguel@ximian.com>
20378
20379         * statement.cs (Foreach.GetEnumeratorFilter): Do not compare
20380         against IEnumerator, test whether the return value is a descendant
20381         of the IEnumerator interface.
20382
20383         * class.cs (Indexer.Define): Use an auxiliary method to implement
20384         the other bits of the method definition.  Begin support for
20385         explicit interface implementation.
20386
20387         (Property.DefineMethod): Use TypeManager.void_type instead of null
20388         for an empty return value.
20389
20390 2001-12-26  Miguel de Icaza  <miguel@ximian.com>
20391
20392         * expression.cs (MemberAccess.ResolveMemberAccess): if we are
20393         dealing with a FieldExpr which is composed of a FieldBuilder, in
20394         the code path we did extract the constant, but we should have
20395         obtained the underlying value to be able to cast it (otherwise we
20396         end up in an infinite loop, this is what Ravi was running into).
20397
20398         (ArrayCreation.UpdateIndices): Arrays might be empty.
20399
20400         (MemberAccess.ResolveMemberAccess): Add support for section
20401         14.5.4.1 that deals with the special case of E.I when E is a type
20402         and something else, that I can be a reference to a static member.
20403
20404         (ArrayCreation.MakeByteBlob): It is not an error to not be able to
20405         handle a particular array type to create byte blobs, it is just
20406         something we dont generate byteblobs for.
20407
20408         * cs-tokenizer.cs (get_cmd_arg): Ignore \r in commands and
20409         arguments. 
20410
20411         * location.cs (Push): remove the key from the hashtable that we
20412         are about to add.   This happens for empty files.
20413
20414         * driver.cs: Dispose files after we have parsed them.
20415
20416         (tokenize): new function that only runs the tokenizer on its
20417         input, for speed testing.
20418
20419 2001-12-26  Ravi Pratap  <ravi@ximian.com>
20420
20421         * class.cs (Event.Define): Define the private field only if there
20422         are no accessors defined.
20423
20424         * expression.cs (ResolveMemberAccess): If there is no associated
20425         field with the event, that means we have an event defined with its
20426         own accessors and we should flag error cs0070 since transforming
20427         ourselves into a field is not valid in that case.
20428
20429         * ecore.cs (SimpleName.DoResolve): Same as above.
20430
20431         * attribute.cs (DefinePInvokeMethod): Set the default calling convention
20432         and charset to sane values.
20433
20434 2001-12-25  Ravi Pratap  <ravi@ximian.com>
20435
20436         * assign.cs (DoResolve): Perform check on events only if they 
20437         are being accessed outside the declaring type.
20438
20439         * cs-parser.jay (event_declarations): Update rules to correctly
20440         set the type of the implicit parameter etc.
20441
20442         (add_accessor, remove_accessor): Set current local parameters.
20443
20444         * expression.cs (Binary): For delegate addition and subtraction,
20445         cast the return value from the method into the appropriate delegate
20446         type.
20447
20448 2001-12-24  Ravi Pratap  <ravi@ximian.com>
20449
20450         * typemanager.cs (RegisterDelegateData, GetDelegateData): Get rid
20451         of these as the workaround is unnecessary.
20452
20453         * delegate.cs (NewDelegate.DoResolve): Get rid of bits which registered
20454         delegate data - none of that is needed at all.
20455
20456         Re-write bits to extract the instance expression and the delegate method
20457         correctly.
20458
20459         * expression.cs (Binary.ResolveOperator): Handle the '-' binary operator 
20460         on delegates too.
20461
20462         * attribute.cs (ApplyAttributes): New method to take care of common tasks
20463         of attaching attributes instead of duplicating code everywhere.
20464
20465         * everywhere : Update code to do attribute emission using the above method.
20466
20467 2001-12-23  Miguel de Icaza  <miguel@ximian.com>
20468
20469         * expression.cs (IsParamsMethodApplicable): if there are not
20470         parameters, return immediately.
20471
20472         * ecore.cs: The 0 literal can be implicity converted to an enum
20473         type. 
20474
20475         (SimpleName.DoResolve): First lookup the type, then lookup the
20476         members. 
20477
20478         (FieldExpr.Emit): If the InstanceExpression is a ValueType, we
20479         want to get its address.  If the InstanceExpression is not
20480         addressable, store the result in a temporary variable, then get
20481         the address of it.
20482
20483         * codegen.cs: Only display 219 errors on warning level or above. 
20484
20485         * expression.cs (ArrayAccess): Make it implement the
20486         IMemoryLocation interface.
20487
20488         (Binary.DoResolve): handle the operator == (object a, object b)
20489         and operator != (object a, object b) without incurring into a
20490         BoxedCast (because 5 != o should never be performed).
20491
20492         Handle binary enumerator operators.
20493
20494         (EmitLoadOpcode): Use Ldelema if the object we are loading is a
20495         value type, otherwise use Ldelem_ref.
20496
20497         Use precomputed names;
20498
20499         (AddressOf): Implement address of
20500
20501         * cs-parser.jay (labeled_statement): Fix recursive block
20502         addition by reworking the production.
20503
20504         * expression.cs (New.DoEmit): New has a special case:
20505                 
20506                  If we are dealing with a ValueType, we have a few
20507                  situations to deal with:
20508                 
20509                     * The target of New is a ValueType variable, that is
20510                       easy, we just pass this as the variable reference
20511                 
20512                     * The target of New is being passed as an argument,
20513                       to a boxing operation or a function that takes a
20514                       ValueType.
20515                 
20516                       In this case, we need to create a temporary variable
20517                       that is the argument of New.
20518
20519
20520 2001-12-23  Ravi Pratap  <ravi@ximian.com>
20521
20522         * rootcontext.cs (LookupType): Check that current_type is not null before
20523         going about looking at nested types.
20524
20525         * ecore.cs (EventExpr.EmitAddOrRemove): Rename from EmitAssign as we do
20526         not implement the IAssignMethod interface any more.
20527
20528         * expression.cs (MemberAccess.ResolveMemberAccess): Handle EventExprs specially
20529         where we tranform them into FieldExprs if they are being resolved from within
20530         the declaring type.
20531
20532         * ecore.cs (SimpleName.DoResolve): Do the same here.
20533
20534         * assign.cs (DoResolve, Emit): Clean up code considerably. 
20535
20536         * ../errors/bug10.cs : Add.
20537
20538         * ../errors/cs0070.cs : Add.
20539
20540         * typemanager.cs : Use PtrHashtable for Delegate data hashtable etc.
20541
20542         * assign.cs : Get rid of EventIsLocal everywhere.
20543
20544 2001-12-23  Miguel de Icaza  <miguel@ximian.com>
20545
20546         * ecore.cs (ConvertIntLiteral): finished the implementation.
20547
20548         * statement.cs (SwitchLabel): Convert the value we are using as a
20549         key before looking up the table.
20550
20551 2001-12-22  Miguel de Icaza  <miguel@ximian.com>
20552
20553         * codegen.cs (EmitTopBlock): Require a Location argument now.
20554
20555         * cs-parser.jay (constructor_declarator): We need to setup
20556         current_local_parameters before we parse the
20557         opt_constructor_initializer, to allow the variables to be bound
20558         to the constructor arguments.
20559
20560         * rootcontext.cs (LookupType): First lookup nested classes in our
20561         class and our parents before we go looking outside our class.
20562
20563         * expression.cs (ConstantFold): Extract/debox the values at the
20564         beginnning. 
20565
20566         * rootcontext.cs (EmitCode): Resolve the constants first before we
20567         resolve the types.  This is not really needed, but it helps debugging.
20568
20569         * statement.cs: report location.
20570
20571         * cs-parser.jay: pass location to throw statement.
20572
20573         * driver.cs: Small bug fix.
20574
20575         * report.cs: Updated format to be 4-zero filled digits.
20576
20577 2001-12-22  Ravi Pratap  <ravi@ximian.com>
20578
20579         * expression.cs (CheckIndices): Fix minor bug where the wrong
20580         variable was being referred to ;-)
20581
20582         (DoEmit): Do not call EmitStaticInitializers when the 
20583         underlying type is System.Object.
20584
20585 2001-12-21  Ravi Pratap  <ravi@ximian.com>
20586
20587         * ecore.cs (EventExpr.Resolve): Implement to correctly set the type
20588         and do the usual workaround for SRE.
20589
20590         * class.cs (MyEventBuilder.EventType): New member to get at the type
20591         of the event, quickly.
20592
20593         * expression.cs (Binary.ResolveOperator): Handle delegate addition.
20594
20595         * assign.cs (Assign.DoResolve): Handle the case when the target
20596         is an EventExpr and perform the necessary checks.
20597
20598         * ecore.cs (EventExpr.EmitAssign): Implement the IAssignMethod
20599         interface.
20600
20601         (SimpleName.MemberStaticCheck): Include check for EventExpr.
20602
20603         (EventExpr): Set the type in the constructor itself since we 
20604         are meant to be born fully resolved.
20605
20606         (EventExpr.Define): Revert code I wrote earlier.
20607                 
20608         * delegate.cs (NewDelegate.Resolve): Handle the case when the MethodGroup's
20609         instance expression is null. The instance expression is a This in that case
20610         or a null, depending on whether it is a static method or not.
20611
20612         Also flag an error if the reference to a method is ambiguous i.e the MethodGroupExpr
20613         refers to more than one method.
20614
20615         * assign.cs (DoResolve): Check whether the event belongs to the same Type container
20616         and accordingly flag errors.
20617
20618 2001-12-21  Miguel de Icaza  <miguel@ximian.com>
20619
20620         * statement.cs (Throw.Emit): Add support for re-throwing exceptions.
20621
20622 2001-12-22  Miguel de Icaza  <miguel@ximian.com>
20623
20624         * location.cs (ToString): Provide useful rutine.
20625
20626 2001-12-21  Miguel de Icaza  <miguel@ximian.com>
20627
20628         * ecore.cs (Expression.ConvertIntLiteral): Do not return Constant
20629         objects, return the actual integral boxed.
20630
20631         * statement.cs (SwitchLabel): define an ILLabel for each
20632         SwitchLabel. 
20633
20634         (Switch.CheckSwitch): If the value is a Literal, extract
20635         the underlying literal.
20636
20637         Also in the unused hashtable we had, add the SwitchLabel so we can
20638         quickly look this value up.
20639
20640         * constant.cs: Implement a bunch of new constants.  Rewrite
20641         Literal based on this.  Made changes everywhere to adapt to this.
20642
20643         * expression.cs (Expression.MakeByteBlob): Optimize routine by
20644         dereferencing array only once, and also copes with enumrations.
20645
20646         bytes are two bytes wide, not one.
20647
20648         (Cast): Perform constant conversions.
20649
20650         * ecore.cs (TryImplicitIntConversion): Return literals instead of
20651         wrappers to the literals here.
20652
20653         * expression.cs (DoNumericPromotions): long literals can converted
20654         to ulong implicity (this is taken care of elsewhere, but I was
20655         missing this spot).
20656
20657         * ecore.cs (Expression.Literalize): Make the return type Literal,
20658         to improve type checking.
20659
20660         * rootcontext.cs: Lookup for nested classes in our class hierarchy.
20661
20662 2001-12-20  Miguel de Icaza  <miguel@ximian.com>
20663
20664         * literal.cs: Revert code from ravi that checked the bounds.  The
20665         bounds are sane by the definition of the type itself. 
20666
20667         * typemanager.cs: Fix implementation of ImplementsInterface.  We
20668         need to actually look up in our parent hierarchy for interfaces
20669         implemented. 
20670
20671         * const.cs: Use the underlying type for enumerations
20672
20673         * delegate.cs: Compute the basename for the delegate creation,
20674         that should fix the delegate test case, and restore the correct
20675         Type Lookup semantics in rootcontext
20676
20677         * rootcontext.cs: Revert Ravi's last patch.  The correct way of
20678         referencing a nested type with the Reflection API is using the "+"
20679         sign. 
20680
20681         * cs-parser.jay: Do not require EOF token at the end.
20682
20683 2001-12-20  Ravi Pratap  <ravi@ximian.com>
20684
20685         * rootcontext.cs (LookupType): Concatenate type names with
20686         a '.' instead of a '+' The test suite passes again.
20687
20688         * enum.cs (Enum.DefineEnum): Set RTSpecialName on the 'value__'
20689         field of the enumeration.
20690
20691         * expression.cs (MemberAccess.ResolveMemberAccess): Add support for
20692         the case when the member is an EventExpr.
20693
20694         * ecore.cs (EventExpr.InstanceExpression): Every event which is not
20695         static has an associated instance expression.
20696
20697         * typemanager.cs (RegisterEvent): The usual workaround, now for events.
20698
20699         (GetAddMethod, GetRemoveMethod): Workarounds, as usual.
20700
20701         * class.cs (Event.Define): Register event and perform appropriate checks
20702         for error #111.
20703
20704         We define the Add and Remove methods even if the use provides none because
20705         in that case, we provide default implementations ourselves.
20706
20707         Define a private field of the type of the event. This is done by the CSC compiler
20708         and we should be doing it too ;-)
20709
20710         * typemanager.cs (delegate_combine_delegate_delegate, delegate_remove_delegate_delegate):
20711         More methods we use in code we generate.
20712
20713         (multicast_delegate_type, delegate_type): Two separate types since the distinction
20714         is important.
20715
20716         (InitCoreTypes): Update accordingly for the above.
20717
20718         * class.cs (Event.Emit): Generate code for default accessors that we provide
20719
20720         (EmitDefaultMethod): Do the job in the above.
20721
20722         * delegate.cs (DefineDelegate): Use TypeManager.multicast_delegate_type in the 
20723         appropriate place.
20724
20725 2001-12-20  Miguel de Icaza  <miguel@ximian.com>
20726
20727         * class.cs (Indexer.Define): Fix bug, we were setting both Get/Set
20728         builders even if we were missing one.
20729
20730         * interface.cs, class.cs, enum.cs: When calling DefineNestedType
20731         pass the Basename as our class name instead of the Name.  The
20732         basename will be correctly composed for us.
20733
20734         * parameter.cs (Paramters): Now takes a Location argument.
20735
20736         * decl.cs (DeclSpace.LookupType): Removed convenience function and
20737         make all the code call directly LookupType in RootContext and take
20738         this chance to pass the Location information everywhere.
20739
20740         * Everywhere: pass Location information.
20741
20742 2001-12-19  Miguel de Icaza  <miguel@ximian.com>
20743
20744         * class.cs (Constructor.Define): Updated way of detecting the
20745         length of the parameters.
20746
20747         (TypeContainer.DefineType): Use basename as the type name for
20748         nested types.
20749
20750         (TypeContainer.Define): Do not recursively define types here, as
20751         definition is taken care in order by the RootContext.
20752
20753         * tree.cs: Keep track of namespaces in a per-file basis.
20754
20755         * parameter.cs (Parameter.ComputeSignature): Update to use
20756         DeclSpace. 
20757
20758         (Parameters.GetSignature): ditto.
20759
20760         * interface.cs (InterfaceMethod.GetSignature): Take a DeclSpace
20761         instead of a TypeContainer.
20762
20763         (Interface.SemanticAnalysis): Use `this' instead of our parent to
20764         resolve names.  Because we need to be resolve in our context, not
20765         our parents.
20766
20767         * driver.cs: Implement response files.
20768
20769         * class.cs (TypeContainer.DefineType): If we are defined, do not
20770         redefine ourselves.
20771
20772         (Event.Emit): Emit the code for add/remove handlers.
20773         (Event.Define): Save the MethodBuilders for add/remove.
20774
20775         * typemanager.cs: Use pair here too.
20776
20777         * cs-parser.jay: Replaced use of DictionaryEntry for Pair because
20778         DictionaryEntry requires the first argument to be non-null.  
20779
20780         (enum_declaration): Compute full name for registering the
20781         enumeration.
20782
20783         (delegate_declaration): Instead of using
20784         formal_parameter_list, use opt_formal_parameter_list as the list
20785         can be empty.
20786
20787         * cs-tokenizer.cs (PropertyParsing): renamed from `properties'
20788         (EventParsing): New property that controls whether `add' and
20789         `remove' are returned as tokens or identifiers (for events);
20790
20791 2001-12-19  Ravi Pratap  <ravi@ximian.com>
20792
20793         * class.cs (Event.Define): Revamp use of EventBuilder completely. We now
20794         use MyEventBuilder only and let it wrap the real builder for us.
20795
20796         (MyEventBuilder): Revamp constructor etc.
20797
20798         Implement all operations that we perform on EventBuilder in precisely the same
20799         way here too.
20800
20801         (FindMembers): Update to use the EventBuilder member.
20802
20803         (Event.Emit): Update accordingly.
20804
20805 2001-12-18  Ravi Pratap  <ravi@ximian.com>
20806
20807         * class.cs (MyEventBuilder.Set*): Chain to the underlying builder
20808         by calling the appropriate methods.
20809
20810         (GetCustomAttributes): Make stubs as they cannot possibly do anything
20811         useful.
20812
20813         (Event.Emit): Use MyEventBuilder everywhere - even to set attributes.
20814
20815 2001-12-17  Ravi Pratap  <ravi@ximian.com>
20816
20817         * delegate.cs (Delegate.Populate): Check that the return type
20818         and various parameters types are indeed accessible.
20819
20820         * class.cs (Constructor.Define): Same here.
20821
20822         (Field.Define): Ditto.
20823
20824         (Event.Define): Ditto.
20825
20826         (Operator.Define): Check that the underlying Method defined itself
20827         correctly - so it's MethodBuilder should not be null.
20828
20829         * delegate.cs (DelegateInvocation.DoResolve): Bale out if the type of the Instance
20830         expression happens to be null.
20831
20832         * class.cs (MyEventBuilder): Workaround for SRE lameness. Implement various abstract
20833         members but as of now we don't seem to be able to do anything really useful with it.
20834
20835         (FindMembers): Handle events separately by returning the MyEventBuilder of the event,
20836         not the EventBuilder.
20837
20838 2001-12-18  Miguel de Icaza  <miguel@ximian.com>
20839
20840         * cs-tokenizer.cs: Add support for defines.
20841         Add support for #if, #elif, #else, #endif
20842
20843         (eval_var): evaluates a variable.
20844         (eval): stubbed for evaluating functions.
20845
20846         * cs-parser.jay: Pass the defines information
20847
20848         * driver.cs: Add --define command line option.
20849
20850         * decl.cs: Move MemberCore here.
20851
20852         Make it the base class for DeclSpace.  This allows us to catch and
20853         report 108 and 109 for everything now.
20854
20855         * class.cs (TypeContainer.Define): Extract all the members
20856         before populating and emit the warning 108 (new keyword required
20857         to override) instead of having each member implement this.
20858
20859         (MemberCore.Define): New abstract method, we will be using this in
20860         the warning reporting engine in Populate.
20861
20862         (Operator.Define): Adjust to new MemberCore protocol. 
20863
20864         * const.cs (Const): This does not derive from Expression, it is a
20865         temporary object we use to create fields, it is a MemberCore. 
20866
20867         * class.cs (Method.Define): Allow the entry point to be in a
20868         specific class.
20869
20870         * driver.cs: Rewrite the argument handler to clean it up a bit.
20871
20872         * rootcontext.cs: Made it just an auxiliary namespace feature by
20873         making everything static.
20874
20875         * driver.cs: Adapt code to use RootContext type name instead of
20876         instance variable.
20877
20878         * delegate.cs: Remove RootContext argument.
20879
20880         * class.cs: (Struct, TypeContainer, Class): Remove RootContext
20881         argument. 
20882
20883         * class.cs (Event.Define): The lookup can fail.
20884
20885         * cs-tokenizer.cs: Begin implementation of pre-procesor. 
20886
20887         * expression.cs: Resolve the this instance before invoking the code.
20888
20889 2001-12-17  Miguel de Icaza  <miguel@ximian.com>
20890
20891         * cs-parser.jay: Add a production in element_access that allows
20892         the thing to become a "type" reference.  This way we can parse
20893         things like "(string [])" as a type.
20894
20895         Note that this still does not handle the more complex rules of
20896         casts. 
20897
20898
20899         * delegate.cs (Delegate.Populate): Register the delegage constructor builder here. 
20900
20901         * ecore.cs: (CopyNewMethods): new utility function used to
20902         assemble the list of methods from running FindMembers.
20903
20904         (MemberLookup): Rework FindMembers so that 
20905
20906 2001-12-16  Miguel de Icaza  <miguel@ximian.com>
20907
20908         * class.cs (TypeContainer): Remove Delegates who fail to be
20909         defined.
20910
20911         * delegate.cs (Populate): Verify that we dont get null return
20912         values.   TODO: Check for AsAccessible.
20913
20914         * cs-parser.jay: Use basename to emit error 574 (destructor should
20915         have the same name as container class), not the full name.
20916
20917         * cs-tokenizer.cs (adjust_int): Fit the integer in the best
20918         possible representation.  
20919
20920         Also implements integer type suffixes U and L.
20921
20922 2001-12-15  Miguel de Icaza  <miguel@ximian.com>
20923
20924         * expression.cs (ArrayCreation.DoResolve): We need to do the
20925         argument resolution *always*.
20926
20927         * decl.cs: Make this hold the namespace.  Hold the root context as
20928         well.
20929         (LookupType): Move here.
20930
20931         * enum.cs, class.cs, interface.cs: Adapt to new hierarchy.
20932
20933         * location.cs (Row, Name): Fixed the code, it was always returning
20934         references to the first file.
20935
20936         * interface.cs: Register properties defined through interfaces.
20937
20938         * driver.cs: Add support for globbing on the command line
20939
20940         * class.cs (Field): Make it derive from MemberCore as well.
20941         (Event): ditto.
20942
20943 2001-12-15  Ravi Pratap  <ravi@ximian.com>
20944
20945         * class.cs (Event::Define): Check that the type of the event is a delegate
20946         type else flag error #66.
20947
20948         Also, re-use TypeContainer.MethodModifiersValid here too as the rules are the
20949         same.
20950
20951         * attribute.cs (DefinePInvokeMethod): Handle named arguments and process
20952         values of EntryPoint, CharSet etc etc.
20953
20954         Pass in the values to TypeBuilder.DefinePInvokeMethod; determine Type etc neatly.
20955
20956         * class.cs (FindMembers): If a method is in transit, its MethodBuilder will
20957         be null and we should ignore this. I am not sure if this is really clean. Apparently,
20958         there's no way of avoiding hitting this because the call is coming from SimpleName.DoResolve,
20959         which needs this to do its work.
20960
20961         * ../errors/cs0066.cs : Add.
20962
20963 2001-12-14  Miguel de Icaza  <miguel@ximian.com>
20964
20965         * typemanager.cs: (GetPropertyGetter, GetPropertyGetter): New
20966         helper functions.
20967
20968         * class.cs: (MethodSignature.MethodSignature): Removed hack that
20969         clears out the parameters field.
20970         (MemberSignatureCompare): Cleanup
20971
20972         (MemberCore): New base class used to share code between MethodCore
20973         and Property.
20974
20975         (RegisterRequiredImplementations) BindingFlags.Public requires
20976         either BindingFlags.Instace or Static.  Use instance here.
20977
20978         (Property): Refactored code to cope better with the full spec.
20979
20980         * parameter.cs (GetParameterInfo): Return an empty array instead
20981         of null on error.
20982
20983         * class.cs (Property): Abstract or extern properties have no bodies.
20984
20985         * parameter.cs (GetParameterInfo): return a zero-sized array.
20986
20987         * class.cs (TypeContainer.MethodModifiersValid): Move all the
20988         method modifier validation to the typecontainer so we can reuse
20989         this on properties.
20990
20991         (MethodCore.ParameterTypes): return an empty sized array of types.
20992
20993         (Property.Define): Test property modifier validity.
20994
20995         Add tests for sealed/override too.
20996
20997         (Method.Emit): abstract or extern methods have no bodies.
20998
20999 2001-12-14  Ravi Pratap  <ravi@ximian.com>
21000
21001         * class.cs (Method.IsPInvoke): Get rid of it as it is an expensive
21002         thing.
21003
21004         (Method::Define, ::Emit): Modify accordingly.
21005
21006         * expression.cs (Invocation::OverloadResolve): Handle error # 121.
21007
21008         (ArrayCreation::MakeByteBlob): Handle floats and doubles.
21009
21010         * makefile: Pass in /unsafe.
21011
21012 2001-12-13  Miguel de Icaza  <miguel@ximian.com>
21013
21014         * class.cs (MakeKey): Kill routine.
21015
21016         * class.cs (TypeContainer.Define): Correctly define explicit
21017         method implementations (they require the full interface name plus
21018         the method name).
21019
21020         * typemanager.cs: Deply the PtrHashtable here and stop using the
21021         lame keys.  Things work so much better.
21022
21023         This of course broke everyone who depended on `RegisterMethod' to
21024         do the `test for existance' test.  This has to be done elsewhere.
21025
21026         * support.cs (PtrHashtable): A hashtable that avoid comparing with
21027         the object stupid Equals method (because, that like fails all over
21028         the place).  We still do not use it.
21029
21030         * class.cs (TypeContainer.SetRequiredInterface,
21031         TypeContainer.RequireMethods): Killed these two routines and moved
21032         all the functionality to RegisterRequiredImplementations.
21033
21034         (TypeContainer.RegisterRequiredImplementations): This routine now
21035         registers all the implementations required in an array for the
21036         interfaces and abstract methods.  We use an array of structures
21037         which can be computed ahead of time to reduce memory usage and we
21038         also assume that lookups are cheap as most classes will not
21039         implement too many interfaces.
21040
21041         We also avoid creating too many MethodSignatures.
21042
21043         (TypeContainer.IsInterfaceMethod): Update and optionally does not
21044         clear the "pending" bit if we find that there are problems with
21045         the declaration.
21046
21047         (TypeContainer.VerifyPendingMethods): Update to report errors of
21048         methods that look like implementations but are not.
21049
21050         (TypeContainer.Define): Add support for explicit interface method
21051         implementation. 
21052
21053 2001-12-12  Miguel de Icaza  <miguel@ximian.com>
21054
21055         * typemanager.cs: Keep track of the parameters here instead of
21056         being a feature of the TypeContainer.
21057
21058         * class.cs: Drop the registration of parameters here, as
21059         InterfaceMethods are also interface declarations.
21060
21061         * delegate.cs: Register methods with the TypeManager not only with
21062         the TypeContainer.  This code was buggy.
21063
21064         * interface.cs: Full registation here.
21065
21066 2001-12-11  Miguel de Icaza  <miguel@ximian.com>
21067
21068         * expression.cs: Remove reducer for binary expressions, it can not
21069         be done this way.
21070
21071         * const.cs: Put here the code that used to go into constant.cs
21072
21073         * constant.cs: Put here the code for constants, this is a new base
21074         class for Literals.
21075
21076         * literal.cs: Make Literal derive from Constant.
21077
21078 2001-12-09  Miguel de Icaza  <miguel@ximian.com>
21079
21080         * statement.cs (Return.Emit): Report error 157 if the user
21081         attempts to return from a finally block.
21082
21083         (Return.Emit): Instead of emitting a return, jump to the end of
21084         the function.
21085
21086         * codegen.cs (EmitContext): ReturnValue, ReturnLabel: new
21087         LocalBuilder to store the result of the function.  ReturnLabel is
21088         the target where we jump.
21089
21090
21091 2001-12-09  Radek Doulik  <rodo@ximian.com>
21092
21093         * cs-parser.jay: remember alias in current namespace
21094
21095         * ecore.cs (SimpleName::DoResolve): use aliases for types or
21096         namespaces
21097
21098         * class.cs (LookupAlias): lookup alias in my_namespace
21099
21100         * namespace.cs (UsingAlias): add alias, namespace_or_type pair to
21101         aliases hashtable
21102         (LookupAlias): lookup alias in this and if needed in parent
21103         namespaces
21104
21105 2001-12-08  Miguel de Icaza  <miguel@ximian.com>
21106
21107         * support.cs: 
21108
21109         * rootcontext.cs: (ModuleBuilder) Made static, first step into
21110         making things static.  I need this to avoid passing the
21111         TypeContainer when calling ParameterType.
21112
21113         * support.cs (InternalParameters.ParameterType): Remove ugly hack
21114         that did string manipulation to compute the type and then call
21115         GetType.  Use Parameter.ParameterType instead.
21116
21117         * cs-tokenizer.cs: Consume the suffix for floating values.
21118
21119         * expression.cs (ParameterReference): figure out whether this is a
21120         reference parameter or not.  Kill an extra variable by computing
21121         the arg_idx during emission.
21122
21123         * parameter.cs (Parameters.GetParameterInfo): New overloaded
21124         function that returns whether a parameter is an out/ref value or not.
21125
21126         (Parameter.ParameterType): The type of the parameter (base,
21127         without ref/out applied).
21128
21129         (Parameter.Resolve): Perform resolution here.
21130         (Parameter.ExternalType): The full type (with ref/out applied).
21131
21132         * statement.cs (Using.Emit, Using.EmitExpression): Implement
21133         support for expressions on the using statement.
21134
21135 2001-12-07  Miguel de Icaza  <miguel@ximian.com>
21136
21137         * statement.cs (Using.EmitLocalVariableDecls): Split the
21138         localvariable handling of the using statement.
21139
21140         (Block.EmitMeta): Keep track of variable count across blocks.  We
21141         were reusing slots on separate branches of blocks.
21142
21143         (Try.Emit): Emit the general code block, we were not emitting it. 
21144
21145         Check the type of the declaration to be an IDisposable or
21146         something that can be implicity converted to it. 
21147
21148         Emit conversions if required.
21149
21150         * ecore.cs (EmptyExpression): New utility class.
21151         (Expression.ImplicitConversionExists): New utility function.
21152
21153 2001-12-06  Miguel de Icaza  <miguel@ximian.com>
21154
21155         * statement.cs (Using): Implement.
21156
21157         * expression.cs (LocalVariableReference): Support read only variables.
21158
21159         * statement.cs: Remove the explicit emit for the Leave opcode.
21160         (VariableInfo): Add a readonly field.
21161
21162 2001-12-05  Miguel de Icaza  <miguel@ximian.com>
21163
21164         * ecore.cs (ConvCast): new class used to encapsulate the various
21165         explicit integer conversions that works in both checked and
21166         unchecked contexts.
21167
21168         (Expression.ConvertNumericExplicit): Use new ConvCast class to
21169         properly generate the overflow opcodes.
21170
21171 2001-12-04  Miguel de Icaza  <miguel@ximian.com>
21172
21173         * statement.cs: The correct type for the EmptyExpression is the
21174         element_type, not the variable type.  Ravi pointed this out.
21175
21176 2001-12-04  Ravi Pratap  <ravi@ximian.com>
21177
21178         * class.cs (Method::Define): Handle PInvoke methods specially
21179         by using DefinePInvokeMethod instead of the usual one.
21180
21181         * attribute.cs (DefinePInvokeMethod): Implement as this is what is called
21182         above to do the task of extracting information and defining the method.
21183
21184 2001-12-04  Ravi Pratap  <ravi@ximian.com>
21185
21186         * expression.cs (ArrayCreation::EmitStaticInitializers): Get rid
21187         of the condition for string type.
21188
21189         (Emit): Move that here. 
21190
21191         (ArrayCreation::CheckIndices): Keep string literals in their expression
21192         form.
21193
21194         (EmitDynamicInitializers): Handle strings appropriately.
21195
21196 2001-12-04  Miguel de Icaza  <miguel@ximian.com>
21197
21198         * codegen.cs (EmitContext): Replace multiple variables with a
21199         single pointer to the current Switch statement.
21200
21201         * statement.cs (GotoDefault, Switch): Adjust to cleaned up
21202         EmitContext.
21203
21204 2001-12-03  Miguel de Icaza  <miguel@ximian.com>
21205
21206         * statement.cs 
21207
21208         * statement.cs (GotoDefault), cs-parser.jay: Implement `goto
21209         default'.
21210
21211         (Foreach.Emit): Foreach on arrays was not setting
21212         up the loop variables (for break/continue).
21213
21214         (GotoCase): Semi-implented.
21215
21216 2001-12-03  Ravi Pratap  <ravi@ximian.com>
21217
21218         * attribute.cs (CheckAttribute): Handle system attributes by using
21219         Attribute.GetAttributes to examine information we need.
21220
21221         (GetValidPlaces): Same here.
21222
21223         * class.cs (Method::Define): Catch invalid use of extern and abstract together.
21224
21225         * typemanager.cs (dllimport_type): Core type for System.DllImportAttribute.
21226
21227         * class.cs (Method.IsPinvoke): Used to determine if we are a PInvoke method.
21228
21229         (Method::Define): Set appropriate flags if we have a DllImport attribute.
21230
21231         (Method::Emit): Handle the case when we are a PInvoke method.
21232
21233 2001-12-03  Miguel de Icaza  <miguel@ximian.com>
21234
21235         * expression.cs: Use ResolveWithSimpleName on compound names.
21236
21237 2001-12-02  Ravi Pratap  <ravi@ximian.com>
21238
21239         * constant.cs (EmitConstant): Make sure we resolve the associated expression
21240         before trying to reduce it.
21241
21242         * typemanager.cs (RegisterConstant, LookupConstant): Implement.
21243
21244         * constant.cs (LookupConstantValue): Implement.
21245
21246         (EmitConstant): Use the above in emitting the constant.
21247
21248         * expression.cs (MemberAccess::ResolveMemberAccess): Handle constants
21249         that are user-defined by doing a LookupConstantValue on them.
21250
21251         (SimpleName::DoResolve): When we have a FieldExpr, cope with constants
21252         too, like above.
21253
21254 2001-11-29  Miguel de Icaza  <miguel@ximian.com>
21255
21256         * expression.cs (BaseAccess, BaseIndexer): Also split this out.
21257
21258         (BaseAccess.DoResolve): Implement.
21259
21260         (MemberAccess.DoResolve): Split this routine into a
21261         ResolveMemberAccess routine that can be used independently
21262
21263 2001-11-28  Miguel de Icaza  <miguel@ximian.com>
21264
21265         * expression.cs (Probe, Is, As): Split Probe in two classes Is and
21266         As that share bits of the implementation.  Is returns a boolean,
21267         while As returns the Type that is being probed.
21268
21269 2001-12-01  Ravi Pratap  <ravi@ximian.com>
21270
21271         * enum.cs (LookupEnumValue): Re-write various bits, return an object value
21272         instead of a Literal - much easier.
21273
21274         (EnumInTransit): Remove - utterly useless :-)
21275
21276         (Populate): Re-write bits - remove duplicate code etc. The code is much neater now.
21277
21278         * expression.cs (MemberLookup): Cope with user-defined enums when they are in transit.
21279
21280         * enum.cs (LookupEnumValue): Auto-compute next values by going down the dependency
21281         chain when we have no associated expression.
21282
21283 2001-11-30  Ravi Pratap  <ravi@ximian.com>
21284
21285         * constant.cs (Define): Use Location while reporting the errror.
21286
21287         Also emit a warning when 'new' is used and there is no inherited
21288         member to hide.
21289
21290         * enum.cs (EnumInTransit): Used to tell if an enum type is in the process of being 
21291         populated.
21292
21293         (LookupEnumValue): Implement to lookup an enum member's value and define it
21294         if necessary.
21295
21296         (Populate): Re-write accordingly to use the above routine.
21297
21298 2001-11-27  Miguel de Icaza  <miguel@ximian.com>
21299
21300         * expression.cs (This): Fix prototype for DoResolveLValue to
21301         override the base class DoResolveLValue.
21302
21303         * cs-parser.cs: Report errors cs574 and cs575 (destructor
21304         declarations) 
21305
21306         * ecore.cs (FieldExpr.EmitAssign): Handle value types specially
21307         (we need to load the address of the field here).  This fixes
21308         test-22. 
21309
21310         (FieldExpr.DoResolveLValue): Call the DoResolve
21311         function to initialize the Instance expression.
21312
21313         * statement.cs (Foreach.Emit): Fix the bug where we did not invoke
21314         correctly the GetEnumerator operation on a value type.
21315
21316         * cs-parser.jay: Add more simple parsing error catches.
21317
21318         * statement.cs (Switch): Add support for string switches.
21319         Handle null specially.
21320
21321         * literal.cs (NullLiteral): Make NullLiteral objects singletons. 
21322
21323 2001-11-28  Ravi Pratap  <ravi@ximian.com>
21324
21325         * cs-parser.jay (local_constant_declaration): Use declare_local_constant.
21326
21327         (declare_local_constant): New helper function.
21328
21329         * statement.cs (AddConstant): Keep a separate record of constants
21330
21331         (IsConstant): Implement to determine if a variable is a constant.
21332
21333         (GetConstantExpression): Implement.
21334
21335         * expression.cs (LocalVariableReference): Handle the case when it is a constant.
21336
21337         * statement.cs (IsVariableDefined): Re-write.
21338
21339 2001-11-27  Ravi Pratap  <ravi@ximian.com>
21340
21341         * class.cs (TypeContainer::FindMembers): Look for constants
21342         in the case when we are looking for MemberTypes.Field
21343
21344         * expression.cs (MemberAccess::DoResolve): Check that in the
21345         case we are a FieldExpr and a Literal, we are not being accessed
21346         by an instance reference.
21347
21348         * cs-parser.jay (local_constant_declaration): Implement.
21349
21350         (declaration_statement): Implement for constant declarations.
21351
21352 2001-11-26  Miguel de Icaza  <miguel@ximian.com>
21353
21354         * statement.cs (Switch): Catch double defaults.
21355
21356         (Switch): More work on the switch() statement
21357         implementation.  It works for integral values now, need to finish
21358         string support.
21359
21360
21361 2001-11-24  Miguel de Icaza  <miguel@ximian.com>
21362
21363         * ecore.cs (Expression.ConvertIntLiteral): New function to convert
21364         integer literals into other integer literals.  To be used by
21365         switch. 
21366
21367 2001-11-24  Ravi Pratap  <ravi@ximian.com>
21368
21369         * expression.cs (ArrayCreation): Get rid of ArrayExprs : we save
21370         some memory.
21371
21372         (EmitDynamicInitializers): Cope with the above since we extract data
21373         directly from ArrayData now.
21374
21375         (ExpectInitializers): Keep track of whether initializers are mandatory
21376         or not.
21377
21378         (Bounds): Make it a hashtable to prevent the same dimension being 
21379         recorded for every element in that dimension.
21380
21381         (EmitDynamicInitializers): Fix bug which prevented the Set array method
21382         from being found.
21383
21384         Also fix bug which was causing the indices to be emitted in the reverse
21385         order.
21386
21387 2001-11-24  Miguel de Icaza  <miguel@ximian.com>
21388
21389         * expression.cs (ArrayCreation): Implement the bits that Ravi left
21390         unfinished.  They do not work, because the underlying code is
21391         sloppy.
21392
21393 2001-11-22  Miguel de Icaza  <miguel@ximian.com>
21394
21395         * cs-parser.jay: Remove bogus fixme.
21396
21397         * statement.cs (Switch, SwitchSection, SwithLabel): Started work
21398         on Switch statement.
21399
21400 2001-11-23  Ravi Pratap  <ravi@ximian.com>
21401
21402         * typemanager.cs (IsDelegateType, IsEnumType): Fix logic to determine
21403         the same. 
21404
21405         * expression.cs (ArrayCreation::CheckIndices): Get rid of the require_constant
21406         parameter. Apparently, any expression is allowed. 
21407
21408         (ValidateInitializers): Update accordingly.
21409
21410         (CheckIndices): Fix some tricky bugs thanks to recursion.
21411
21412         * delegate.cs (NewDelegate::DoResolve): Re-write large portions as 
21413         I was being completely brain-dead.
21414
21415         (VerifyMethod, VerifyApplicability, VerifyDelegate): Make static
21416         and re-write acordingly.
21417
21418         (DelegateInvocation): Re-write accordingly.
21419
21420         * expression.cs (ArrayCreation::Emit): Handle string initialization separately.
21421
21422         (MakeByteBlob): Handle types more correctly.
21423
21424         * expression.cs (ArrayCreation:Emit): Write preliminary code to do
21425         initialization from expressions but it is incomplete because I am a complete
21426         Dodo :-|
21427
21428 2001-11-22  Miguel de Icaza  <miguel@ximian.com>
21429
21430         * statement.cs (If.Emit): Fix a bug that generated incorrect code
21431         on If.  Basically, we have to return `true' (ie, we do return to
21432         our caller) only if both branches of the if return.
21433
21434         * expression.cs (Binary.Emit): LogicalOr and LogicalAnd are
21435         short-circuit operators, handle them as short circuit operators. 
21436
21437         (Cast.DoResolve): Resolve type.
21438         (Cast.Cast): Take an expression as the target type.
21439
21440         * cs-parser.jay (cast_expression): Remove old hack that only
21441         allowed a limited set of types to be handled.  Now we take a
21442         unary_expression and we resolve to a type during semantic
21443         analysis.
21444
21445         Use the grammar productions from Rhys to handle casts (this is
21446         not complete like Rhys syntax yet, we fail to handle that corner
21447         case that C# has regarding (-x), but we will get there.
21448
21449 2001-11-22  Ravi Pratap  <ravi@ximian.com>
21450
21451         * class.cs (EmitFieldInitializer): Take care of the case when we have a
21452         field which is an array type.
21453
21454         * cs-parser.jay (declare_local_variables): Support array initialization too.
21455
21456         * typemanager.cs (MakeKey): Implement.
21457
21458         (everywhere): Use the above appropriately.
21459
21460         * cs-parser.jay (for_statement): Update for array initialization while
21461         declaring variables.
21462
21463         * ecore.cs : The error message was correct, it's the variable's names that
21464         were misleading ;-) Make the code more readable.
21465
21466         (MemberAccess::DoResolve): Fix the code which handles Enum literals to set
21467         the correct type etc.
21468
21469         (ConvertExplicit): Handle Enum types by examining the underlying type.
21470
21471 2001-11-21  Ravi Pratap  <ravi@ximian.com>
21472
21473         * parameter.cs (GetCallingConvention): Always return
21474         CallingConventions.Standard for now.
21475
21476 2001-11-22  Miguel de Icaza  <miguel@ximian.com>
21477
21478         * expression.cs (Binary.ResolveOperator): Update the values of `l'
21479         and `r' after calling DoNumericPromotions.
21480
21481         * ecore.cs: Fix error message (the types were in the wrong order).
21482
21483         * statement.cs (Foreach.ProbeCollectionType): Need to pass
21484         BindingFlags.Instance as well 
21485
21486         * ecore.cs (Expression.TryImplicitIntConversion): Wrap the result
21487         implicit int literal conversion in an empty cast so that we
21488         propagate the right type upstream.
21489
21490         (UnboxCast): new class used to unbox value types.
21491         (Expression.ConvertExplicit): Add explicit type conversions done
21492         by unboxing.
21493
21494         (Expression.ImplicitNumericConversion): Oops, forgot to test for
21495         the target type before applying the implicit LongLiterals to ULong
21496         literal cast.
21497
21498 2001-11-21  Miguel de Icaza  <miguel@ximian.com>
21499
21500         * cs-parser.jay (for_statement): Reworked the way For works: now
21501         we declare manually any variables that are introduced in
21502         for_initializer to solve the problem of having out-of-band code
21503         emition (that is what got for broken).
21504
21505         (declaration_statement): Perform the actual variable declaration
21506         that used to be done in local_variable_declaration here.
21507
21508         (local_variable_declaration): Do not declare anything, just pass
21509         the information on a DictionaryEntry
21510
21511 2001-11-20  Ravi Pratap  <ravi@ximian.com>
21512
21513         * expression.cs (ArrayCreation::CheckIndices): The story continues :-) Complete
21514         re-write of the logic to now make it recursive.
21515
21516         (UpdateIndices): Re-write accordingly.
21517
21518         Store element data in a separate ArrayData list in the above methods.
21519
21520         (MakeByteBlob): Implement to dump the array data into a byte array.
21521
21522 2001-11-19  Ravi Pratap  <ravi@ximian.com>
21523
21524         * expression.cs (ArrayCreation): Factor out some code from ValidateInitializers
21525         into CheckIndices.
21526
21527         * constant.cs (Define): Implement.
21528
21529         (EmitConstant): Re-write fully.
21530
21531         Pass in location info.
21532
21533         * class.cs (Populate, Emit): Call Constant::Define and Constant::EmitConstant
21534         respectively.
21535
21536         * cs-parser.jay (constant_declarator): Use VariableDeclaration instead of
21537         DictionaryEntry since we need location info too.
21538
21539         (constant_declaration): Update accordingly.
21540
21541         * expression.cs (ArrayCreation): Make ValidateInitializers simpler by factoring
21542         code into another method : UpdateIndices.
21543
21544 2001-11-18  Ravi Pratap  <ravi@ximian.com>
21545
21546         * expression.cs (ArrayCreation::ValidateInitializers): Update to perform
21547         some type checking etc.
21548
21549 2001-11-17  Ravi Pratap  <ravi@ximian.com>
21550
21551         * expression.cs (ArrayCreation::ValidateInitializers): Implement
21552         bits to provide dimension info if the user skips doing that.
21553
21554         Update second constructor to store the rank correctly.
21555
21556 2001-11-16  Ravi Pratap  <ravi@ximian.com>
21557
21558         * expression.cs (ArrayCreation::ValidateInitializers): Poke around
21559         and try to implement.
21560
21561         * ../errors/cs0150.cs : Add.
21562
21563         * ../errors/cs0178.cs : Add.
21564
21565 2001-11-16  Miguel de Icaza  <miguel@ximian.com>
21566
21567         * statement.cs: Implement foreach on multi-dimensional arrays. 
21568
21569         * parameter.cs (Parameters.GetParameterByName): Also lookup the
21570         name of the params argument.
21571
21572         * expression.cs: Use EmitStoreOpcode to get the right opcode while
21573         initializing the array.
21574
21575         (ArrayAccess.EmitStoreOpcode): move the opcode generation here, so
21576         we can use this elsewhere.
21577
21578         * statement.cs: Finish implementation of foreach for single
21579         dimension arrays.
21580
21581         * cs-parser.jay: Use an out-of-band stack to pass information
21582         around, I wonder why I need this.
21583
21584         foreach_block: Make the new foreach_block the current_block.
21585
21586         * parameter.cs (Parameters.GetEmptyReadOnlyParameters): New
21587         function used to return a static Parameters structure.  Used for
21588         empty parameters, as those are created very frequently.
21589
21590         * cs-parser.jay, class.cs: Use GetEmptyReadOnlyParameters
21591
21592 2001-11-15  Ravi Pratap  <ravi@ximian.com>
21593
21594         * interface.cs : Default modifier is private, not public. The
21595         make verify test passes again.
21596
21597 2001-11-15  Ravi Pratap  <ravi@ximian.com>
21598
21599         * support.cs (ReflectionParameters): Fix logic to determine
21600         whether the last parameter is a params one. Test 9 passes again.
21601
21602         * delegate.cs (Populate): Register the builders we define with
21603         RegisterParameterForBuilder. Test 19 passes again.
21604
21605         * cs-parser.jay (property_declaration): Reference $6 instead
21606         of $$ to get at the location.
21607
21608         (indexer_declaration): Similar stuff.
21609
21610         (attribute): Ditto.
21611
21612         * class.cs (Property): Register parameters for the Get and Set methods
21613         if they exist. Test 23 passes again.
21614
21615         * expression.cs (ArrayCreation::Emit): Pass null for the method in the
21616         call to EmitArguments as we are sure there aren't any params arguments. 
21617         Test 32 passes again.
21618
21619         * suppor.cs (ParameterDesc, ParameterModifier): Fix trivial bug causing
21620         IndexOutOfRangeException. 
21621
21622         * class.cs (Property::Define): Register property using TypeManager.RegisterProperty
21623         Test 33 now passes again.
21624
21625 2001-11-15  Miguel de Icaza  <miguel@ximian.com>
21626
21627         * cs-parser.jay: Kill horrendous hack ($??? = lexer.Location) that
21628         broke a bunch of things.  Will have to come up with a better way
21629         of tracking locations.
21630
21631         * statement.cs: Implemented foreach for single dimension arrays.
21632
21633 2001-11-09  Miguel de Icaza  <miguel@ximian.com>
21634
21635         * enum.cs (Enum.Emit): Delay the lookup of loc until we run into
21636         an error.  This removes the lookup from the critical path.
21637
21638         * cs-parser.jay: Removed use of temporary_loc, which is completely
21639         broken. 
21640
21641 2001-11-14  Miguel de Icaza  <miguel@ximian.com>
21642
21643         * support.cs (ReflectionParameters.ParameterModifier): Report
21644         whether the argument is a PARAMS argument or not.
21645
21646         * class.cs: Set the attribute `ParamArrayAttribute' on the
21647         parameter argument.
21648
21649         * typemanager.cs: Define param_array_type (ParamArrayAttribute)
21650         and cons_param_array_attribute (ConstructorInfo for
21651         ParamArrayAttribute)., 
21652
21653         * codegen.cs: Emit the return using the `Return' statement, that
21654         way we can report the error correctly for missing return values. 
21655
21656         * class.cs (Method.Emit): Clean up.
21657
21658         * expression.cs (Argument.Resolve): Take another argument: the
21659         location where this argument is used.  Notice that this is not
21660         part of the "Argument" class as to reduce the size of the
21661         structure (we know the approximate location anyways).
21662
21663         Test if the argument is a variable-reference, if not, then
21664         complain with a 206.
21665
21666         (Argument.Emit): Emit addresses of variables.
21667
21668         (Argument.FullDesc): Simplify.
21669
21670         (Invocation.DoResolve): Update for Argument.Resolve.
21671
21672         (ElementAccess.DoResolve): ditto.
21673
21674         * delegate.cs (DelegateInvocation.Emit): Invocation of Invoke
21675         method should be virtual, as this method is always virtual.
21676
21677         (NewDelegate.DoResolve): Update for Argument.Resolve.
21678
21679         * class.cs (ConstructorInitializer.DoResolve): ditto.
21680
21681         * attribute.cs (Attribute.Resolve): ditto.
21682
21683 2001-11-13  Miguel de Icaza  <miguel@ximian.com>
21684
21685         * statement.cs (Foreach.Emit): Use EmitAssign instead of Store.
21686
21687         * expression.cs (ParameterReference): Drop IStackStorage and implement
21688         IAssignMethod instead. 
21689
21690         (LocalVariableReference): ditto.
21691
21692         * ecore.cs (FieldExpr): Drop IStackStorage and implement
21693         IAssignMethod instead. 
21694
21695 2001-11-13  Miguel de Icaza <miguel@ximian.com>
21696
21697         * parameter.cs, expression.cs, class.cs, ecore.cs: Made all
21698         enumerations that are used in heavily used structures derive from
21699         byte in a laughable and pathetic attempt to reduce memory usage.
21700         This is the kind of pre-optimzations that you should not do at
21701         home without adult supervision.
21702
21703         * expression.cs (UnaryMutator): New class, used to handle ++ and
21704         -- separatedly from the other unary operators.  Cleans up the
21705         code, and kills the ExpressionStatement dependency in Unary.
21706
21707         (Unary): Removed `method' and `Arguments' from this class, making
21708         it smaller, and moving it all to SimpleCall, so I can reuse this
21709         code in other locations and avoid creating a lot of transient data
21710         strucutres when not required.
21711
21712         * cs-parser.jay: Adjust for new changes.
21713
21714 2001-11-11  Miguel de Icaza  <miguel@ximian.com>
21715
21716         * enum.cs (Enum.Populate): If there is a failure during
21717         definition, return
21718
21719         * cs-parser.jay (opt_enum_base): we used to catch type errors
21720         here, but this is really incorrect.  The type error should be
21721         catched during semantic analysis.
21722
21723 2001-12-11  Ravi Pratap  <ravi@ximian.com>
21724
21725         * cs-parser.jay (operator_declarator, conversion_operator_declarator): Set
21726         current_local_parameters as expected since I, in my stupidity, had forgotten
21727         to do this :-)
21728
21729         * attribute.cs (GetValidPlaces): Fix stupid bug.
21730
21731         * class.cs (Method::Emit): Perform check on applicability of attributes.
21732
21733         (Constructor::Emit): Ditto.
21734
21735         (Field::Emit): Ditto.
21736
21737         (Field.Location): Store location information.
21738
21739         (Property, Event, Indexer, Operator): Ditto.
21740
21741         * cs-parser.jay (field_declaration): Pass in location for each field.
21742
21743         * ../errors/cs0592.cs : Add.
21744
21745 2001-11-12  Ravi Pratap  <ravi@ximian.com>
21746
21747         * typemanager.cs (attribute_usage_type): New static member for System.AttributeUsage.
21748
21749         (InitCoreTypes): Update accordingly.
21750
21751         (RegisterAttrType, LookupAttr): Implement.
21752
21753         * attribute.cs (Attribute.Targets, AllowMultiple, Inherited): New fields to hold
21754         info about the same.
21755
21756         (Resolve): Update to populate the above as necessary.
21757
21758         (Error592): Helper.
21759
21760         (GetValidPlaces): Helper to the above.
21761
21762         (CheckAttribute): Implement to perform validity of attributes on declarative elements.
21763
21764         * class.cs (TypeContainer::Emit): Update attribute emission code to perform checking etc.
21765
21766 2001-11-12  Ravi Pratap  <ravi@ximian.com>
21767
21768         * attribute.cs (Attribute::Resolve): Expand to handle named arguments too.
21769
21770         * ../errors/cs0617.cs : Add.
21771
21772 2001-11-11  Ravi Pratap  <ravi@ximian.com>
21773
21774         * enum.cs (Emit): Rename to Populate to be more consistent with what
21775         we expect it to do and when exactly it is called.
21776
21777         * class.cs, rootcontext.cs : Update accordingly.
21778
21779         * typemanager.cs (RegisterField, GetValue): Workarounds for the fact that
21780         FieldInfo.GetValue does not work on dynamic types ! S.R.E lameness strikes again !
21781
21782         * enum.cs (Populate): Register fields with TypeManager.RegisterField.
21783
21784         * expression.cs (MemberAccess.DoResolve): Adjust code to obtain the value
21785         of a fieldinfo using the above, when dealing with a FieldBuilder.
21786
21787 2001-11-10  Ravi Pratap  <ravi@ximian.com>
21788
21789         * ../errors/cs0031.cs : Add.
21790
21791         * ../errors/cs1008.cs : Add.
21792
21793         * ../errrors/cs0543.cs : Add.
21794
21795         * enum.cs (DefineEnum): Check the underlying type and report an error if not a valid
21796         enum type.
21797
21798         (FindMembers): Implement.
21799
21800         * typemanager.cs (FindMembers): Re-write to call the appropriate methods for
21801         enums and delegates too.
21802
21803         (enum_types): Rename to builder_to_enum.
21804
21805         (delegate_types): Rename to builder_to_delegate.
21806
21807         * delegate.cs (FindMembers): Implement.
21808
21809 2001-11-09  Ravi Pratap  <ravi@ximian.com>
21810
21811         * typemanager.cs (IsEnumType): Implement.
21812
21813         * enum.cs (Emit): Re-write parts to account for the underlying type
21814         better and perform checking etc.
21815
21816         (GetNextDefaultValue): Helper to ensure we don't overshoot max value
21817         of the underlying type.
21818
21819         * literal.cs (GetValue methods everywhere): Perform bounds checking and return
21820         value
21821
21822         * enum.cs (error31): Helper to report error #31.
21823
21824         * cs-parser.jay (enum_declaration): Store location of each member too.
21825
21826         * enum.cs (member_to_location): New hashtable. 
21827
21828         (AddEnumMember): Update location hashtable.
21829
21830         (Emit): Use the location of each member while reporting errors.
21831
21832 2001-11-09  Miguel de Icaza  <miguel@ximian.com>
21833
21834         * cs-parser.jay: A for_initializer if is a
21835         local_variable_declaration really ammount to have an implicit
21836         block with the variable declaration and no initializer for for.
21837
21838         * statement.cs (For.Emit): Cope with null initializers.
21839
21840         This fixes the infinite loop on for initializers.
21841
21842 2001-11-08  Miguel de Icaza  <miguel@ximian.com>
21843
21844         * enum.cs: More cleanup.
21845
21846         * ecore.cs: Remove dead code.
21847
21848         * class.cs (Property.Emit): More simplification.
21849         (Event.Emit): ditto.
21850
21851         Reworked to have less levels of indentation.
21852
21853 2001-11-08  Ravi Pratap  <ravi@ximian.com>
21854
21855         * class.cs (Property): Emit attributes.
21856
21857         (Field): Ditto.
21858
21859         (Event): Ditto.
21860
21861         (Indexer): Ditto.
21862
21863         (Operator): Ditto.
21864
21865         * enum.cs (Emit): Ditto.
21866
21867         * rootcontext.cs (ResolveTree, EmitCode, CloseTypes): Do the same for
21868         Enums too.
21869
21870         * class.cs (Field, Event, etc.): Move attribute generation into the
21871         Emit method everywhere.
21872
21873         * enum.cs (Enum): Revamp to use the same definition semantics as delegates so
21874         we have a DefineEnum, CloseEnum etc. The previous way of doing things was not right
21875         as we had no way of defining nested enums !
21876
21877         * rootcontext.cs : Adjust code accordingly.
21878
21879         * typemanager.cs (AddEnumType): To keep track of enum types separately.
21880
21881 2001-11-07  Ravi Pratap  <ravi@ximian.com>
21882
21883         * expression.cs (EvalConstantExpression): Move into ecore.cs
21884
21885         * enum.cs (Enum): Rename some members and make them public and readonly
21886         according to our convention.
21887
21888         * modifiers.cs (EnumAttr): Implement as we need to set only visibility flags,
21889         nothing else.
21890
21891         * enum.cs (Enum::Define): Use the above instead of TypeAttr.
21892
21893         (Enum::Emit): Write a simple version for now which doesn't try to compute
21894         expressions. I shall modify this to be more robust in just a while.
21895
21896         * class.cs (TypeContainer::Emit): Make sure we include Enums too.
21897
21898         (TypeContainer::CloseType): Create the Enum types too.
21899
21900         * attribute.cs (Resolve): Use the new Reduce method instead of EvalConstantExpression.
21901
21902         * expression.cs (EvalConstantExpression): Get rid of completely.
21903
21904         * enum.cs (Enum::Emit): Use the new expression reducer. Implement assigning
21905         user-defined values and other cases.
21906
21907         (IsValidEnumLiteral): Helper function.
21908
21909         * expression.cs (ExprClassfromMemberInfo): Modify to not do any literalizing 
21910         out there in the case we had a literal FieldExpr.
21911
21912         (MemberAccess:DoResolve): Do the literalizing of the FieldExpr here.
21913
21914         (Literalize): Revamp a bit to take two arguments.
21915
21916         (EnumLiteral): New class which derives from Literal to wrap enum literals.
21917
21918 2001-11-06  Ravi Pratap  <ravi@ximian.com>
21919
21920         * cs-parser.jay (compilation_unit): Remove extra opt_attributes for now.
21921
21922         * expression.cs (ArrayCreation::ValidateInitializers): Implement.
21923
21924         (Resolve): Use the above to ensure we have proper initializers.
21925
21926 2001-11-05  Ravi Pratap  <ravi@ximian.com>
21927
21928         * expression.cs (Expression::EvalConstantExpression): New method to 
21929         evaluate constant expressions.
21930
21931         * attribute.cs (Attribute::Resolve): Modify bits to use the above function.
21932
21933 2001-11-07  Miguel de Icaza  <miguel@ximian.com>
21934
21935         * expression.cs (ArrayCreation.Emit): Some bits to initialize data
21936         in an array.
21937
21938         (Binary.ResolveOperator): Handle operator != (object a, object b)
21939         and operator == (object a, object b);
21940
21941         (Binary.DoNumericPromotions): Indicate whether the numeric
21942         promotion was possible.
21943
21944         (ArrayAccess.DoResolve, ArrayAccess.Emit, ArrayAccess.EmitAssign):
21945         Implement.  
21946
21947         Made the ArrayAccess implement interface IAssignMethod instead of
21948         IStackStore as the order in which arguments are passed reflects
21949         this.
21950
21951         * assign.cs: Instead of using expr.ExprClass to select the way of
21952         assinging, probe for the IStackStore/IAssignMethod interfaces.
21953
21954         * typemanager.cs: Load InitializeArray definition.
21955
21956         * rootcontext.cs (RootContext.MakeStaticData): Used to define
21957         static data that can be used to initialize arrays. 
21958
21959 2001-11-05  Miguel de Icaza  <miguel@ximian.com>
21960
21961         * expression.cs: Handle operator== and operator!= for booleans.
21962
21963         (Conditioal.Reduce): Implement reducer for the ?: operator.
21964
21965         (Conditional.Resolve): Implement dead code elimination.
21966
21967         (Binary.Resolve): Catch string literals and return a new
21968         concatenated string.
21969
21970         (Unary.Reduce): Implement reduction of unary expressions.
21971
21972         * ecore.cs: Split out the expression core handling here.
21973
21974         (Expression.Reduce): New method used to perform constant folding
21975         and CSE.  This is needed to support constant-expressions. 
21976
21977         * statement.cs (Statement.EmitBoolExpression): Pass true and false
21978         targets, and optimize for !x.
21979
21980 2001-11-04  Ravi Pratap  <ravi@ximian.com>
21981
21982         * attribute.cs (Attribute::Resolve): Implement guts. Note that resolution
21983         of an attribute gives us a CustomAttributeBuilder which we use accordingly to
21984         set custom atttributes.
21985
21986         * literal.cs (Literal::GetValue): New abstract method to return the actual
21987         value of the literal, cast as an object.
21988
21989         (*Literal): Implement GetValue method.
21990
21991         * cs-parser.jay (positional_argument_list, named_argument_list): Add not just plain
21992         expressions to the arraylist but objects of type Argument.
21993
21994         * class.cs (TypeContainer::Emit): Emit our attributes too.
21995
21996         (Method::Emit, Constructor::Emit): Ditto.
21997
21998         * cs-parser.jay (constructor_declaration): Set attributes too, which we seemed
21999         to be ignoring earlier.
22000
22001 2001-11-03  Ravi Pratap  <ravi@ximian.com>
22002
22003         * attribute.cs (AttributeSection::Define): Implement to do the business
22004         of constructing a CustomAttributeBuilder.
22005
22006         (Attribute): New trivial class. Increases readability of code.  
22007
22008         * cs-parser.jay : Update accordingly.
22009
22010         (positional_argument_list, named_argument_list, named_argument): New rules
22011
22012         (attribute_arguments): Use the above so that we are more correct.
22013
22014 2001-11-02  Ravi Pratap  <ravi@ximian.com>
22015
22016         * expression.cs (Invocation::IsParamsMethodApplicable): Implement
22017         to perform all checks for a method with a params parameter.
22018
22019         (Invocation::OverloadResolve): Update to use the above method and therefore
22020         cope correctly with params method invocations.
22021
22022         * support.cs (InternalParameters::ParameterDesc): Provide a desc for 
22023         params too.
22024
22025         * class.cs (ConstructorInitializer::Resolve): Make sure we look for Non-public
22026         constructors in our parent too because we can't afford to miss out on 
22027         protected ones ;-)
22028
22029         * attribute.cs (AttributeSection): New name for the class Attribute
22030
22031         Other trivial changes to improve readability.
22032
22033         * cs-parser.jay (opt_attributes, attribute_section etc.): Modify to
22034         use the new class names.
22035
22036 2001-11-01  Ravi Pratap  <ravi@ximian.com>
22037
22038         * class.cs (Method::Define): Complete definition for params types too
22039
22040         (Indexer::Define): Ditto.
22041
22042         * support.cs (InternalParameters::ParameterType, ParameterDesc, ParameterModifier):
22043         Cope everywhere with a request for info about the array parameter.
22044
22045 2001-11-01  Ravi Pratap  <ravi@ximian.com>
22046
22047         * tree.cs (RecordNamespace): Fix up to check for the correct key.
22048
22049         * cs-parser.jay (GetQualifiedIdentifier): New Helper method used in 
22050         local_variable_type to extract the string corresponding to the type.
22051
22052         (local_variable_type): Fixup the action to use the new helper method.
22053
22054         * codegen.cs : Get rid of RefOrOutParameter, it's not the right way to 
22055         go.
22056
22057         * expression.cs : Clean out code which uses the above.
22058
22059 2001-10-31  Ravi Pratap  <ravi@ximian.com>
22060
22061         * typemanager.cs (RegisterMethod): Check if we already have an existing key
22062         and bale out if necessary by returning a false.
22063
22064         (RegisterProperty): Ditto.
22065
22066         * class.cs (everywhere): Check the return value from TypeManager.RegisterMethod
22067         and print out appropriate error messages.
22068
22069         * interface.cs (everywhere): Ditto.
22070
22071         * cs-parser.jay (property_declaration, event_declaration, indexer_declaration): Pass
22072         location to constructor.
22073
22074         * class.cs (Property, Event, Indexer): Update accordingly.
22075
22076         * ../errors/cs111.cs : Added.
22077
22078         * expression.cs (Invocation::IsApplicable): New static method to determine applicability
22079         of a method, as laid down by the spec.
22080
22081         (Invocation::OverloadResolve): Use the above method.
22082
22083 2001-10-31  Ravi Pratap  <ravi@ximian.com>
22084
22085         * support.cs (InternalParameters): Get rid of crap taking in duplicate info. We
22086         now take a TypeContainer and a Parameters object.
22087
22088         (ParameterData): Modify return type of ParameterModifier method to be 
22089         Parameter.Modifier and not a string.
22090
22091         (ReflectionParameters, InternalParameters): Update accordingly.
22092
22093         * expression.cs (Argument::GetParameterModifier): Same here.
22094
22095         * support.cs (InternalParameters::ParameterType): Find a better way of determining
22096         if we are a ref/out parameter. Actually, the type shouldn't be holding the '&'
22097         symbol in it at all so maybe this is only for now.
22098
22099 2001-10-30  Ravi Pratap  <ravi@ximian.com>
22100
22101         * support.cs (InternalParameters): Constructor now takes an extra argument 
22102         which is the actual Parameters class.
22103
22104         (ParameterDesc): Update to provide info on ref/out modifiers.
22105
22106         * class.cs (everywhere): Update call to InternalParameters to pass in
22107         the second argument too.
22108
22109         * support.cs (ParameterData): Add ParameterModifier, which is a method 
22110         to return the modifier info [ref/out etc]
22111
22112         (InternalParameters, ReflectionParameters): Implement the above.
22113
22114         * expression.cs (Argument::ParameterModifier): Similar function to return
22115         info about the argument's modifiers.
22116
22117         (Invocation::OverloadResolve): Update to take into account matching modifiers 
22118         too.
22119
22120         * class.cs (Indexer::Define): Actually define a Parameter object and put it onto
22121         a new SetFormalParameters object which we pass to InternalParameters.
22122
22123 2001-10-30  Ravi Pratap  <ravi@ximian.com>
22124
22125         * expression.cs (NewArray): Merge into the ArrayCreation class.
22126
22127 2001-10-29  Ravi Pratap  <ravi@ximian.com>
22128
22129         * expression.cs (NewArray): Merge classes NewBuiltinArray and 
22130         NewUserdefinedArray into one as there wasn't much of a use in having
22131         two separate ones.
22132
22133         * expression.cs (Argument): Change field's name to ArgType from Type.
22134
22135         (Type): New readonly property which returns the proper type, taking into 
22136         account ref/out modifiers.
22137
22138         (everywhere): Adjust code accordingly for the above.
22139
22140         * codegen.cs (EmitContext.RefOrOutParameter): New field to determine
22141         whether we are emitting for a ref or out parameter.
22142
22143         * expression.cs (Argument::Emit): Use the above field to set the state.
22144
22145         (LocalVariableReference::Emit): Update to honour the flag and emit the
22146         right stuff.
22147
22148         * parameter.cs (Attributes): Set the correct flags for ref parameters.
22149
22150         * expression.cs (Argument::FullDesc): New function to provide a full desc.
22151
22152         * support.cs (ParameterData): Add method ParameterDesc to the interface.
22153
22154         (ReflectionParameters, InternalParameters): Implement the above method.
22155
22156         * expression.cs (Invocation::OverloadResolve): Use the new desc methods in
22157         reporting errors.
22158
22159         (Invocation::FullMethodDesc): Ditto. 
22160
22161 2001-10-29  Miguel de Icaza  <miguel@ximian.com>
22162
22163         * cs-parser.jay: Add extra production for the second form of array
22164         creation. 
22165
22166         * expression.cs (ArrayCreation): Update to reflect the above
22167         change. 
22168
22169         * Small changes to prepare for Array initialization.
22170
22171 2001-10-28  Miguel de Icaza  <miguel@ximian.com>
22172
22173         * typemanager.cs (ImplementsInterface): interface might be null;
22174         Deal with this problem;
22175
22176         Also, we do store negative hits on the cache (null values), so use
22177         this instead of calling t.GetInterfaces on the type everytime.
22178
22179 2001-10-28  Ravi Pratap  <ravi@ximian.com>
22180
22181         * typemanager.cs (IsBuiltinType): New method to help determine the same.
22182
22183         * expression.cs (New::DoResolve): Get rid of array creation code and instead
22184         split functionality out into different classes.
22185
22186         (New::FormArrayType): Move into NewBuiltinArray.
22187
22188         (Invocation::EmitArguments): Get rid of the MethodBase argument. Appears
22189         quite useless.
22190
22191         (NewBuiltinArray): New class to handle creation of built-in arrays.
22192
22193         (NewBuiltinArray::DoResolve): Implement guts of array creation. Also take into
22194         account creation of one-dimensional arrays.
22195
22196         (::Emit): Implement to use Newarr and Newobj opcodes accordingly.
22197
22198         (NewUserdefinedArray::DoResolve): Implement.
22199
22200         * cs-parser.jay (local_variable_type): Fix up to add the rank to the variable too.
22201
22202         * typemanager.cs (AddModule): Used to add a ModuleBuilder to the list of modules
22203         we maintain inside the TypeManager. This is necessary to perform lookups on the
22204         module builder.
22205
22206         (LookupType): Update to perform GetType on the module builders too.     
22207
22208         * driver.cs (Driver): Add the ModuleBuilder to the list maintained by the TypeManager.
22209
22210         * exprssion.cs (NewUserdefinedArray::Emit): Implement.
22211
22212 2001-10-23  Ravi Pratap  <ravi@ximian.com>
22213
22214         * expression.cs (New::DoResolve): Implement guts of array creation.
22215
22216         (New::FormLookupType): Rename to FormArrayType and modify ever so slightly.
22217
22218 2001-10-27  Miguel de Icaza  <miguel@ximian.com>
22219
22220         * expression.cs: Fix bug I introduced lsat night that broke
22221         Delegates. 
22222
22223         (Expression.Resolve): Report a 246 error (can not resolve name)
22224         if we find a SimpleName in the stream.
22225
22226         (Expression.ResolveLValue): Ditto.
22227
22228         (Expression.ResolveWithSimpleName): This function is a variant of
22229         ResolveName, this one allows SimpleNames to be returned without a
22230         warning.  The only consumer of SimpleNames is MemberAccess
22231
22232 2001-10-26  Miguel de Icaza  <miguel@ximian.com>
22233
22234         * expression.cs (Invocation::DoResolve): Catch SimpleNames that
22235         might arrive here.  I have my doubts that this is correct.
22236
22237         * statement.cs (Lock): Implement lock statement.
22238
22239         * cs-parser.jay: Small fixes to support `lock' and `using'
22240
22241         * cs-tokenizer.cs: Remove extra space
22242
22243         * driver.cs: New flag --checked, allows to turn on integer math
22244         checking. 
22245
22246         * typemanger.cs: Load methodinfos for Threading.Monitor.Enter and
22247         Threading.Monitor.Exit 
22248
22249 2001-10-23  Miguel de Icaza  <miguel@ximian.com>
22250
22251         * expression.cs (IndexerAccess::DoResolveLValue): Set the
22252         Expression Class to be IndexerAccess.
22253
22254         Notice that Indexer::DoResolve sets the eclass to Value.
22255
22256 2001-10-22  Miguel de Icaza  <miguel@ximian.com>
22257
22258         * class.cs (TypeContainer::Emit): Emit code for indexers.
22259
22260         * assign.cs (IAssignMethod): New interface implemented by Indexers
22261         and Properties for handling assignment.
22262
22263         (Assign::Emit): Simplify and reuse code. 
22264
22265         * expression.cs (IndexerAccess, PropertyExpr): Implement
22266         IAssignMethod, clean up old code. 
22267
22268 2001-10-22  Ravi Pratap  <ravi@ximian.com>
22269
22270         * typemanager.cs (ImplementsInterface): New method to determine if a type
22271         implements a given interface. Provides a nice cache too.
22272
22273         * expression.cs (ImplicitReferenceConversion): Update checks to use the above
22274         method.
22275
22276         (ConvertReferenceExplicit): Ditto.
22277
22278         * delegate.cs (Delegate::Populate): Update to define the parameters on the 
22279         various methods, with correct names etc.
22280
22281         * class.cs (Operator::OpType): New members Operator.UnaryPlus and 
22282         Operator.UnaryNegation.
22283
22284         * cs-parser.jay (operator_declarator): Be a little clever in the case where
22285         we have a unary plus or minus operator.
22286
22287         * expression.cs (Unary): Rename memebers of Operator enum to UnaryPlus and 
22288         UnaryMinus.
22289
22290         * everywhere : update accordingly.
22291
22292         * everywhere : Change Negate and BitComplement to LogicalNot and OnesComplement
22293         respectively.
22294
22295         * class.cs (Method::Define): For the case where we are implementing a method
22296         inherited from an interface, we need to set the MethodAttributes.Final flag too. 
22297         Also set MethodAttributes.NewSlot and MethodAttributes.HideBySig.
22298
22299 2001-10-21  Ravi Pratap  <ravi@ximian.com>
22300
22301         * interface.cs (FindMembers): Implement to work around S.R.E
22302         lameness.
22303
22304         * typemanager.cs (IsInterfaceType): Implement.
22305
22306         (FindMembers): Update to handle interface types too.
22307
22308         * expression.cs (ImplicitReferenceConversion): Re-write bits which
22309         use IsAssignableFrom as that is not correct - it doesn't work.
22310
22311         * delegate.cs (DelegateInvocation): Derive from ExpressionStatement
22312         and accordingly override EmitStatement.
22313
22314         * expression.cs (ConvertReferenceExplicit): Re-write similary, this time
22315         using the correct logic :-)
22316
22317 2001-10-19  Ravi Pratap  <ravi@ximian.com>
22318
22319         * ../errors/cs-11.cs : Add to demonstrate error -11 
22320
22321 2001-10-17  Miguel de Icaza  <miguel@ximian.com>
22322
22323         * assign.cs (Assign::Resolve): Resolve right hand side first, and
22324         then pass this as a hint to ResolveLValue.
22325
22326         * expression.cs (FieldExpr): Add Location information
22327
22328         (FieldExpr::LValueResolve): Report assignment to readonly
22329         variable. 
22330
22331         (Expression::ExprClassFromMemberInfo): Pass location information.
22332
22333         (Expression::ResolveLValue): Add new method that resolves an
22334         LValue. 
22335
22336         (Expression::DoResolveLValue): Default invocation calls
22337         DoResolve. 
22338
22339         (Indexers): New class used to keep track of indexers in a given
22340         Type. 
22341
22342         (IStackStore): Renamed from LValue, as it did not really describe
22343         what this did.  Also ResolveLValue is gone from this interface and
22344         now is part of Expression.
22345
22346         (ElementAccess): Depending on the element access type
22347
22348         * typemanager.cs: Add `indexer_name_type' as a Core type
22349         (System.Runtime.CompilerServices.IndexerNameAttribute)
22350
22351         * statement.cs (Goto): Take a location.
22352
22353 2001-10-18  Ravi Pratap  <ravi@ximian.com>
22354
22355         * delegate.cs (Delegate::VerifyDelegate): New method to verify
22356         if two delegates are compatible.
22357
22358         (NewDelegate::DoResolve): Update to take care of the case when
22359         we instantiate a delegate from another delegate.
22360
22361         * typemanager.cs (FindMembers): Don't even try to look up members
22362         of Delegate types for now.
22363
22364 2001-10-18  Ravi Pratap  <ravi@ximian.com>
22365
22366         * delegate.cs (NewDelegate): New class to take care of delegate
22367         instantiation.
22368
22369         * expression.cs (New): Split the delegate related code out into 
22370         the NewDelegate class.
22371
22372         * delegate.cs (DelegateInvocation): New class to handle delegate 
22373         invocation.
22374
22375         * expression.cs (Invocation): Split out delegate related code into
22376         the DelegateInvocation class.
22377
22378 2001-10-17  Ravi Pratap  <ravi@ximian.com>
22379
22380         * expression.cs (New::DoResolve): Implement delegate creation fully
22381         and according to the spec.
22382
22383         (New::DoEmit): Update to handle delegates differently.
22384
22385         (Invocation::FullMethodDesc): Fix major stupid bug thanks to me
22386         because of which we were printing out arguments in reverse order !
22387
22388         * delegate.cs (VerifyMethod): Implement to check if the given method
22389         matches the delegate.
22390
22391         (FullDelegateDesc): Implement.
22392
22393         (VerifyApplicability): Implement.
22394
22395         * expression.cs (Invocation::DoResolve): Update to accordingly handle
22396         delegate invocations too.
22397
22398         (Invocation::Emit): Ditto.
22399
22400         * ../errors/cs1593.cs : Added.
22401
22402         * ../errors/cs1594.cs : Added.
22403
22404         * delegate.cs (InstanceExpression, TargetMethod): New properties.
22405
22406 2001-10-16  Ravi Pratap  <ravi@ximian.com>
22407
22408         * typemanager.cs (intptr_type): Core type for System.IntPtr
22409
22410         (InitCoreTypes): Update for the same.
22411
22412         (iasyncresult_type, asynccallback_type): Ditto.
22413
22414         * delegate.cs (Populate): Fix to use System.Intptr as it is indeed
22415         correct.
22416
22417         * typemanager.cs (AddDelegateType): Store a pointer to the Delegate class
22418         too.
22419
22420         * delegate.cs (ConstructorBuilder, InvokeBuilder, ...): New members to hold
22421         the builders for the 4 members of a delegate type :-)
22422
22423         (Populate): Define the BeginInvoke and EndInvoke methods on the delegate
22424         type.
22425
22426         * expression.cs (New::DoResolve): Implement guts for delegate creation.
22427
22428         * ../errors/errors.txt : Update for an error (-11) which only we catch :-)
22429
22430 2001-10-15  Miguel de Icaza  <miguel@ximian.com>
22431
22432         * statement.cs (Break::Emit): Implement.   
22433         (Continue::Emit): Implement.
22434
22435         (For::Emit): Track old being/end loops;  Set Begin loop, ack end loop
22436         (While::Emit): Track old being/end loops;  Set Begin loop, ack end loop
22437         (Do::Emit): Track old being/end loops;  Set Begin loop, ack end loop
22438         (Foreach::Emit): Track old being/end loops;  Set Begin loop, ack
22439         end loop
22440
22441         * codegen.cs (EmitContext::LoopEnd, EmitContext::LoopBegin): New
22442         properties that track the label for the current loop (begin of the
22443         loop and end of the loop).
22444
22445 2001-10-15  Ravi Pratap  <ravi@ximian.com>
22446
22447         * delegate.cs (Emit): Get rid of it as there doesn't seem to be any ostensible
22448         use of emitting anything at all.
22449
22450         * class.cs, rootcontext.cs : Get rid of calls to the same.
22451
22452         * delegate.cs (DefineDelegate): Make sure the class we define is also sealed.
22453
22454         (Populate): Define the constructor correctly and set the implementation
22455         attributes.
22456
22457         * typemanager.cs (delegate_types): New hashtable to hold delegates that
22458         have been defined.
22459
22460         (AddDelegateType): Implement.
22461
22462         (IsDelegateType): Implement helper method.
22463
22464         * delegate.cs (DefineDelegate): Use AddDelegateType instead of AddUserType.
22465
22466         * expression.cs (New::DoResolve): Check if we are trying to instantiate a delegate type
22467         and accordingly handle it.
22468
22469         * delegate.cs (Populate): Take TypeContainer argument.
22470         Implement bits to define the Invoke method. However, I still haven't figured out
22471         how to take care of the native int bit :-(
22472
22473         * cs-parser.jay (delegate_declaration): Fixed the bug that I had introduced :-) 
22474         Qualify the name of the delegate, not its return type !
22475
22476         * expression.cs (ImplicitReferenceConversion): Implement guts of implicit array
22477         conversion.
22478
22479         (StandardConversionExists): Checking for array types turns out to be recursive.
22480
22481         (ConvertReferenceExplicit): Implement array conversion.
22482
22483         (ExplicitReferenceConversionExists): New method to determine precisely that :-)
22484
22485 2001-10-12  Ravi Pratap  <ravi@ximian.com>
22486
22487         * cs-parser.jay (delegate_declaration): Store the fully qualified
22488         name as it is a type declaration.
22489
22490         * delegate.cs (ReturnType, Name): Rename members to these. Make them 
22491         readonly.
22492
22493         (DefineDelegate): Renamed from Define. Does the same thing essentially,
22494         as TypeContainer::DefineType.
22495
22496         (Populate): Method in which all the definition of the various methods (Invoke)
22497         etc is done.
22498
22499         (Emit): Emit any code, if necessary. I am not sure about this really, but let's
22500         see.
22501
22502         (CloseDelegate): Finally creates the delegate.
22503
22504         * class.cs (TypeContainer::DefineType): Update to define delegates.
22505         (Populate, Emit and CloseType): Do the same thing here too.
22506
22507         * rootcontext.cs (ResolveTree, PopulateTypes, EmitCode, CloseTypes): Include
22508         delegates in all these operations.
22509
22510 2001-10-14  Miguel de Icaza  <miguel@ximian.com>
22511
22512         * expression.cs: LocalTemporary: a new expression used to
22513         reference a temporary that has been created.
22514
22515         * assign.cs: Handle PropertyAccess back here, so that we can
22516         provide the proper semantic access to properties.
22517
22518         * expression.cs (Expression::ConvertReferenceExplicit): Implement
22519         a few more explicit conversions. 
22520
22521         * modifiers.cs: `NEW' modifier maps to HideBySig.
22522
22523         * expression.cs (PropertyExpr): Make this into an
22524         ExpressionStatement, and support the EmitStatement code path. 
22525
22526         Perform get/set error checking, clean up the interface.
22527
22528         * assign.cs: recognize PropertyExprs as targets, and if so, turn
22529         them into toplevel access objects.
22530
22531 2001-10-12  Miguel de Icaza  <miguel@ximian.com>
22532
22533         * expression.cs: PropertyExpr::PropertyExpr: use work around the
22534         SRE.
22535
22536         * typemanager.cs: Keep track here of our PropertyBuilders again to
22537         work around lameness in SRE.
22538
22539 2001-10-11  Miguel de Icaza  <miguel@ximian.com>
22540
22541         * expression.cs (LValue::LValueResolve): New method in the
22542         interface, used to perform a second resolution pass for LValues. 
22543
22544         (This::DoResolve): Catch the use of this in static methods.
22545
22546         (This::LValueResolve): Implement.
22547
22548         (This::Store): Remove warning, assigning to `this' in structures
22549         is 
22550
22551         (Invocation::Emit): Deal with invocation of
22552         methods on value types.  We need to pass the address to structure
22553         methods rather than the object itself.  (The equivalent code to
22554         emit "this" for structures leaves the entire structure on the
22555         stack instead of a pointer to it). 
22556
22557         (ParameterReference::DoResolve): Compute the real index for the
22558         argument based on whether the method takes or not a `this' pointer
22559         (ie, the method is static).
22560
22561         * codegen.cs (EmitContext::GetTemporaryStorage): Used to store
22562         value types returned from functions when we need to invoke a
22563         method on the sturcture.
22564
22565
22566 2001-10-11  Ravi Pratap  <ravi@ximian.com>
22567
22568         * class.cs (TypeContainer::DefineType): Method to actually do the business of
22569         defining the type in the Modulebuilder or Typebuilder. This is to take
22570         care of nested types which need to be defined on the TypeBuilder using
22571         DefineNestedMethod.
22572
22573         (TypeContainer::GetClassBases): Implement. Essentially the code from the 
22574         methods in RootContext, only ported to be part of TypeContainer.
22575
22576         (TypeContainer::GetInterfaceOrClass): Ditto.
22577
22578         (TypeContainer::LookupInterfaceOrClass, ::MakeFQN): Ditto.
22579
22580         * interface.cs (Interface::DefineInterface): New method. Does exactly
22581         what RootContext.CreateInterface did earlier, only it takes care of nested types 
22582         too.
22583
22584         (Interface::GetInterfaces): Move from RootContext here and port.
22585
22586         (Interface::GetInterfaceByName): Same here.
22587
22588         * rootcontext.cs (ResolveTree): Re-write.
22589
22590         (PopulateTypes): Re-write.
22591
22592         * class.cs (TypeContainer::Populate): Populate nested types too.
22593         (TypeContainer::Emit): Emit nested members too.
22594
22595         * typemanager.cs (AddUserType): Do not make use of the FullName property,
22596         instead just use the name argument passed in as it is already fully
22597         qualified.
22598
22599         (FindMembers): Check in the Builders to TypeContainer mapping instead of the name
22600         to TypeContainer mapping to see if a type is user-defined.
22601
22602         * class.cs (TypeContainer::CloseType): Implement. 
22603
22604         (TypeContainer::DefineDefaultConstructor): Use Basename, not Name while creating
22605         the default constructor.
22606
22607         (TypeContainer::Populate): Fix minor bug which led to creating default constructors
22608         twice.
22609
22610         (Constructor::IsDefault): Fix up logic to determine if it is the default constructor
22611
22612         * interface.cs (CloseType): Create the type here.
22613
22614         * rootcontext.cs (CloseTypes): Re-write to recursively close types by running through
22615         the hierarchy.
22616
22617         Remove all the methods which are now in TypeContainer.
22618
22619 2001-10-10  Ravi Pratap  <ravi@ximian.com>
22620
22621         * delegate.cs (Define): Re-write bits to define the delegate
22622         correctly.
22623
22624 2001-10-10  Miguel de Icaza  <miguel@ximian.com>
22625
22626         * makefile: Renamed the compiler to `mcs.exe' instead of compiler.exe
22627
22628         * expression.cs (ImplicitReferenceConversion): handle null as well
22629         as a source to convert to any reference type.
22630
22631         * statement.cs (Return): Perform any implicit conversions to
22632         expected return type.  
22633
22634         Validate use of return statement.  
22635
22636         * codegen.cs (EmitContext): Pass the expected return type here.
22637
22638         * class.cs (Method, Constructor, Property): Pass expected return
22639         type to EmitContext.
22640
22641 2001-10-09  Miguel de Icaza  <miguel@ximian.com>
22642
22643         * expression.cs: Make DoResolve take an EmitContext instead of a
22644         TypeContainer.
22645
22646         Replaced `l' and `location' for `loc', for consistency.
22647
22648         (Error, Warning): Remove unneeded Tc argument.
22649
22650         * assign.cs, literal.cs, constant.cs: Update to new calling
22651         convention. 
22652
22653         * codegen.cs: EmitContext now contains a flag indicating whether
22654         code is being generated in a static method or not.
22655
22656         * cs-parser.jay: DecomposeQI, new function that replaces the old
22657         QualifiedIdentifier.  Now we always decompose the assembled
22658         strings from qualified_identifier productions into a group of
22659         memberaccesses.
22660
22661 2001-10-08  Miguel de Icaza  <miguel@ximian.com>
22662
22663         * rootcontext.cs: Deal with field-less struct types correctly now
22664         by passing the size option to Define Type.
22665
22666         * class.cs: Removed hack that created one static field. 
22667
22668 2001-10-07  Miguel de Icaza  <miguel@ximian.com>
22669
22670         * statement.cs: Moved most of the code generation here. 
22671
22672 2001-10-09  Ravi Pratap  <ravi@ximian.com>
22673
22674         * expression.cs (New::DoResolve): Revert changes for array creation, doesn't
22675         seem very right.
22676
22677         (ElementAccess): Remove useless bits for now - keep checks as the spec
22678         says.
22679
22680 2001-10-08  Ravi Pratap  <ravi@ximian.com>
22681
22682         * expression.cs (ElementAccess::DoResolve): Remove my crap code
22683         and start performing checks according to the spec.
22684
22685 2001-10-07  Ravi Pratap  <ravi@ximian.com>
22686
22687         * cs-parser.jay (type_suffix*): Remove - they are redundant. Use
22688         rank_specifiers instead.
22689
22690         (rank_specifiers): Change the order in which the rank specifiers are stored
22691
22692         (local_variable_declaration): Use opt_rank_specifier instead of type_suffixes.
22693
22694         * expression.cs (ElementAccess): Implement the LValue interface too.
22695
22696 2001-10-06  Ravi Pratap  <ravi@ximian.com>
22697
22698         * expression.cs (ConvertExplicitStandard): Add. Same as ConvertExplicit
22699         except that user defined conversions are not included.
22700
22701         (UserDefinedConversion): Update to use the ConvertExplicitStandard to 
22702         perform the conversion of the return type, if necessary.
22703
22704         (New::DoResolve): Check whether we are creating an array or an object
22705         and accordingly do the needful.
22706
22707         (New::Emit): Same here.
22708
22709         (New::DoResolve): Implement guts of array creation.
22710
22711         (New::FormLookupType): Helper function.
22712
22713 2001-10-07  Miguel de Icaza  <miguel@ximian.com>
22714
22715         * codegen.cs: Removed most of the code generation here, and move the
22716         corresponding code generation bits to the statement classes. 
22717
22718         Added support for try/catch/finalize and throw.
22719
22720         * cs-parser.jay: Added support for try/catch/finalize.
22721
22722         * class.cs: Catch static methods having the flags override,
22723         virtual or abstract.
22724
22725         * expression.cs (UserCast): This user cast was not really doing
22726         what it was supposed to do.  Which is to be born in fully resolved
22727         state.  Parts of the resolution were being performed at Emit time! 
22728
22729         Fixed this code.
22730
22731 2001-10-05  Miguel de Icaza  <miguel@ximian.com>
22732
22733         * expression.cs: Implicity convert the result from UserCast.
22734
22735 2001-10-05  Ravi Pratap  <ravi@ximian.com>
22736
22737         * expression.cs (Expression::FindMostEncompassingType): Fix bug which
22738         prevented it from working correctly. 
22739
22740         (ConvertExplicit): Make the first try, a call to ConvertImplicitStandard, not
22741         merely ConvertImplicit.
22742
22743 2001-10-05  Miguel de Icaza  <miguel@ximian.com>
22744
22745         * typemanager.cs: Make the LookupTypeContainer function static,
22746         and not per-instance.  
22747
22748         * class.cs: Make static FindMembers (the one that takes a Type
22749         argument). 
22750
22751         * codegen.cs: Add EmitForeach here.
22752
22753         * cs-parser.jay: Make foreach a toplevel object instead of the
22754         inline expansion, as we need to perform semantic analysis on it. 
22755
22756 2001-10-05  Ravi Pratap  <ravi@ximian.com>
22757
22758         * expression.cs (Expression::ImplicitUserConversion): Rename to
22759         UserDefinedConversion.
22760
22761         (Expression::UserDefinedConversion): Take an extra argument specifying 
22762         whether we look for explicit user conversions too.
22763
22764         (Expression::ImplicitUserConversion): Make it a call to UserDefinedConversion.
22765
22766         (UserDefinedConversion): Incorporate support for user defined explicit conversions.
22767
22768         (ExplicitUserConversion): Make it a call to UserDefinedConversion
22769         with the appropriate arguments.
22770
22771         * cs-parser.jay (cast_expression): Record location too.
22772
22773         * expression.cs (Cast): Record location info.
22774
22775         (Expression::ConvertExplicit): Take location argument.
22776
22777         (UserImplicitCast): Change name to UserCast. Take an extra constructor argument
22778         to determine if we are doing explicit conversions.
22779
22780         (UserCast::Emit): Update accordingly.
22781
22782         (Expression::ConvertExplicit): Report an error if everything fails.
22783
22784         * ../errors/cs0030.cs : Add.
22785
22786 2001-10-04  Miguel de Icaza  <miguel@ximian.com>
22787
22788         * modifiers.cs: If the ABSTRACT keyword is present, also set the
22789         virtual and newslot bits. 
22790
22791         * class.cs (TypeContainer::RegisterRequiredImplementations):
22792         Record methods we need.
22793
22794         (TypeContainer::MakeKey): Helper function to make keys for
22795         MethodBases, since the Methodbase key is useless.
22796
22797         (TypeContainer::Populate): Call RegisterRequiredImplementations
22798         before defining the methods.   
22799
22800         Create a mapping for method_builders_to_methods ahead of time
22801         instead of inside a tight loop.
22802
22803         (::RequireMethods):  Accept an object as the data to set into the
22804         hashtable so we can report interface vs abstract method mismatch.
22805
22806 2001-10-03  Miguel de Icaza  <miguel@ximian.com>
22807
22808         * report.cs: Make all of it static.
22809
22810         * rootcontext.cs: Drop object_type and value_type computations, as
22811         we have those in the TypeManager anyways.
22812
22813         Drop report instance variable too, now it is a global.
22814
22815         * driver.cs: Use try/catch on command line handling.
22816
22817         Add --probe option to debug the error reporting system with a test
22818         suite. 
22819
22820         * report.cs: Add support for exiting program when a probe
22821         condition is reached.
22822
22823 2001-10-03  Ravi Pratap  <ravi@ximian.com>
22824
22825         * expression.cs (Binary::DoNumericPromotions): Fix the case when
22826         we do a forcible conversion regardless of type, to check if 
22827         ForceConversion returns a null.
22828
22829         (Binary::error19): Use location to report error.
22830
22831         (Unary::error23): Use location here too.
22832
22833         * ../errors/cs0019.cs : Check in.
22834
22835         * ../errors/cs0023.cs : Check in.
22836
22837         * expression.cs (Expression.MemberLookup): Return null for a rather esoteric
22838         case of a non-null MethodInfo object with a length of 0 !
22839
22840         (Binary::ResolveOperator): Flag error if overload resolution fails to find
22841         an applicable member - according to the spec :-)
22842         Also fix logic to find members in base types.
22843
22844         (Unary::ResolveOperator): Same here.
22845
22846         (Unary::report23): Change name to error23 and make first argument a TypeContainer
22847         as I was getting thoroughly confused between this and error19 :-)
22848
22849         * expression.cs (Expression::ImplicitUserConversion): Re-write fully
22850         (::FindMostEncompassedType): Implement.
22851         (::FindMostEncompassingType): Implement.
22852         (::StandardConversionExists): Implement.
22853
22854         (UserImplicitCast): Re-vamp. We now need info about most specific
22855         source and target types so that we can do the necessary conversions.
22856
22857         (Invocation::MakeUnionSet): Completely re-write to make sure we form a proper
22858         mathematical union with no duplicates.
22859
22860 2001-10-03  Miguel de Icaza  <miguel@ximian.com>
22861
22862         * rootcontext.cs (RootContext::PopulateTypes): Populate containers
22863         in order from base classes to child classes, so that we can in
22864         child classes look up in our parent for method names and
22865         attributes (required for handling abstract, virtual, new, override
22866         constructs: we need to instrospect our base class, and if we dont
22867         populate the classes in order, the introspection might be
22868         incorrect.  For example, a method could query its parent before
22869         the parent has any methods and would determine that the parent has
22870         no abstract methods (while it could have had them)).
22871
22872         (RootContext::CreateType): Record the order in which we define the
22873         classes.
22874
22875 2001-10-02  Miguel de Icaza  <miguel@ximian.com>
22876
22877         * class.cs (TypeContainer::Populate): Also method definitions can
22878         fail now, keep track of this.
22879
22880         (TypeContainer::FindMembers): Implement support for
22881         DeclaredOnly/noDeclaredOnly flag.
22882
22883         (Constructor::Emit) Return the ConstructorBuilder.
22884
22885         (Method::Emit) Return the MethodBuilder. 
22886         Check for abstract or virtual methods to be public.
22887
22888         * rootcontext.cs (RootContext::CreateType): Register all the
22889         abstract methods required for the class to be complete and the
22890         interface methods that must be implemented. 
22891
22892         * cs-parser.jay: Report error 501 (method requires body if it is
22893         not marked abstract or extern).
22894
22895         * expression.cs (TypeOf::Emit): Implement.
22896
22897         * typemanager.cs: runtime_handle_type, new global type.
22898
22899         * class.cs (Property::Emit): Generate code for properties.
22900
22901 2001-10-02  Ravi Pratap  <ravi@ximian.com>
22902
22903         * expression.cs (Unary::ResolveOperator): Find operators on base type
22904         too - we now conform exactly to the spec.
22905
22906         (Binary::ResolveOperator): Same here.
22907
22908         * class.cs (Operator::Define): Fix minor quirk in the tests.
22909
22910         * ../errors/cs0215.cs : Added.
22911
22912         * ../errors/cs0556.cs : Added.
22913
22914         * ../errors/cs0555.cs : Added.
22915
22916 2001-10-01  Miguel de Icaza  <miguel@ximian.com>
22917
22918         * cs-tokenizer.cs: Reimplemented Location to be a struct with a
22919         single integer which is really efficient
22920
22921 2001-10-01  Ravi Pratap  <ravi@ximian.com>
22922
22923         *  expression.cs (Expression::ImplicitUserConversion): Use location
22924         even in the case when we are examining True operators.
22925  
22926         * class.cs (Operator::Define): Perform extensive checks to conform
22927         with the rules for operator overloading in the spec.
22928
22929         * expression.cs (Expression::ImplicitReferenceConversion): Implement
22930         some of the other conversions mentioned in the spec.
22931
22932         * typemanager.cs (array_type): New static member for the System.Array built-in
22933         type.
22934
22935         (cloneable_interface): For System.ICloneable interface.
22936
22937         * driver.cs (Driver::Driver): Initialize TypeManager's core types even before
22938         we start resolving the tree and populating types.
22939
22940         * ../errors/errors.txt : Update for error numbers -7, -8, -9, -10
22941  
22942 2001-10-01  Miguel de Icaza  <miguel@ximian.com>
22943
22944         * expression.cs (Expression::ExprClassFromMemberInfo,
22945         Expression::Literalize): Create literal expressions from
22946         FieldInfos which are literals.
22947
22948         (ConvertNumericExplicit, ImplicitNumericConversion): Fix a few
22949         type casts, because they were wrong.  The test suite in tests
22950         caught these ones.
22951
22952         (ImplicitNumericConversion): ushort to ulong requires a widening
22953         cast. 
22954
22955         Int32 constant to long requires widening cast as well.
22956
22957         * literal.cs (LongLiteral::EmitLong): Do not generate i4 constants
22958         for integers because the type on the stack is not i4.
22959
22960 2001-09-30  Miguel de Icaza  <miguel@ximian.com>
22961
22962         * expression.cs (report118): require location argument. 
22963
22964         * parameter.cs: Do not dereference potential null value.
22965
22966         * class.cs: Catch methods that lack the `new' keyword when
22967         overriding a name.  Report warnings when `new' is used without
22968         anything being there to override.
22969
22970         * modifiers.cs: Handle `NEW' as MethodAttributes.NewSlot.
22971
22972         * class.cs: Only add constructor to hashtable if it is non-null
22973         (as now constructors can fail on define).
22974
22975         (TypeManager, Class, Struct): Take location arguments.
22976
22977         Catch field instance initialization in structs as errors.
22978
22979         accepting_filter: a new filter for FindMembers that is static so
22980         that we dont create an instance per invocation.
22981
22982         (Constructor::Define): Catch errors where a struct constructor is
22983         parameterless 
22984
22985         * cs-parser.jay: Pass location information for various new
22986         constructs. 
22987
22988         * delegate.cs (Delegate): take a location argument.
22989
22990         * driver.cs: Do not call EmitCode if there were problesm in the
22991         Definition of the types, as many Builders wont be there. 
22992
22993         * decl.cs (Decl::Decl): Require a location argument.
22994
22995         * cs-tokenizer.cs: Handle properly hex constants that can not fit
22996         into integers, and find the most appropiate integer for it.
22997
22998         * literal.cs: Implement ULongLiteral.
22999
23000         * rootcontext.cs: Provide better information about the location of
23001         failure when CreateType fails.
23002
23003 2001-09-29  Miguel de Icaza  <miguel@ximian.com>
23004
23005         * rootcontext.cs (RootContext::PopulateTypes): Populates structs
23006         as well.
23007
23008         * expression.cs (Binary::CheckShiftArguments): Add missing type
23009         computation.
23010         (Binary::ResolveOperator): Add type to the logical and and logical
23011         or, Bitwise And/Or and Exclusive Or code paths, it was missing
23012         before.
23013
23014         (Binary::DoNumericPromotions): In the case where either argument
23015         is ulong (and most signed types combined with ulong cause an
23016         error) perform implicit integer constant conversions as well.
23017
23018 2001-09-28  Miguel de Icaza  <miguel@ximian.com>
23019
23020         * expression.cs (UserImplicitCast): Method should always be
23021         non-null. 
23022         (Invocation::BetterConversion): Simplified test for IntLiteral.
23023
23024         (Expression::ImplicitNumericConversion): Split this routine out.
23025         Put the code that performs implicit constant integer conversions
23026         here. 
23027
23028         (Expression::Resolve): Become a wrapper around DoResolve so we can
23029         check eclass and type being set after resolve.
23030
23031         (Invocation::Badness): Remove this dead function
23032
23033         (Binary::ResolveOperator): Do not compute the expensive argumnets
23034         unless we have a union for it.
23035
23036         (Probe::Emit): Is needs to do an isinst and then
23037         compare against null.
23038
23039         (::CanConvert): Added Location argument.  If the Location argument
23040         is null (Location.Null), then we do not report errors.  This is
23041         used by the `probe' mechanism of the Explicit conversion.  We do
23042         not want to generate an error for something that the user
23043         explicitly requested to be casted.  But the pipeline for an
23044         explicit cast first tests for potential implicit casts.
23045
23046         So for now, if the Location is null, it means `Probe only' to
23047         avoid adding another argument.   Might have to revise this
23048         strategy later.
23049
23050         (ClassCast): New class used to type cast objects into arbitrary
23051         classes (used in Explicit Reference Conversions).
23052
23053         Implement `as' as well.
23054
23055         Reverted all the patches from Ravi below: they were broken:
23056
23057                 * The use of `level' as a mechanism to stop recursive
23058                   invocations is wrong.  That was there just to catch the
23059                   bug with a strack trace but not as a way of addressing
23060                   the problem.
23061
23062                   To fix the problem we have to *understand* what is going
23063                   on and the interactions and come up with a plan, not
23064                   just get things going.
23065
23066                 * The use of the type conversion cache that I proposed
23067                   last night had an open topic: How does this work across
23068                   protection domains.  A user defined conversion might not
23069                   be public in the location where we are applying the
23070                   conversion, a different conversion might be selected
23071                   (ie, private A->B (better) but public B->A (worse),
23072                   inside A, A->B applies, but outside it, B->A will
23073                   apply).
23074
23075                 * On top of that (ie, even if the above is solved),
23076                   conversions in a cache need to be abstract.  Ie, `To
23077                   convert from an Int to a Short use an OpcodeCast', not
23078                   `To convert from an Int to a Short use the OpcodeCast on
23079                   the variable 5' (which is what this patch was doing).
23080
23081 2001-09-28  Ravi Pratap  <ravi@ximian.com>
23082
23083         * expression.cs (Invocation::ConversionExists): Re-write to use
23084         the conversion cache
23085
23086         (Expression::ConvertImplicit): Automatic bailing out if level != 0. Also
23087         cache all conversions done, not just user-defined ones.
23088
23089         (Invocation::BetterConversion): The real culprit. Use ConversionExists
23090         to determine if a conversion exists instead of acutually trying to 
23091         perform the conversion. It's faster too.
23092
23093         (Expression::ConvertExplicit): Modify to use ConversionExists to check
23094         and only then attempt the implicit conversion.
23095
23096 2001-09-28  Ravi Pratap  <ravi@ximian.com>
23097
23098         * expression.cs (ConvertImplicit): Use a cache for conversions
23099         already found. Check level of recursion and bail out if necessary.
23100
23101 2001-09-28  Miguel de Icaza  <miguel@ximian.com>
23102
23103         * typemanager.cs (string_concat_string_string, string_concat_object_object):
23104         Export standard methods that we expect for string operations.
23105
23106         * statement.cs (Block::UsageWarning): Track usage of variables and
23107         report the errors for not used variables.
23108
23109         * expression.cs (Conditional::Resolve, ::Emit): Implement ?:
23110         operator. 
23111
23112 2001-09-27  Miguel de Icaza  <miguel@ximian.com>
23113
23114         * codegen.cs: remove unnneded code 
23115
23116         * expression.cs: Removed BuiltinTypeAccess class
23117
23118         Fix the order in which implicit conversions are
23119         done.  
23120
23121         The previous fixed dropped support for boxed conversions (adding a
23122         test to the test suite now)
23123
23124         (UserImplicitCast::CanConvert): Remove test for source being null,
23125         that code is broken.  We should not feed a null to begin with, if
23126         we do, then we should track the bug where the problem originates
23127         and not try to cover it up here.
23128
23129         Return a resolved expression of type UserImplicitCast on success
23130         rather than true/false.  Ravi: this is what I was talking about,
23131         the pattern is to use a static method as a "constructor" for
23132         objects. 
23133
23134         Also, do not create arguments until the very last minute,
23135         otherwise we always create the arguments even for lookups that
23136         will never be performed. 
23137
23138         (UserImplicitCast::Resolve): Eliminate, objects of type
23139         UserImplicitCast are born in a fully resolved state. 
23140
23141         * typemanager.cs (InitCoreTypes): Init also value_type
23142         (System.ValueType). 
23143
23144         * expression.cs (Cast::Resolve): First resolve the child expression.
23145
23146         (LValue): Add new method AddressOf to be used by
23147         the `&' operator.  
23148
23149         Change the argument of Store to take an EmitContext instead of an
23150         ILGenerator, because things like FieldExpr need to be able to call
23151         their children expression to generate the instance code. 
23152
23153         (Expression::Error, Expression::Warning): Sugar functions for
23154         reporting errors.
23155
23156         (Expression::MemberLookup): Accept a TypeContainer instead of a
23157         Report as the first argument.
23158
23159         (Expression::ResolvePrimary): Killed.  I still want to improve
23160         this as currently the code is just not right.
23161
23162         (Expression::ResolveMemberAccess): Simplify, but it is still
23163         wrong. 
23164
23165         (Unary::Resolve): Catch errors in AddressOf operators.
23166
23167         (LocalVariableReference::Emit, ::Store, ::AddressOf): typecast
23168         index to a byte for the short-version, or the compiler will choose
23169         the wrong Emit call, which generates the wrong data.
23170
23171         (ParameterReference::Emit, ::Store): same.
23172
23173         (FieldExpr::AddressOf): Implement.
23174
23175         * typemanager.cs: TypeManager: made public variable instead of
23176         property.
23177
23178         * driver.cs: document --fatal.
23179
23180         * report.cs (ErrorMessage, WarningMessage): new names for the old
23181         Error and Warning classes.
23182
23183         * cs-parser.jay (member_access): Turn built-in access to types
23184         into a normal simplename
23185
23186 2001-09-27  Ravi Pratap  <ravi@ximian.com>
23187
23188         * expression.cs (Invocation::BetterConversion): Fix to cope
23189         with q being null, since this was introducing a bug.
23190
23191         * expression.cs (ConvertImplicit): Do built-in conversions first.
23192
23193 2001-09-27  Ravi Pratap  <ravi@ximian.com>
23194
23195         * expression.cs (UserImplicitCast::Resolve): Fix bug.
23196
23197 2001-09-27  Ravi Pratap  <ravi@ximian.com>
23198
23199         * class.cs (TypeContainer::AddConstructor): Fix a stupid bug
23200         I had introduced long ago (what's new ?).
23201
23202         * expression.cs (UserImplicitCast::CanConvert): Static method to do 
23203         the work of all the checking. 
23204         (ConvertImplicit): Call CanConvert and only then create object if necessary.
23205         (UserImplicitCast::CanConvert, ::Resolve): Re-write.
23206
23207         (Unary::Operator): Rename Add and Subtract to Addition and Subtraction because
23208         that is the right way. 
23209
23210         (Invocation::MakeUnionSet): Convenience function to make unions of sets for 
23211         overloading resolution. Use everywhere instead of cutting and pasting code.
23212
23213         (Binary::ResolveOperator): Use MakeUnionSet.
23214
23215         (UserImplicitCast::CanConvert, ::Resolve): Update to take care of the case when 
23216         we have to convert to bool types. Not complete yet.
23217
23218 2001-09-27  Miguel de Icaza  <miguel@ximian.com>
23219
23220         * typemanager.cs (TypeManager::CSharpName): support ushort.
23221
23222         * expression.cs (Expression::TryImplicitIntConversion): Attempts
23223         to provide an expression that performsn an implicit constant int
23224         conversion (section 6.1.6).
23225         (Expression::ConvertImplicitRequired): Reworked to include
23226         implicit constant expression conversions.
23227
23228         (Expression::ConvertNumericExplicit): Finished.
23229
23230         (Invocation::Emit): If InstanceExpression is null, then it means
23231         that we perform a call on this.
23232
23233 2001-09-26  Miguel de Icaza  <miguel@ximian.com>
23234
23235         * expression.cs (Unary::Emit): Remove some dead code.
23236         (Probe): Implement Resolve and Emit for `is'.
23237         (Expression::ConvertImplicitRequired): Attempt to do constant
23238         expression conversions here.  Maybe should be moved to
23239         ConvertImplicit, but I am not sure.
23240         (Expression::ImplicitLongConstantConversionPossible,
23241         Expression::ImplicitIntConstantConversionPossible): New functions
23242         that tell whether is it possible to apply an implicit constant
23243         expression conversion.
23244
23245         (ConvertNumericExplicit): Started work on explicit numeric
23246         conversions.
23247
23248         * cs-parser.jay: Update operator constants.
23249
23250         * parameter.cs (Parameters::GetParameterInfo): Hook up VerifyArgs
23251         (Parameters::GetSignature): Hook up VerifyArgs here.
23252         (Parameters::VerifyArgs): Verifies that no two arguments have the
23253         same name. 
23254
23255         * class.cs (Operator): Update the operator names to reflect the
23256         ones that the spec expects (as we are just stringizing the
23257         operator names).
23258
23259         * expression.cs (Unary::ResolveOperator): Fix bug: Use
23260         MethodInfo's ReturnType instead of LookupMethodByBuilder as the
23261         previous usage did only work for our methods.
23262         (Expression::ConvertImplicit): Handle decimal implicit numeric
23263         conversions as well.
23264         (Expression::InternalTypeConstructor): Used to invoke constructors
23265         on internal types for default promotions.
23266
23267         (Unary::Emit): Implement special handling for the pre/post
23268         increment/decrement for overloaded operators, as they need to have
23269         the same semantics as the other operators.
23270
23271         (Binary::ResolveOperator): ditto.
23272         (Invocation::ConversionExists): ditto.
23273         (UserImplicitCast::Resolve): ditto.
23274
23275 2001-09-26  Ravi Pratap  <ravi@ximian.com>
23276
23277         * expression.cs (Unary::Emit and Binary::Emit): If we have an overloaded
23278         operator, return after emitting body. Regression tests pass again !
23279
23280         * expression.cs (ConvertImplicit): Take TypeContainer as first argument
23281         (Unary::ForceConversion, Binary::ForceConversion): Ditto.
23282         (Invocation::OverloadResolve): Ditto.
23283         (Invocation::BetterFunction, BetterConversion, ConversionExists): Ditto.
23284
23285         * everywhere : update calls to the above methods accordingly.
23286
23287 2001-09-26  Miguel de Icaza  <miguel@ximian.com>
23288
23289         * assign.cs (Assign): Make it inherit from ExpressionStatement.
23290
23291         * expression.cs (ExpressionStatement): New base class used for
23292         expressions that can appear in statements, so that we can provide
23293         an alternate path to generate expression that do not leave a value
23294         on the stack.
23295
23296         (Expression::Emit, and all the derivatives): We no longer return
23297         whether a value is left on the stack or not.  Every expression
23298         after being emitted leaves a single value on the stack.
23299
23300         * codegen.cs (EmitContext::EmitStatementExpression): Use the
23301         facilties of ExpressionStatement if possible.
23302
23303         * cs-parser.jay: Update statement_expression.
23304
23305 2001-09-25  Miguel de Icaza  <miguel@ximian.com>
23306
23307         * driver.cs: Change the wording of message
23308
23309 2001-09-25  Ravi Pratap  <ravi@ximian.com>
23310
23311         * expression.cs (Binary::ResolveOperator): Had forgottten to set 
23312         the type of the expression to the return type of the method if
23313         we have an overloaded operator match ! The regression tests pass again !
23314         (Unary::ResolveOperator): Ditto.
23315
23316         * expression.cs (Invocation::ConversionExists): Correct the member lookup
23317         to find "op_Implicit", not "implicit" ;-)
23318         (UserImplicitCast): New class to take care of user-defined implicit conversions.
23319         (ConvertImplicit, ForceConversion): Take TypeContainer argument
23320
23321         * everywhere : Correct calls to the above accordingly.
23322
23323         * expression.cs (UserImplicitCast::Resolve, ::Emit): Implement.
23324         (ConvertImplicit): Do user-defined conversion if it exists.
23325
23326 2001-09-24  Miguel de Icaza  <miguel@ximian.com>
23327
23328         * assign.cs: track location.
23329         (Resolve): Use implicit conversions on assignment.
23330
23331         * literal.cs: Oops.  Not good, Emit of short access values should
23332         pass (Bytes) or the wrong argument will be selected.
23333
23334         * expression.cs (Unary::Emit): Emit code for -expr.
23335
23336         (Unary::ResolveOperator): Handle `Substract' for non-constants
23337         (substract from zero from the non-constants).
23338         Deal with Doubles as well. 
23339
23340         (Expression::ConvertImplicitRequired): New routine that reports an
23341         error if no implicit conversion exists. 
23342
23343         (Invocation::OverloadResolve): Store the converted implicit
23344         expressions if we make them
23345
23346 2001-09-24  Ravi Pratap  <ravi@ximian.com>
23347
23348         * class.cs (ConstructorInitializer): Take a Location argument.
23349         (ConstructorBaseInitializer): Same here.
23350         (ConstructorThisInitializer): Same here.
23351
23352         * cs-parser.jay : Update all calls accordingly.
23353
23354         * expression.cs (Unary, Binary, New): Take location argument.
23355         Update accordingly everywhere.
23356
23357         * cs-parser.jay : Update all calls to the above to take a location
23358         argument.
23359
23360         * class.cs : Ditto.
23361
23362 2001-09-24  Ravi Pratap  <ravi@ximian.com>
23363
23364         * expression.cs (Invocation::BetterFunction): Take TypeContainer argument
23365         (Invocation::BetterConversion): Same here
23366         (Invocation::ConversionExists): Ditto.
23367
23368         (Invocation::ConversionExists): Implement.
23369
23370 2001-09-22  Ravi Pratap  <ravi@ximian.com>
23371
23372         * expression.cs (OverloadResolve): Improve some more to catch errors 1502 and 1503
23373         Also take an additional TypeContainer argument.
23374
23375         * All over : Pass in TypeContainer as argument to OverloadResolve.
23376
23377         * typemanager.cs (CSharpName): Update to check for the string type and return
23378         that too.
23379
23380         * expression.cs (Invocation::FullMethodDesc): New static method to return a string fully describing
23381         a given method.
23382
23383 2001-09-21  Ravi Pratap  <ravi@ximian.com>
23384
23385         * expression.cs (Invocation::OverloadResolve): Re-write to conform more to the spec.
23386         (Invocation::BetterFunction): Implement.
23387         (Invocation::BetterConversion): Implement.
23388         (Invocation::ConversionExists): Skeleton, no implementation yet.
23389
23390         Okay, things work fine !
23391
23392 2001-09-21  Miguel de Icaza  <miguel@ximian.com>
23393
23394         * typemanager.cs: declare and load enum_type, delegate_type and
23395         void_type. 
23396
23397         * expression.cs (Expression::Emit): Now emit returns a value that
23398         tells whether a value is left on the stack or not.  This strategy
23399         might be reveted tomorrow with a mechanism that would address
23400         multiple assignments.
23401         (Expression::report118): Utility routine to report mismatches on
23402         the ExprClass.
23403
23404         (Unary::Report23): Report impossible type/operator combination
23405         utility function.
23406
23407         (Unary::IsIncrementableNumber): Whether the type can be
23408         incremented or decremented with add.
23409         (Unary::ResolveOperator): Also allow enumerations to be bitwise
23410         complemented. 
23411         (Unary::ResolveOperator): Implement ++, !, ~,
23412
23413         (Invocation::Emit): Deal with new Emit convetion.
23414
23415         * All Expression derivatives: Updated their Emit method to return
23416         whether they leave values on the stack or not.
23417
23418         * codegen.cs (CodeGen::EmitStatement): Pop values left on the
23419         stack for expressions that are statements. 
23420
23421 2001-09-20  Miguel de Icaza  <miguel@ximian.com>
23422
23423         * expression.cs (LValue): New interface.  Must be implemented by
23424         LValue objects.
23425         (LocalVariableReference, ParameterReference, FieldExpr): Implement
23426         LValue interface.
23427
23428         * assign.cs (Assign::Emit, Assign::Resolve): Use new LValue
23429         interface for generating code, simplifies the code.
23430
23431 2001-09-20  Ravi Pratap  <ravi@ximian.com>
23432
23433         * expression.cs (everywhere): Comment out return statements in ::Resolve
23434         methods to avoid the warnings.
23435
23436 2001-09-20  Miguel de Icaza  <miguel@ximian.com>
23437
23438         * driver.cs (parse): Report error 2001 if we can not open the
23439         source file.
23440
23441         * expression.cs (SimpleName::ResolveSimpleName): Error if we can
23442         not resolve it.
23443
23444         * cs-parser.jay (QualifierIdentifier): Pass location to SimpleName
23445         object. 
23446
23447         * statement.cs (Block::EmitMeta): Reuse the count across all the variables,
23448         otherwise nested blocks end up with the same index.
23449
23450         * codegen.cs (CodeGen::EmitTopBlock): Pass initial sequence
23451
23452         * expression.cs:  Instead of having FIXMEs in the Resolve
23453         functions, throw exceptions so it is obvious that we are facing a
23454         bug. 
23455
23456         * cs-parser.jay (invocation_expression): Pass Location information.
23457
23458         * codegen.cs (CodeGen::Save, CodeGen::CodeGen, CodeGen::Basename):
23459         Use a basename for those routines because .NET does not like paths
23460         on them. 
23461
23462         * class.cs (TypeContainer::AddMethod): Do not call DefineName if the name was
23463         already defined.
23464
23465 2001-09-19  Miguel de Icaza  <miguel@ximian.com>
23466
23467         * typemanager.cs (TypeManager::CoreLookupType): A function to make sure that we
23468         are loading the correct data types (throws an exception if not).
23469         (TypeManager::InitCoreTypes): Use CoreLookupType
23470
23471         * expression.cs (Unary::ResolveOperator): return the child
23472         expression for expressions which are just +expr.
23473         (Unary::ResolveOperator): Return negative literals for -LITERAL
23474         expressions (otherwise they are Unary {Literal}).
23475         (Invocation::Badness): Take into account `Implicit constant
23476         expression conversions'.
23477
23478         * literal.cs (LongLiteral): Implement long literal class.
23479         (IntLiteral): export the `Value' of the intliteral. 
23480
23481 2001-09-19  Ravi Pratap  <ravi@ximian.com>
23482
23483         * expression.cs (Binary::Emit): Finally get the emission right ! Woo!
23484
23485         * class.cs (Operator::Define): Change the methodname prefix to 'op_' 
23486         instead of 'Operator'
23487
23488         * expression.cs (Binary::ResolveOperator): Update accordingly.
23489         (Unary::Operator): Change names to 'Add' and 'Subtract' instead 'Plus'
23490         and 'Minus'
23491
23492         * cs-parser.jay (unary_expression): Update to use the new names.
23493
23494         * gen-treedump.cs (GetUnary): Same here.
23495
23496         * expression.cs (Unary::Resolve): Implement.
23497         (Binary::ResolveOperator): Re-write bits to quietly continue if no overloaded 
23498         operators are found instead of making noise ;-)
23499         (Unary::ResolveOperator): New method to do precisely the same thing which
23500         Binary::ResolveOperator does for Binary expressions.
23501         (Unary.method, .Arguments): Add.
23502         (Unary::OperName): Implement.   
23503         (Unary::ForceConversion): Copy and Paste !
23504
23505         * class.cs (Operator::Define): Fix a small bug for the case when we have 
23506         a unary operator.
23507
23508         * expression.cs (Unary::Emit): Implement. Need to find the right Opcodes
23509         for the inbuilt operators. Only overloading works for now ;-)
23510
23511 2001-09-18  Miguel de Icaza  <miguel@ximian.com>
23512
23513         * expression.cs (CheckedExpr::Resolve, CheckedExpr::Emit,
23514         UnCheckedExpr::Resolve, UnCheckedExpr::Emit): Implement.
23515
23516         * expression.cs (This::Emit): Implement. 
23517         (This::Resolve): Implement.
23518         (TypeOf:Resolve): Implement.
23519         (Expression::ResolveSimpleName): Add an implicit this to instance
23520         field references. 
23521         (MemberAccess::Resolve): Deal with Parameters and Fields. 
23522         Bind instance variable to Field expressions.
23523         (FieldExpr::Instance): New field used to track the expression that
23524         represents the object instance.
23525         (FieldExpr::Resolve): Track potential errors from MemberLookup not
23526         binding 
23527         (FieldExpr::Emit): Implement.
23528
23529         * codegen.cs (EmitIf, EmitStatement, EmitBlock): Propagate whether
23530         the last instruction contains a return opcode to avoid generating
23531         the last `ret' instruction (this generates correct code, and it is
23532         nice to pass the peverify output).
23533
23534         * class.cs (TypeContainer::EmitFieldInitializers): Implement field
23535         initializer for static and instance variables.
23536         (Constructor::Emit): Allow initializer to be null in the case of
23537         static constructors.  Only emit initializer for instance
23538         constructors. 
23539
23540         (TypeContainer::FindMembers): Return a null array if there are no
23541         matches.
23542
23543         Also fix the code for the MemberTypes.Method branch, as it was not
23544         scanning that for operators (or tried to access null variables before).
23545
23546         * assign.cs (Assign::Emit): Handle instance and static fields. 
23547
23548         * TODO: Updated.
23549
23550         * driver.cs: Stop compilation if there are parse errors.
23551
23552         * cs-parser.jay (constructor_declaration): Provide default base
23553         initializer for non-static constructors.
23554         (constructor_declarator): Do not provide a default base
23555         initializers if none was specified.
23556         Catch the fact that constructors should not have parameters.
23557
23558         * class.cs: Do not emit parent class initializers for static
23559         constructors, that should be flagged as an error.
23560
23561 2001-09-18  Ravi Pratap  <ravi@ximian.com>
23562
23563         * class.cs (RegisterMethodBuilder): Remove : it's unnecessary.
23564         Move back code into TypeContainer::Populate.
23565
23566 2001-09-18  Ravi Pratap  <ravi@ximian.com>
23567
23568         * class.cs (TypeContainer::AddConstructor): Fix the check to
23569         compare against Name, not Basename. 
23570         (Operator::OpType): Change Plus and Minus to Add and Subtract.
23571
23572         * cs-parser.jay : Update accordingly.
23573
23574         * class.cs (TypeContainer::FindMembers): For the case where we are searching
23575         for methods, don't forget to look into the operators too.
23576         (RegisterMethodBuilder): Helper method to take care of this for
23577         methods, constructors and operators.
23578         (Operator::Define): Completely revamp.
23579         (Operator.OperatorMethod, MethodName): New fields.
23580         (TypeContainer::Populate): Move the registering of builders into
23581         RegisterMethodBuilder.
23582         (Operator::Emit): Re-write.
23583
23584         * expression.cs (Binary::Emit): Comment out code path to emit method
23585         invocation stuff for the case when we have a user defined operator. I am
23586         just not able to get it right !
23587
23588 2001-09-17  Miguel de Icaza  <miguel@ximian.com>
23589
23590         * expression.cs (Expression::OverloadResolve): Drop TypeContainer
23591         argument. 
23592
23593         (Expression::MemberLookup): Provide a version that allows to
23594         specify the MemberTypes and BindingFlags. 
23595
23596         * statement.cs (Block::GetVariableInfo): Forgot to recurse here,
23597         so it was not fetching variable information from outer blocks.
23598
23599         * modifiers.cs: (Modifiers::TypeAttr): Invert condition on
23600         Beforefieldinit as it was buggy.
23601
23602         * rootcontext.cs (::LookupInterfaceOrClass): Removed an Error -200
23603         that Ravi put here.  
23604
23605         * class.cs (Constructor::Emit): Only emit if block is not null.
23606         (TypeContainer::EmitDefaultConstructor): Removed routine, now we
23607         deal with this by semantically definining it as if the user had
23608         done it.
23609
23610         (TypeContainer::FindMembers): Removed ad-hoc hack to deal with
23611         constructors as we now "emit" them at a higher level.
23612
23613         (TypeContainer::DefineDefaultConstructor): Used to define the
23614         default constructors if none was provided.
23615
23616         (ConstructorInitializer): Add methods Resolve and Emit. 
23617
23618         * expression.cs: Cast to ConstructorInfo instead of MethodInfo
23619
23620 2001-09-17  Ravi Pratap  <ravi@ximian.com>
23621
23622         * class.cs (TypeContainer::EmitDefaultConstructor): Register
23623         the default constructor builder with our hashtable for methodbuilders
23624         to methodcores.
23625
23626         * expression.cs (Invocation::OverloadResolve): Add a check for pd == null
23627         and argument_count is 0 in which case we have a match.
23628         (Binary::ResolveOperator): More null checking and miscellaneous coding
23629         style cleanup.
23630
23631 2001-09-17  Ravi Pratap  <ravi@ximian.com>
23632
23633         * rootcontext.cs (IsNameSpace): Compare against null.
23634
23635         * everywhere : Correct spelling to 'Greater' and to 'Subtract'
23636
23637         * class.cs (Operator::OpType): Change names to match the ones in Binary::Operator
23638         and Unary::Operator.
23639
23640         * cs-parser.jay (operator_declaration, CheckBinaryOperator, CheckUnaryOperator): Update
23641         accordingly.
23642
23643         * expression.cs (Binary::method): New member to hold the MethodBase for the case when
23644         we have overloaded operators.
23645         (Binary::ResolveOperator): Implement the part which does the operator overload
23646         resolution.
23647
23648         * class.cs (Operator::Emit): Implement.
23649         (TypeContainer::Emit): Emit the operators we have too.
23650
23651         * expression.cs (Binary::Emit): Update to emit the appropriate code for
23652         the case when we have a user-defined operator.
23653
23654 2001-09-17  Miguel de Icaza  <miguel@ximian.com>
23655
23656         * rootcontext.cs: Fix bug: tree.Namespaces might be null.
23657
23658 2001-09-16  Ravi Pratap  <ravi@ximian.com>
23659
23660         * class.cs (EmitStaticFieldInitializers, EmitFieldInitializers): Make public.
23661         (TypeContainer::EmitConstructor): Remove and move code into Contructor::Emit.
23662         (Constructor::Emit): Implement.
23663         (EmitStaticFieldInitializers, EmitFieldInitializers): Ensure we return immediately
23664         if we have no work to do. 
23665         (TypeContainer::Emit): Pass in TypeContainer as argument to the constructor's 
23666         Emit method.
23667
23668         * interface.cs (Interface::InterfaceAttr): Re-write to be more correct and complete.
23669         (Interface::IsTopLevel): Add. Same as TypeContainer::IsTopLevel.
23670
23671         * class.cs (TypeContainer::IsTopLevel): Modify to use parent.Parent instead
23672         of parent.parent.
23673
23674 2001-09-15  Ravi Pratap  <ravi@ximian.com>
23675
23676         * tree.cs (Tree::namespaces): New hashtable to keep track of namespaces
23677         in the source.
23678         (Tree::RecordNamespace): Method to do what the name says ;-)
23679         (Tree::Namespaces): Property to get at the namespaces hashtable.
23680
23681         * cs-parser.jay (namespace_declaration): Call RecordNamespace to 
23682         keep track.
23683
23684         * rootcontext.cs (IsNamespace): Fixed it :-)
23685
23686 2001-09-14  Miguel de Icaza  <miguel@ximian.com>
23687
23688         * class.cs (TypeContainer::FindMembers): Add support for
23689         constructors. 
23690         (MethodCore): New class that encapsulates both the shared aspects
23691         of a Constructor and a Method.  
23692         (Method, Constructor): Factored pieces into MethodCore.
23693
23694         * driver.cs: Added --fatal which makes errors throw exceptions.
23695         Load System assembly as well as part of the standard library.
23696
23697         * report.cs: Allow throwing exceptions on errors for debugging.
23698
23699         * modifiers.cs: Do not use `parent', instead use the real type
23700         container to evaluate permission settings.
23701
23702         * class.cs: Put Ravi's patch back in.  He is right, and we will
23703         have to cope with the
23704
23705 2001-09-14  Ravi Pratap  <ravi@ximian.com>
23706
23707         * modifiers.cs (TypeAttr, MethodAttr, FieldAttr): Map protected internal to
23708         FamORAssem, not FamANDAssem.
23709
23710 2001-09-14  Miguel de Icaza  <miguel@ximian.com>
23711
23712         * driver.cs: Added --parse option that only parses its input files
23713         and terminates.
23714
23715         * class.cs: Reverted last change from Ravi to IsTopLevel.  That is
23716         incorrect.  IsTopLevel is not used to tell whether an object is
23717         root_types or not (that can be achieved by testing this ==
23718         root_types).  But to see if this is a top-level *class* (not
23719         necessarly our "toplevel" container). 
23720
23721 2001-09-14  Ravi Pratap  <ravi@ximian.com>
23722
23723         * enum.cs (Enum::Define): Modify to call the Lookup method on the
23724         parent instead of a direct call to GetType.
23725
23726 2001-09-14  Ravi Pratap  <ravi@ximian.com>
23727
23728         * class.cs (TypeContainer::TypeAttr): Remove property code and move it into
23729         Modifiers.TypeAttr. This should just be a call to that method.
23730
23731         * modifiers.cs (TypeAttr): Re-write and take an extra argument, the TypeContainer
23732         object so that we can determine if we are top-level or not.
23733
23734         * delegate.cs (Delegate::Define): Update call to TypeAttr method to pass in the 
23735         TypeContainer too.
23736
23737         * enum.cs (Enum::Define): Ditto.
23738
23739         * modifiers.cs (FieldAttr): Re-write.
23740
23741         * class.cs (TypeContainer::IsTopLevel): Change accessibility to public.
23742         (TypeContainer::HaveStaticConstructor): New property to provide access
23743         to precisely that info.
23744
23745         * modifiers.cs (MethodAttr): Re-write.
23746         (EventAttr): Remove altogether as there seems to be no ostensible use for it.
23747
23748         * class.cs (TypeContainer::IsTopLevel): Re-write. root_types doesn't seem to be the parent
23749         of top-level types as claimed.
23750
23751 2001-09-13  Miguel de Icaza  <miguel@ximian.com>
23752
23753         * expression.cs (MemberLookup): Fruitless attempt to lookup
23754         constructors.  Maybe I need to emit default constructors?  That
23755         might be it (currently .NET emits this for me automatically).
23756         (Invocation::OverloadResolve): Cope with Arguments == null.
23757         (Invocation::EmitArguments): new function, shared by the new
23758         constructor and us.
23759         (Invocation::Emit): Handle static and instance methods.  Emit
23760         proper call instruction for virtual or non-virtual invocations.
23761         (New::Emit): Implement.
23762         (New::Resolve): Implement.
23763         (MemberAccess:Resolve): Implement.
23764         (MethodGroupExpr::InstanceExpression): used conforming to the spec
23765         to track instances.
23766         (FieldExpr::Resolve): Set type.
23767
23768         * support.cs: Handle empty arguments.
23769                 
23770         * cs-parser.jay (CompositeLookup, QualifierIdentifier,
23771         SimpleLookup): Auxiliary routines to help parse a qualifier
23772         identifier.  
23773
23774         Update qualifier_identifier rule.
23775
23776         * codegen.cs: Removed debugging messages.
23777
23778         * class.cs: Make this a global thing, this acts just as a "key" to
23779         objects that we might have around.
23780
23781         (Populate): Only initialize method_builders_to_methods once.
23782
23783         * expression.cs (PropertyExpr): Initialize type from the
23784         PropertyType. 
23785
23786         * codegen.cs (EmitContext::EmitBoolExpression): Use propper
23787         Resolve pattern.  Attempt to implicitly convert value to boolean.
23788         Emit code.
23789
23790         * expression.cs: Set the type for the int32/int32 argument case.
23791         (Binary::ResolveOperator): Set the return type to boolean for
23792         comparission operators
23793
23794         * typemanager.cs: Remove debugging print code.
23795
23796         (Invocation::Resolve): resolve type.
23797
23798         * class.cs: Allocate a MemberInfo of the correct size, as the code
23799         elsewhere depends on the test to reflect the correct contents.
23800
23801         (Method::) Keep track of parameters, due to System.Reflection holes
23802
23803         (TypeContainer::Populate): Keep track of MethodBuilders to Method
23804         mapping here.
23805
23806         (TypeContainer::FindMembers): Use ArrayList and then copy an array
23807         of the exact size and return that.
23808
23809         (Class::LookupMethodByBuilder): New function that maps
23810         MethodBuilders to its methods.  Required to locate the information
23811         on methods because System.Reflection bit us again.
23812
23813         * support.cs: New file, contains an interface ParameterData and
23814         two implementations: ReflectionParameters and InternalParameters
23815         used to access Parameter information.  We will need to grow this
23816         as required.
23817
23818         * expression.cs (Invocation::GetParameterData): implement a cache
23819         and a wrapper around the ParameterData creation for methods. 
23820         (Invocation::OverloadResolve): Use new code.
23821
23822 2001-09-13  Ravi Pratap  <ravi@ximian.com>
23823
23824         * class.cs (TypeContainer::EmitField): Remove and move into 
23825         (Field::Define): here and modify accordingly.
23826         (Field.FieldBuilder): New member.
23827         (TypeContainer::Populate): Update accordingly.
23828         (TypeContainer::FindMembers): Implement.
23829
23830 2001-09-13  Miguel de Icaza  <miguel@ximian.com>
23831
23832         * statement.cs: (VariableInfo::VariableType): New field to be
23833         initialized with the full type once it is resolved. 
23834
23835 2001-09-12  Miguel de Icaza  <miguel@ximian.com>
23836
23837         * parameter.cs (GetParameterInfo): Use a type cache to compute
23838         things only once, and to reuse this information
23839
23840         * expression.cs (LocalVariableReference::Emit): Implement.
23841         (OpcodeCast::Emit): fix.
23842
23843         (ParameterReference::Resolve): Implement.
23844         (ParameterReference::Emit): Implement.
23845
23846         * cs-parser.jay: Fix bug introduced by Ravi, variable initializers
23847         that are expressions need to stay as Expressions.
23848
23849         * typemanager.cs (CSharpName): Returns the C# name of a type if
23850         possible. 
23851
23852         * expression.cs (Expression::ConvertImplicit): New function that
23853         implements implicit type conversions.
23854
23855         (Expression::ImplicitReferenceConversion): Implements implicit
23856         reference conversions.
23857
23858         (EmptyCast): New type for transparent casts.
23859
23860         (OpcodeCast): New type for casts of types that are performed with
23861         a sequence of bytecodes.
23862
23863         (BoxedCast): New type used for casting value types into reference
23864         types.  Emits a box opcode.
23865
23866         (Binary::DoNumericPromotions): Implements numeric promotions of
23867         and computation of the Binary::Type.
23868
23869         (Binary::EmitBranchable): Optimization.
23870
23871         (Binary::Emit): Implement code emission for expressions.
23872
23873         * typemanager.cs (TypeManager): Added two new core types: sbyte
23874         and byte.
23875
23876 2001-09-12  Ravi Pratap  <ravi@ximian.com>
23877
23878         * class.cs (TypeContainer::FindMembers): Method which does exactly
23879         what Type.FindMembers does, only we don't have to use reflection. No
23880         implementation yet.
23881
23882         * typemanager.cs (typecontainers): New hashtable to hold the corresponding
23883         typecontainer objects as we need to get at them.
23884         (TypeManager::AddUserType): Overload to take an extra argument, the TypeContainer.
23885
23886         * rootcontext.cs : Correspondingly modify called to AddUserType to pass the
23887         typecontainer object.
23888
23889         * expression.cs (MemberLookup): Modify signature to take a RootContext object instead
23890         of just a Report object.
23891
23892 2001-09-11  Ravi Pratap  <ravi@ximian.com>
23893
23894         * class.cs (Event::Define): Go back to using the prefixes "add_" and
23895         "remove_"
23896         (TypeContainer::Populate): Now define the delegates of the type too.
23897         (TypeContainer.Delegates): Property to access the list of delegates defined
23898         in the type.
23899
23900         * delegates.cs (Delegate::Define): Implement partially.
23901
23902         * modifiers.cs (TypeAttr): Handle more flags.
23903
23904 2001-09-11  Ravi Pratap  <ravi@ximian.com>
23905
23906         * class.cs (Indexer::Define): Fix for loop iteration condition to be just <
23907         and not <=
23908         (Operator::Define): Re-write logic to get types by using the LookupType method
23909         instead of blindly doing a Type.GetType ! How stupid can I get ;-) ?
23910         (Indexer::Define): Ditto.
23911         (Event::Define): Ditto.
23912         (Property::Define): Ditto.
23913
23914 2001-09-10  Ravi Pratap  <ravi@ximian.com>
23915
23916         * class.cs (TypeContainer::Populate): Now define operators too. 
23917         (TypeContainer.Operators): New property to access the list of operators
23918         in a type.
23919         (Operator.OperatorMethodBuilder): New member to hold the method builder
23920         for the operator we are defining.
23921         (Operator::Define): Implement.
23922
23923 2001-09-10  Ravi Pratap  <ravi@ximian.com>
23924
23925         * class.cs (Event::Define): Make the prefixes of the accessor methods
23926         addOn_ and removeOn_ 
23927
23928         * genericparser.cs (GenericParser::error): Overloaded method to handle the case
23929         of the location being passed in too. Ideally, this should go later since all
23930         error reporting should be done through the Report object.
23931
23932         * class.cs (TypeContainer.Indexers): New property to access the list of indexers.
23933         (Populate): Iterate thru the indexers we have and define them too.
23934         (Indexer.GetMethodBuilder, .SetMethodBuilder): New members to hold the method builders
23935         for the get and set accessors.
23936         (Indexer::Define): Implement.
23937
23938 2001-09-09  Miguel de Icaza  <miguel@ximian.com>
23939
23940         * expression.cs (Binary::Resolve): Beginning of it.  I scratched
23941         my previous implementation, did not work.
23942
23943         * typemanager.cs: Add a couple of missing types (the longs).
23944
23945         * literal.cs: Use TypeManager.bool_type instead of getting it.
23946
23947         * expression.cs (EventExpr): New kind of expressions.
23948         (Expressio::ExprClassFromMemberInfo): finish
23949
23950 2001-09-08  Miguel de Icaza  <miguel@ximian.com>
23951
23952         * assign.cs: Emit stores to static fields differently.
23953
23954 2001-09-08  Ravi Pratap  <ravi@ximian.com>
23955
23956         * Merge in changes and adjust code to tackle conflicts. Backed out my
23957         code in Assign::Resolve ;-) 
23958
23959 2001-09-08  Ravi Pratap  <ravi@ximian.com>
23960
23961         * cs-parser.jay (CheckAttributeTarget): Modify call to error to use
23962         instead Report.Error and also pass in the location.
23963         (CSharpParser::Lexer): New readonly property to return the reference
23964         to the Tokenizer object.
23965         (declare_local_variables): Use Report.Error with location instead of plain 
23966         old error.
23967         (CheckDef): Ditto.
23968
23969         * class.cs (Operator::CheckUnaryOperator): Move into cs-parser.jay.
23970         (Operator.CheckBinaryOperator): Ditto.
23971
23972         * cs-parser.jay (operator_declarator): Update accordingly.
23973
23974         * cs-parser.jay (CheckUnaryOperator): Modify to use Report.Error
23975         (CheckBinaryOperator): Same here.
23976
23977         * rootcontext.cs (LookupType): Add an extra lookup which simply does a lookup
23978         on the name without any prefixes of namespace names etc. This is because we
23979         already might have something already fully qualified like 
23980         'System.Console.WriteLine'
23981
23982         * assign.cs (Resolve): Begin implementation. Stuck ;-)
23983
23984 2001-09-07  Ravi Pratap  <ravi@ximian.com>
23985
23986         * cs-tokenizer.cs (location): Return a string which also contains
23987         the file name.
23988
23989         * expression.cs (ElementAccess): New class for expressions of the
23990         type 'element access.'
23991         (BaseAccess): New class for expressions of the type 'base access.'
23992         (CheckedExpr, UnCheckedExpr): New classes for Checked and Unchecked expressions
23993         respectively.
23994
23995         * cs-parser.jay (element_access): Implement action.
23996         (base_access): Implement actions.
23997         (checked_expression, unchecked_expression): Implement.
23998
23999         * cs-parser.jay (local_variable_type): Correct and implement.
24000         (type_suffixes, type_suffix_list, type_suffix): Implement actions.
24001
24002         * cs-tokenizer.cs (real_type_suffix): Comment out the extra getchar.
24003
24004         * cs-parser.jay (rank_specifiers): Remove space while concatenating the type's
24005         name and the specifiers.
24006
24007         * interface.cs (InterfaceAttr): New property to return the corresponding TypeAttributes
24008
24009         * rootcontext.cs (CreateInterface): Use the InterfaceAttr property instead of 
24010         making them all public ;-)
24011
24012         * cs-parser.jay (error): Remove entirely as we have an implementation in the base
24013         class anyways.
24014
24015 2001-09-07  Miguel de Icaza  <miguel@ximian.com>
24016
24017         * expression.cs (ExprClassFromMemberInfo): Return FieldExpr and
24018         PropertyExprs.
24019         (FieldExpr, PropertyExprs): New resolved expressions.
24020         (SimpleName::MemberStaticCheck): Perform static checks for access
24021         to non-static fields on static methods. Maybe this should be
24022         generalized for MemberAccesses. 
24023         (SimpleName::ResolveSimpleName): More work on simple name
24024         resolution. 
24025
24026         * cs-parser.jay (primary_expression/qualified_identifier): track
24027         the parameter index.
24028
24029         * codegen.cs (CodeGen::Save): Catch save exception, report error.
24030         (EmitContext::EmitBoolExpression): Chain to expression generation
24031         instead of temporary hack.
24032         (::EmitStatementExpression): Put generic expression code generation.
24033
24034         * assign.cs (Assign::Emit): Implement variable assignments to
24035         local variables, parameters and fields.
24036
24037 2001-09-06  Miguel de Icaza  <miguel@ximian.com>
24038
24039         * statement.cs (Block::GetVariableInfo): New method, returns the
24040         VariableInfo for a variable name in a block.
24041         (Block::GetVariableType): Implement in terms of GetVariableInfo
24042
24043         * literal.cs (IntLiteral::Emit, FloatLiteral::Emit,
24044         DoubleLiteral::Emit, CharLiteral::Emit, BoolLiteral::Emit): Implement
24045
24046 2001-09-06  Ravi Pratap  <ravi@ximian.com>
24047
24048         * cs-parser.jay (operator_declaration): Continue on my quest : update
24049         to take attributes argument.
24050         (event_declaration): Ditto.
24051         (enum_declaration): Ditto.
24052         (indexer_declaration): Ditto.
24053
24054         * class.cs (Operator::Operator): Update constructor accordingly.
24055         (Event::Event): Ditto.
24056
24057         * delegate.cs (Delegate::Delegate): Same here.
24058
24059         * enum.cs (Enum::Enum): Same here.
24060
24061 2001-09-05  Ravi Pratap  <ravi@ximian.com>
24062
24063         * cs-parser.jay (CheckAttributeTarget): Update to use the right error number.
24064
24065         * ../tests/cs0658.cs : New file to demonstrate error 0658.
24066
24067         * attribute.cs (Attributes): New class to encapsulate all attributes which were
24068         being passed around as an arraylist.
24069         (Attributes::AddAttribute): Method to add attribute sections.
24070
24071         * cs-parser.jay (opt_attributes): Modify actions to use the new Attributes class.
24072         (struct_declaration): Update accordingly.
24073         (constant_declaration): Update.
24074         (field_declaration): Update.
24075         (method_header): Update.
24076         (fixed_parameter): Update.
24077         (parameter_array): Ditto.
24078         (property_declaration): Ditto.
24079         (destructor_declaration): Ditto.
24080
24081         * class.cs (Struct::Struct): Update constructors accordingly.
24082         (Class::Class): Ditto.
24083         (Field::Field): Ditto.
24084         (Method::Method): Ditto.
24085         (Property::Property): Ditto.
24086         (TypeContainer::OptAttribute): update property's return type.
24087
24088         * interface.cs (Interface.opt_attributes): New member.
24089         (Interface::Interface): Update to take the extra Attributes argument.
24090
24091         * parameter.cs (Parameter::Parameter): Ditto.
24092
24093         * constant.cs (Constant::Constant): Ditto.
24094
24095         * interface.cs (InterfaceMemberBase): New OptAttributes field.
24096         (InterfaceMemberBase::InterfaceMemberBase): Update constructor to take 
24097         the attributes as a parameter.
24098         (InterfaceProperty): Update constructor call.
24099         (InterfaceEvent): Ditto.
24100         (InterfaceMethod): Ditto.
24101         (InterfaceIndexer): Ditto.
24102
24103         * cs-parser.jay (interface_indexer_declaration): Update call to constructor to 
24104         pass the attributes too.
24105         (interface_event_declaration): Ditto.
24106         (interface_property_declaration): Ditto.
24107         (interface_method_declaration): Ditto.
24108         (interface_declaration): Ditto.
24109
24110 2001-09-05  Miguel de Icaza  <miguel@ximian.com>
24111
24112         * class.cs (Method::Define): Track the "static Main" definition to
24113         create an entry point. 
24114
24115         * rootcontext.cs (RootContext::EntryPoint): MethodInfo that holds the
24116         EntryPoint if we find it. 
24117
24118         * codegen.cs (EmitContext::EmitInvocation): Emit invocations.
24119         (EmitContext::ig): Make this variable public.
24120
24121         * driver.cs: Make the default output file be the first file name
24122         with the .exe extension.  
24123
24124         Detect empty compilations
24125
24126         Handle various kinds of output targets.  Handle --target and
24127         rename -t to --dumper.
24128
24129         * expression.cs, literal.cs, assign.cs, constant.cs: All `Resolve'
24130         methods inherited from Expression return now an Expression.  This
24131         will is used during the tree rewriting as we resolve them during
24132         semantic analysis.
24133
24134         (Expression::MemberLookup): Implements the MemberLookup (7.3) from
24135         the spec.  Missing entirely is the information about
24136         accessability of elements of it.
24137
24138         (Expression::ExprClassFromMemberInfo): New constructor for
24139         Expressions that creates a fully initialized Expression based on
24140         a MemberInfo that is one of Eventinfo, FieldINfo, PropertyInfo or
24141         a Type.
24142
24143         (Invocation::Resolve): Begin implementing resolution of invocations.
24144
24145         * literal.cs (StringLiteral):  Implement Emit.
24146
24147 2001-09-05  Ravi Pratap  <ravi@ximian.com>
24148
24149         * cs-parser.jay (error): Add new modifier because we are hiding an inherited
24150         member.
24151
24152 2001-09-04  Ravi Pratap  <ravi@ximian.com>
24153
24154         * cs-parser.jay (attribute_arguments): Implement actions.
24155         (attribute): Fix bug in production. Implement action.
24156         (attribute_list): Implement.
24157         (attribute_target): Implement.
24158         (attribute_target_specifier, opt_target_specifier): Implement
24159         (CheckAttributeTarget): New method to check if the attribute target
24160         is valid.
24161         (attribute_section): Implement.
24162         (opt_attributes): Implement.
24163
24164         * attribute.cs : New file to handle attributes.
24165         (Attribute): Class to hold attribute info.
24166
24167         * cs-parser.jay (opt_attribute_target_specifier): Remove production
24168         (attribute_section): Modify production to use 2 different rules to 
24169         achieve the same thing. 1 s/r conflict down !
24170         Clean out commented, useless, non-reducing dimension_separator rules.
24171
24172         * class.cs (TypeContainer.attributes): New member to hold list
24173         of attributes for a type.
24174         (Struct::Struct): Modify to take one more argument, the attribute list.
24175         (Class::Class): Ditto.
24176         (Field::Field): Ditto.
24177         (Method::Method): Ditto.
24178         (Property::Property): Ditto.
24179
24180         * cs-parser.jay (struct_declaration): Update constructor call to
24181         pass in the attributes too.
24182         (class_declaration): Ditto.
24183         (constant_declaration): Ditto.
24184         (field_declaration): Ditto.
24185         (method_header): Ditto.
24186         (fixed_parameter): Ditto.
24187         (parameter_array): Ditto.
24188         (property_declaration): Ditto.
24189
24190         * constant.cs (Constant::Constant): Update constructor similarly.
24191         Use System.Collections.
24192
24193         * parameter.cs (Parameter::Parameter): Update as above.
24194
24195 2001-09-02  Ravi Pratap  <ravi@ximian.com>
24196
24197         * class.cs (TypeContainer::AddDelegate): New method to add a delegate.
24198         (TypeContainer.delegates): New member to hold list of delegates.
24199
24200         * cs-parser.jay (delegate_declaration): Implement the action correctly 
24201         this time as I seem to be on crack ;-)
24202
24203 2001-09-02  Miguel de Icaza  <miguel@ximian.com>
24204
24205         * rootcontext.cs (RootContext::IsNamespace): new function, used to
24206         tell whether an identifier represents a namespace.
24207
24208         * expression.cs (NamespaceExpr): A namespace expression, used only
24209         temporarly during expression resolution.
24210         (Expression::ResolveSimpleName, ::ResolvePrimary, ::ResolveName):
24211         utility functions to resolve names on expressions.
24212
24213 2001-09-01  Miguel de Icaza  <miguel@ximian.com>
24214
24215         * codegen.cs: Add hook for StatementExpressions. 
24216
24217         * class.cs: Fix inverted test for static flag in methods.
24218
24219 2001-09-02  Ravi Pratap  <ravi@ximian.com>
24220
24221         * class.cs (Operator::CheckUnaryOperator): Correct error number used
24222         to make it coincide with MS' number.
24223         (Operator::CheckBinaryOperator): Ditto.
24224
24225         * ../errors/errors.txt : Remove error numbers added earlier.
24226
24227         * ../errors/cs1019.cs : Test case for error # 1019
24228
24229         * ../errros/cs1020.cs : Test case for error # 1020
24230
24231         * cs-parser.jay : Clean out commented cruft.
24232         (dimension_separators, dimension_separator): Comment out. Ostensibly not
24233         used anywhere - non-reducing rule.
24234         (namespace_declarations): Non-reducing rule - comment out.
24235
24236         * enum.cs (Enum::AddEnum): Rename to AddEnumMember as I was getting confused
24237         with TypeContainer::AddEnum.
24238
24239         * delegate.cs : New file for delegate handling classes.
24240         (Delegate): Class for declaring delegates.
24241
24242         * makefile : Update.
24243
24244         * cs-parser.jay (delegate_declaration): Implement.
24245
24246 2001-09-01  Ravi Pratap  <ravi@che.iitm.ac.in>
24247
24248         * class.cs (Event::Define): Implement.
24249         (Event.EventBuilder): New member.
24250
24251         * class.cs (TypeContainer::Populate): Update to define all enums and events
24252         we have.
24253         (Events): New property for the events arraylist we hold. Shouldn't we move to using
24254         readonly fields for all these cases ?
24255
24256 2001-08-31  Ravi Pratap  <ravi@che.iitm.ac.in>
24257
24258         * class.cs (Property): Revamp to use the convention of making fields readonly.
24259         Accordingly modify code elsewhere.
24260
24261         * class.cs : Apply patch from Mr. Mandar <go_mono@hotmail.com> for implementing
24262         the Define method of the Property class.
24263
24264         * class.cs : Clean up applied patch and update references to variables etc. Fix 
24265         trivial bug.
24266         (TypeContainer::Populate): Update to define all the properties we have. Also
24267         define all enumerations.
24268
24269         * enum.cs (Define): Implement.
24270
24271 2001-08-31  Ravi Pratap  <ravi@che.iitm.ac.in>
24272
24273         * cs-parser.jay (overloadable_operator): The semantic value is an
24274         enum of the Operator class.
24275         (operator_declarator): Implement actions.
24276         (operator_declaration): Implement.
24277
24278         * class.cs (Operator::CheckUnaryOperator): New static method to help in checking
24279         validity of definitions.
24280         (Operator::CheckBinaryOperator): Static method to check for binary operators
24281         (TypeContainer::AddOperator): New method to add an operator to a type.
24282
24283         * cs-parser.jay (indexer_declaration): Added line to actually call the
24284         AddIndexer method so it gets added ;-)
24285
24286         * ../errors/errors.txt : Update to include new error numbers. Are these numbers 
24287         already taken care of by the MS compiler ?  
24288
24289 2001-08-29  Ravi Pratap  <ravi@che.iitm.ac.in>
24290
24291         * class.cs (Operator): New class for operator declarations.
24292         (Operator::OpType): Enum for the various operators.
24293
24294 2001-08-29  Ravi Pratap  <ravi@che.iitm.ac.in>
24295
24296         * class.cs (TypeContainer::AddIndexer): Remove FIXME comment. We
24297         ostensibly handle this in semantic analysis.
24298
24299         * cs-parser.jay (general_catch_clause): Comment out
24300         (specific_catch_clauses, specific_catch_clause): Ditto.
24301         (opt_general_catch_clause, opt_specific_catch_clauses): Ditto
24302         (catch_args, opt_catch_args): New productions.
24303         (catch_clause): Rewrite to use the new productions above
24304         (catch_clauses): Modify accordingly.
24305         (opt_catch_clauses): New production to use in try_statement
24306         (try_statement): Revamp. Basically, we get rid of one unnecessary rule
24307         and re-write the code in the actions to extract the specific and
24308         general catch clauses by being a little smart ;-)
24309
24310         * ../tests/try.cs : Fix. It's not 'finalize' my friend, it's 'finally' !
24311         Hooray, try and catch statements parse fine !
24312
24313 2001-08-28  Ravi Pratap  <ravi@che.iitm.ac.in>
24314
24315         * statement.cs (Block::GetVariableType): Fix logic to extract the type
24316         string from the hashtable of variables.
24317
24318         * cs-parser.jay (event_accessor_declarations): Trivial fix. Man, how did
24319         I end up making that mistake ;-)
24320         (catch_clauses): Fixed gross error which made Key and Value of the 
24321         DictionaryEntry the same : $1 !!
24322
24323 2001-08-28  Ravi Pratap  <ravi@che.iitm.ac.in>
24324
24325         * cs-tokenizer.cs (initTokens): Add keywords 'add' and 'remove'
24326
24327         * cs-parser.jay (event_declaration): Correct to remove the semicolon
24328         when the add and remove accessors are specified. 
24329
24330 2001-08-28  Ravi Pratap  <ravi@che.iitm.ac.in>
24331
24332         * cs-parser.jay (IndexerDeclaration): New helper class to hold
24333         information about indexer_declarator.
24334         (indexer_declarator): Implement actions.
24335         (parsing_indexer): New local boolean used to keep track of whether
24336         we are parsing indexers or properties. This is necessary because 
24337         implicit_parameters come into picture even for the get accessor in the 
24338         case of an indexer.
24339         (get_accessor_declaration, set_accessor_declaration): Correspondingly modified.
24340
24341         * class.cs (Indexer): New class for indexer declarations.
24342         (TypeContainer::AddIndexer): New method to add an indexer to a type.
24343         (TypeContainer::indexers): New member to hold list of indexers for the
24344         type.
24345
24346 2001-08-27  Ravi Pratap  <ravi@che.iitm.ac.in>
24347
24348         * cs-parser.jay (add_accessor_declaration): Implement action.
24349         (remove_accessor_declaration): Implement action.
24350         (event_accessors_declaration): Implement
24351         (variable_declarators): swap statements for first rule - trivial.
24352
24353         * class.cs (Event): New class to hold information about event
24354         declarations.
24355         (TypeContainer::AddEvent): New method to add an event to a type
24356         (TypeContainer::events): New member to hold list of events.
24357
24358         * cs-parser.jay (event_declaration): Implement actions.
24359
24360 2001-08-27  Ravi Pratap  <ravi@che.iitm.ac.in>
24361
24362         * cs-parser.jay (dim_separators): Implement. Make it a string
24363         concatenating all the commas together, just as they appear.
24364         (opt_dim_separators): Modify accordingly
24365         (rank_specifiers): Update accordingly. Basically do the same
24366         thing - instead, collect the brackets here.
24367         (opt_rank_sepcifiers): Modify accordingly.
24368         (array_type): Modify to actually return the complete type string
24369         instead of ignoring the rank_specifiers.
24370         (expression_list): Implement to collect the expressions
24371         (variable_initializer): Implement. We make it a list of expressions
24372         essentially so that we can handle the array_initializer case neatly too.
24373         (variable_initializer_list): Implement.
24374         (array_initializer): Make it a list of variable_initializers
24375         (opt_array_initializer): Modify accordingly.
24376
24377         * expression.cs (New::NType): Add enumeration to help us
24378         keep track of whether we have an object/delegate creation
24379         or an array creation.
24380         (New:NewType, New::Rank, New::Indices, New::Initializers): New
24381         members to hold data about array creation.
24382         (New:New): Modify to update NewType
24383         (New:New): New Overloaded contructor for the array creation
24384         case.
24385
24386         * cs-parser.jay (array_creation_expression): Implement to call
24387         the overloaded New constructor.
24388
24389 2001-08-26  Ravi Pratap  <ravi@che.iitm.ac.in>
24390
24391         * class.cs (TypeContainer::Constructors): Return member
24392         constructors instead of returning null.
24393
24394 2001-08-26  Miguel de Icaza  <miguel@ximian.com>
24395
24396         * typemanager.cs (InitCoreTypes): Initialize the various core
24397         types after we have populated the type manager with the user
24398         defined types (this distinction will be important later while
24399         compiling corlib.dll)
24400
24401         * expression.cs, literal.cs, assign.cs, constant.cs: Started work
24402         on Expression Classification.  Now all expressions have a method
24403         `Resolve' and a method `Emit'.
24404
24405         * codegen.cs, cs-parser.jay: Fixed the bug that stopped code
24406         generation from working.     Also add some temporary debugging
24407         code. 
24408
24409 2001-08-24  Miguel de Icaza  <miguel@ximian.com>
24410
24411         * codegen.cs: Lots of code generation pieces.  This is only the
24412         beginning, will continue tomorrow with more touches of polish.  We
24413         handle the fundamentals of if, while, do, for, return.  Others are
24414         trickier and I need to start working on invocations soon.
24415
24416         * gen-treedump.cs: Bug fix, use s.Increment here instead of
24417         s.InitStatement. 
24418
24419         * codegen.cs (EmitContext): New struct, used during code
24420         emission to keep a context.   Most of the code generation will be
24421         here. 
24422
24423         * cs-parser.jay: Add embedded blocks to the list of statements of
24424         this block.  So code generation proceeds in a top down fashion.
24425
24426 2001-08-23  Miguel de Icaza  <miguel@ximian.com>
24427
24428         * statement.cs: Add support for multiple child blocks.
24429
24430 2001-08-22  Miguel de Icaza  <miguel@ximian.com>
24431
24432         * codegen.cs (EmitCode): New function, will emit the code for a
24433         Block of code given a TypeContainer and its ILGenerator. 
24434
24435         * statement.cs (Block): Standard public readonly optimization.
24436         (Block::Block constructors): Link children. 
24437         (Block::Child): Child Linker.
24438         (Block::EmitVariables): Emits IL variable declarations.
24439
24440         * class.cs: Drop support for MethodGroups here, delay until
24441         Semantic Analysis.
24442         (Method::): Applied the same simplification that I did before, and
24443         move from Properties to public readonly fields.
24444         (Method::ParameterTypes): Returns the parameter types for the
24445         function, and implements a cache that will be useful later when I
24446         do error checking and the semantic analysis on the methods is
24447         performed.
24448         (Constructor::GetCallingConvention): Renamed from CallingConvetion
24449         and made a method, optional argument tells whether this is a class
24450         or a structure to apply the `has-this' bit.
24451         (Method::GetCallingConvention): Implement, returns the calling
24452         convention. 
24453         (Method::Define): Defines the type, a second pass is performed
24454         later to populate the methods.
24455
24456         (Constructor::ParameterTypes): implement a cache similar to the
24457         one on Method::ParameterTypes, useful later when we do semantic
24458         analysis. 
24459
24460         (TypeContainer::EmitMethod):  New method.  Emits methods.
24461
24462         * expression.cs: Removed MethodGroup class from here.
24463
24464         * parameter.cs (Parameters::GetCallingConvention): new method.
24465
24466 2001-08-21  Miguel de Icaza  <miguel@ximian.com>
24467
24468         * class.cs (TypeContainer::Populate): Drop RootContext from the
24469         argument. 
24470
24471         (Constructor::CallingConvention): Returns the calling convention.
24472         (Constructor::ParameterTypes): Returns the constructor parameter
24473         types. 
24474
24475         (TypeContainer::AddConstructor): Keep track of default constructor
24476         and the default static constructor.
24477
24478         (Constructor::) Another class that starts using `public readonly'
24479         instead of properties. 
24480
24481         (Constructor::IsDefault): Whether this is a default constructor. 
24482
24483         (Field::) use readonly public fields instead of properties also.
24484
24485         (TypeContainer::TypeAttr, TypeContainer::AddConstructor): Keep
24486         track of static constructors;  If none is used, turn on
24487         BeforeFieldInit in the TypeAttributes. 
24488
24489         * cs-parser.jay (opt_argument_list): now the return can be null
24490         for the cases where there are no arguments. 
24491
24492         (constructor_declarator): If there is no implicit `base' or
24493         `this', then invoke the default parent constructor. 
24494
24495         * modifiers.cs (MethodAttr): New static function maps a set of
24496         modifiers flags into a MethodAttributes enum
24497         (FieldAttr): renamed from `Map'.  So now we have FieldAttr,
24498         MethodAttr, TypeAttr to represent the various mappings where the
24499         modifiers are used.
24500         (FieldAttr): Map also `readonly' to `FieldAttributes.InitOnly'  
24501
24502 2001-08-19  Miguel de Icaza  <miguel@ximian.com>
24503
24504         * parameter.cs (GetParameterInfo): Fix bug where there would be no
24505         method arguments.
24506
24507         * interface.cs (PopulateIndexer): Implemented the code generator
24508         for interface indexers.
24509
24510 2001-08-17  Miguel de Icaza  <miguel@ximian.com>
24511
24512         * interface.cs (InterfaceMemberBase): Now we track the new status
24513         here.  
24514
24515         (PopulateProperty): Implement property population.  Woohoo!  Got
24516         Methods and Properties going today. 
24517
24518         Removed all the properties for interfaces, and replaced them with
24519         `public readonly' fields. 
24520
24521 2001-08-16  Miguel de Icaza  <miguel@ximian.com>
24522
24523         * interface.cs (AddEvent, AddMethod, AddIndexer, AddProperty):
24524         initialize their hashtables/arraylists only when they are needed
24525         instead of doing this always.
24526
24527         * parameter.cs: Handle refs and out parameters.
24528
24529         * cs-parser.jay: Use an ArrayList to construct the arguments
24530         instead of the ParameterCollection, and then cast that to a
24531         Parameter[] array.
24532
24533         * parameter.cs: Drop the use of ParameterCollection and use
24534         instead arrays of Parameters.
24535
24536         (GetParameterInfo): Use the Type, not the Name when resolving
24537         types. 
24538
24539 2001-08-13  Miguel de Icaza  <miguel@ximian.com>
24540
24541         * parameter.cs: Eliminate the properties Name, Type and ModFlags,
24542         and instead use public readonly fields.
24543
24544         * class.cs: Put back walking code for type containers.
24545
24546 2001-08-11  Miguel de Icaza  <miguel@ximian.com>
24547
24548         * class.cs (MakeConstant): Code to define constants.
24549
24550         * rootcontext.cs (LookupType): New function.  Used to locate types 
24551
24552
24553 2001-08-08  Miguel de Icaza  <miguel@ximian.com>
24554
24555         * rootcontext.cs: OH MY!  My trick works!   It is amazing how nice
24556         this System.Reflection code is.  Kudos to Microsoft
24557
24558         * typemanager.cs: Implement a type cache and avoid loading all
24559         types at boot time.  Wrap in LookupType the internals.  This made
24560         the compiler so much faster.  Wow.  I rule!
24561
24562         * driver.cs: Make sure we always load mscorlib first (for
24563         debugging purposes, nothing really important).
24564
24565         * Renamespaced things that were on `CSC' to `CIR'.  Maybe I should
24566         have moved to `CSC' rather than `CIR'.  Oh man!  The confussion!  
24567
24568         * rootcontext.cs: Lookup types on their namespace;  Lookup types
24569         on namespaces that have been imported using the `using' keyword.
24570
24571         * class.cs (TypeContainer::TypeAttr): Virtualize.
24572         (Class::TypeAttr): Return attributes suitable for this bad boy.
24573         (Struct::TypeAttr): ditto.
24574         Handle nested classes.
24575         (TypeContainer::) Remove all the type visiting code, it is now
24576         replaced with the rootcontext.cs code
24577
24578         * rootcontext.cs (GetClassBases): Added support for structs. 
24579
24580 2001-08-06  Miguel de Icaza  <miguel@ximian.com>
24581
24582         * interface.cs, statement.cs, class.cs, parameter.cs,
24583         rootcontext.cs, gen-treedump.cs, enum.cs, cs-parse.jay:
24584         Drop use of TypeRefs, and use strings instead.
24585
24586 2001-08-04  Miguel de Icaza  <miguel@ximian.com>
24587
24588         * rootcontext.cs: 
24589
24590         * class.cs (Struct::Struct): set the SEALED flags after
24591         checking the modifiers.
24592         (TypeContainer::TypeAttr): new property, returns the
24593         TypeAttributes for a class.  
24594
24595         * cs-parser.jay (type_list): Oops, list production was creating a
24596         new list of base types.
24597
24598         * rootcontext.cs (StdLib): New property.
24599         (GetInterfaceTypeByName): returns an interface by type name, and
24600         encapsulates error handling here.
24601         (GetInterfaces): simplified.
24602         (ResolveTree): Encapsulated all the tree resolution here.
24603         (CreateClass, GetClassBases, GetInterfaceOrClass): Create class
24604         types. 
24605
24606         * driver.cs: Add support for --nostdlib, to avoid loading the
24607         default assemblies.
24608         (Main): Do not put tree resolution here. 
24609
24610         * rootcontext.cs: Beginning of the class resolution.
24611
24612 2001-08-03  Miguel de Icaza  <miguel@ximian.com>
24613
24614         * rootcontext.cs: Provide better error reporting. 
24615
24616         * cs-parser.jay (interface_base): set our $$ to be interfaces.
24617
24618         * rootcontext.cs (CreateInterface): Handle the case where there
24619         are no parent interfaces.
24620
24621         (CloseTypes): Routine to flush types at the end.
24622         (CreateInterface): Track types.
24623         (GetInterfaces): Returns an array of Types from the list of
24624         defined interfaces.
24625
24626         * typemanager.c (AddUserType): Mechanism to track user types (puts
24627         the type on the global type hash, and allows us to close it at the
24628         end). 
24629
24630 2001-08-02  Miguel de Icaza  <miguel@ximian.com>
24631
24632         * tree.cs: Removed RecordType, added RecordClass, RecordStruct and
24633         RecordInterface instead.
24634
24635         * cs-parser.jay: Updated to reflect changes above.
24636
24637         * decl.cs (Definition): Keep track of the TypeBuilder type that
24638         represents this type here.  Not sure we will use it in the long
24639         run, but wont hurt for now.
24640
24641         * driver.cs: Smaller changes to accomodate the new code.
24642
24643         Call ResolveInterfaceBases, Call ResolveClassBases, Save assembly
24644         when done. 
24645
24646         * rootcontext.cs (CreateInterface):  New method, used to create
24647         the System.TypeBuilder type for interfaces.
24648         (ResolveInterfaces): new entry point to resolve the interface
24649         hierarchy. 
24650         (CodeGen): Property, used to keep track of the code generator.
24651
24652 2001-07-26  Miguel de Icaza  <miguel@ximian.com>
24653
24654         * cs-parser.jay: Add a second production for delegate_declaration
24655         with `VOID'.
24656
24657         (enum_body): Put an opt_comma here instead of putting it on
24658         enum_body or enum_member_declarations so we can handle trailing
24659         commas on enumeration members.  Gets rid of a shift/reduce.
24660
24661         (type_list): Need a COMMA in the middle.
24662
24663         (indexer_declaration): Tell tokenizer to recognize get/set
24664
24665         * Remove old targets.
24666
24667         * Re-add the parser target.
24668
24669 2001-07-13  Simon Cozens <simon@simon-cozens.org>
24670
24671         * cs-parser.jay: Add precendence rules for a number of operators
24672         ot reduce the number of shift/reduce conflicts in the grammar.
24673
24674 2001-07-17  Miguel de Icaza  <miguel@ximian.com>
24675
24676         * tree.cs: moved IGenerator interface and renamed it to ITreeDump
24677         and put it here.
24678
24679         Get rid of old crufty code.
24680
24681         * rootcontext.cs: Use this to keep track of the parsed
24682         representation and the defined types available to the program. 
24683
24684         * gen-treedump.cs: adjust for new convention.
24685
24686         * type.cs: Split out the type manager, and the assembly builder
24687         from here. 
24688
24689         * typemanager.cs: the type manager will live here now.
24690
24691         * cil-codegen.cs: And the code generator here. 
24692
24693 2001-07-14  Sean MacIsaac  <macisaac@ximian.com>
24694
24695         * makefile: Fixed up for easy making.
24696
24697 2001-07-13  Simon Cozens <simon@simon-cozens.org>
24698
24699         * cs-parser.jay (rank_specifier): Remove a conflict by reordering
24700         the 
24701
24702         (unary_expression): Expand pre_increment_expression and
24703         post_decrement_expression to reduce a shift/reduce.
24704
24705 2001-07-11  Simon Cozens
24706
24707         * cs-tokenizer.cs: Hex numbers should begin with a 0.
24708
24709         Improve allow_keyword_as_indent name.
24710
24711 2001-06-19  Miguel de Icaza  <miguel@ximian.com>
24712
24713         * Adjustments for Beta2. 
24714
24715 2001-06-13  Miguel de Icaza  <miguel@ximian.com>
24716
24717         * decl.cs: Added `Define' abstract method.
24718         (InTransit): new property, used to catch recursive definitions. 
24719
24720         * interface.cs: Implement `Define'. 
24721
24722         * modifiers.cs: Map Modifiers.constants to
24723         System.Reflection.TypeAttribute flags.
24724
24725         * class.cs: Keep track of types and user-defined types.
24726         (BuilderInit): New method for creating an assembly
24727         (ResolveType): New function to launch the resolution process, only
24728         used by interfaces for now.
24729
24730         * cs-parser.jay: Keep track of Classes, Structs and Interfaces
24731         that are inserted into the name space. 
24732
24733 2001-06-08  Miguel de Icaza  <miguel@ximian.com>
24734
24735         * ARGH.  I have screwed up my tree so many times due to the use of
24736         rsync rather than using CVS.  Going to fix this at once. 
24737
24738         * driver.cs: Objetify driver.  Load assemblies, use assemblies to
24739         load types.
24740
24741 2001-06-07  Miguel de Icaza  <miguel@ximian.com>
24742
24743         * Experiment successful: Use System.Type rather that our own
24744         version of Type.  
24745
24746 2001-05-25  Miguel de Icaza  <miguel@ximian.com>
24747
24748         * cs-parser.jay: Removed nsAliases from here.
24749
24750         Use new namespaces, handle `using XXX;' 
24751
24752         * namespace.cs: Reimplemented namespace handling, use a recursive
24753         definition of the class.  Now we can keep track of using clauses
24754         and catch invalid using clauses.
24755
24756 2001-05-24  Miguel de Icaza  <miguel@ximian.com>
24757
24758         * gen-treedump.cs: Adapted for all the renaming.
24759
24760         * expression.cs (Expression): this class now has a Type property
24761         which returns an expression Type.
24762
24763         (Probe::, New::, TypeOf::, SizeOf::, Constant::): renamed from
24764         `Type', as this has a different meaning now in the base
24765
24766 2001-05-22  Miguel de Icaza  <miguel@ximian.com>
24767
24768         * interface.cs, class.cs: Removed from all the sources the
24769         references to signature computation, as we can not do method
24770         signature computation during the parsing time, as we are not
24771         trying to solve at that point distinguishing:
24772
24773         class X {
24774                 void a (Blah x) {}
24775                 void a (NS.Blah x) {}
24776         }
24777
24778         Which depending on the context might be valid or not, as we do not
24779         know if Blah is the same thing as NS.Blah at that point.
24780
24781         * Redid everything so the code uses TypeRefs now instead of
24782         Types.  TypeRefs are just temporary type placeholders, that need
24783         to be resolved.  They initially have a pointer to a string and the
24784         current scope in which they are used.  This is used later by the
24785         compiler to resolve the reference to an actual Type. 
24786
24787         * DeclSpace is no longer a CIR.Type, and neither are
24788         TypeContainers (Class and Struct) nor Interfaces nor Enums.  They
24789         are all DeclSpaces, but no Types. 
24790
24791         * type.cs (TypeRefManager): This implements the TypeRef manager,
24792         which keeps track of all the types that need to be resolved after
24793         the parsing has finished. 
24794
24795 2001-05-13  Miguel de Icaza  <miguel@ximian.com>
24796
24797         * ARGH.  We are going to have to store `foreach' as a class rather
24798         than resolving it, as we need to verify error 1579 after name
24799         resolution.   *OR* we could keep a flag that says `This request to
24800         IEnumerator comes from a foreach statement' which we can then use
24801         to generate the error.
24802
24803 2001-05-10  Miguel de Icaza  <miguel@ximian.com>
24804
24805         * class.cs (TypeContainer.AddMethod): we now add methods to the
24806         MethodGroup instead of the method hashtable.  
24807
24808         * expression.cs: Add MethodGroup abstraction, which gets us one
24809         step closer to the specification in the way we handle method
24810         declarations.  
24811
24812         * cs-parser.jay (primary_expression): qualified_identifier now
24813         tried to match up an identifier to a local variable reference or
24814         to a parameter reference.
24815
24816         current_local_parameters is now a parser global variable that
24817         points to the current parameters for the block, used during name
24818         lookup.
24819
24820         (property_declaration): Now creates an implicit `value' argument to
24821         the set accessor.
24822
24823 2001-05-09  Miguel de Icaza  <miguel@ximian.com>
24824
24825         * parameter.cs: Do not use `param' arguments as part of the
24826         signature, per the spec.
24827
24828 2001-05-08  Miguel de Icaza  <miguel@ximian.com>
24829
24830         * decl.cs: Base class for classes, structs and interfaces.  This
24831         is the "Declaration Space" 
24832
24833         * cs-parser.jay: Use CheckDef for checking declaration errors
24834         instead of having one on each function.
24835
24836         * class.cs: Factor out some code for handling error handling in
24837         accordance to the "Declarations" section in the "Basic Concepts"
24838         chapter in the ECMA C# spec.
24839
24840         * interface.cs: Make all interface member classes derive from
24841         InterfaceMemberBase.
24842
24843 2001-05-07  Miguel de Icaza  <miguel@ximian.com>
24844
24845         * Many things: all interfaces are parsed and generated in
24846         gen-treedump.  Support for member variables, constructors,
24847         destructors, properties, constants is there.
24848
24849         Beginning of the IL backend, but very little done, just there for
24850         testing purposes. 
24851
24852 2001-04-29  Miguel de Icaza  <miguel@ximian.com>
24853
24854         * cs-parser.jay: Fix labeled statement.
24855
24856         * cs-tokenizer.cs (escape): Escape " and ' always.
24857         ref_line, ref_name: keep track of the line/filename as instructed
24858         by #line by the compiler.
24859         Parse #line.
24860
24861 2001-04-27  Miguel de Icaza  <miguel@ximian.com>
24862
24863         * System.CodeDOM/CodeBinaryOperatorExpression.cs: Rearrange enum
24864         to match the values in System.CodeDOM.
24865
24866         Divid renamed to Divide.
24867
24868         * System.CodeDOM/CodeForLoopStatement.cs: Always have valid
24869         statements. 
24870         (Statements.set): remove.
24871
24872         * System.CodeDOM/CodeCatchClause.cs: always have a valid
24873         statements. 
24874
24875         * System.CodeDOM/CodeIfStatement.cs: trueStatements and
24876         falseStatements always have valid values. 
24877
24878         * cs-parser.jay: Use System.CodeDOM now.
24879