2006-03-07 Martin Baulig <martin@ximian.com>
[mono.git] / mcs / gmcs / ChangeLog
1 2006-03-07  Martin Baulig  <martin@ximian.com>
2
3         * generic.cs (TypeManager.InferType): Allow infering
4         `IEnumerable<T>' with an array of T; see gtest-251.cs.
5
6 2006-03-06  Martin Baulig  <martin@ximian.com>
7
8         * generic.cs
9         (TypeManager.InferType): Fix gtest-250.cs.
10
11         * typemanager.cs
12         (TypeManager.IsSubclassOf): Also check the base class.
13
14         * expression.cs
15         (Invocation.IsAncestralType): Use TypeManager.IsSubclassOf();
16         fixes gtest-249.cs.
17
18 2006-03-01  Raja R Harinath  <rharinath@novell.com>
19
20         Fix #77679.
21         * expression.cs (ParameterReference.DoResolveBase): Change return
22         type to bool.
23         (ParameterReference.DoResolve, ParameterReference.DoResolveLValue):
24         Update.
25
26         Fix #77628.
27         * ecore.cs (PropertyExpr.InstanceResolve): Fix CS1540 check.
28
29         Fix #77642.
30         * typemanager.cs (GetFullNameSignature): Don't nullref on
31         protected accessors.
32
33 2006-02-16  Martin Baulig  <martin@ximian.com>
34
35         * generic.cs
36         (TypeManager.GetGenericFieldDefinition): New public method; use it
37         instead of the `FieldInfo.Mono_GetGenericFieldDefinition()' icall.
38
39 2006-02-14  Martin Baulig  <martin@ximian.com>
40
41         * *.cs: Use `Type.IsGenericType' instead of `Type.IsGenericInstance'.
42
43 2006-02-14  Martin Baulig  <martin@ximian.com>
44
45         * generic.cs
46         (TypeManager.DropGenericMethodArguments): New public method; don't
47         use GetGenericMethodDefinition() on something which is not a
48         generic method.
49
50 2006-02-14  Martin Baulig  <martin@ximian.com>
51
52         * generic.cs
53         (ConstraintChecker.CheckConstraints): If a type parameter has the
54         `struct' constraint, the type must be a non-nullable valuetype.
55
56 2006-02-10  Martin Baulig  <martin@ximian.com>
57
58         * typemanager.cs
59         (TypeManager.IsOverride): Make this work for instantiated methods
60         in a generic class; fixes #77509.
61         (TypeManager.ExpandInterfaces): Use TypeManager.GetInterfaces()
62         rather than calling it directly; fixes #77488.  
63
64 2006-02-08  Martin Baulig  <martin@ximian.com>
65
66         * generic.cs (ConstraintChecker.CheckConstraints): Move the error
67         reporting into CheckConstraint() so we can use the correctly
68         instantiated type.
69
70 2006-02-08  Martin Baulig  <martin@ximian.com>
71
72         * expression.cs (BaseAccess): Add support for generic methods.
73
74         * ecore.cs (MethodGroupExpr.ResolveGeneric): Propagate `IsBase' to
75         the new MethodGroupExpr.
76
77 2006-02-07  Martin Baulig  <martin@ximian.com>
78
79         * generic.cs (ConstraintChecker.CheckConstraints): Interfaces are
80         also reference types; fixes #77483.
81
82 2006-02-07  Martin Baulig  <martin@ximian.com>
83
84         * generic.cs
85         (TypeManager.IsGenericMethod): We now return whether something is
86         an instantiated generic method (and not a generic method def).
87         (TypeManager.IsGenericMethodDefinition): New public method.
88
89         * typemanager.cs
90         (TypeManager.CSharpSignature): Only include type arguments for
91         "real" generic methods, not for any instantiated method.
92         (TypeManager.GetMethodName): Likewise, but also allow generic
93         method definitions here.
94
95 2006-02-06  Miguel de Icaza  <miguel@novell.com>
96
97         * codegen.cs (EmitScopeInitFromBlock): check here the
98         capture_context, there is no need to make two calls to the
99         EmitContext. 
100
101         * anonymous.cs: Add some debugging messages that might help me
102         track other instances of this problem in the future (the
103         regression of test 467).
104
105         * cs-parser.jay: track the variable block, as we need to initalize
106         any captured variables declared in this block for the "catch"
107         portion of the "Try" statement.
108
109         * statement.cs (Try.Emit): If the "Catch" has a VarBlock, emit any
110         scope initialization for captured variables. 
111
112         Also, move the emit for the variables after the block location has
113         been marked.
114
115 2006-02-06  Marek Safar  <marek.safar@seznam.cz>
116
117        * ecore.cs (PropertyExpr.FindAccessors): Just made flags const.
118         
119 2006-02-06  Martin Baulig  <martin@ximian.com>
120
121         * class.cs (TypeContainer.DefineType): If we're a struct, pass
122         `TypeManager.value_type' as parent type to
123         ModuleBuilder.DefineType().  Fixes #77358.      
124
125 2006-02-02  Miguel de Icaza  <miguel@novell.com>
126
127         * anonymous.cs (CaptureContext.EmitInitScope): I was wrong in the
128         commit yesterday, the initialization for the roots is necessary.
129         What is not necessary is the scope activation.
130
131 2006-02-02  Raja R Harinath  <rharinath@novell.com>
132
133         * ecore.cs (PropertyExpr.DoResolveLValue): Add CS0206 check.
134         * expression.cs (IndexerAccess.DoResolveLValue): Add CS1612 and
135         CS0206 checks.
136         (Argument.Resolve): Remove CS0206 checks.
137
138 2006-02-01  Miguel de Icaza  <miguel@novell.com>
139
140         * anonymous.cs (CaptureContext.EmitInitScope): Do not emit the
141         scopes for all the roots, the scopes will now be emitted when the
142         Blocks are entered. [This change was wrong, fixed on 2006-02-02]
143
144         (CaptureContext.EmitScopeInitFromBlock): Simply emit the ScopeInfo
145         code.  This reduces a lot of existing cruft.
146         
147         * statement.cs (Block.Emit): Call EmitScopeInitFromBlock here, so
148         that the ScopeInfo is generated as we enter the scope, not at the
149         time of use, which is what we used to do before.
150
151         * codegen.cs (EmitScopeInitFromBlock): New routine, this is called
152         every time a Block is about to be emitted if we have a
153         CaptureContext. 
154
155 2006-02-01  Raja R Harinath  <rharinath@novell.com>
156
157         * codegen.cs (AssemblyClass.Emit): Emit RuntimeCompatibility
158         attribute for mscorlib too.
159
160         * typemanager.cs (NoTypes, NoTypeExprs): Remove.
161         (Reset): Update.
162         * *.cs: Use Type.EmptyTypes instead of TypeManager.NoTypes.
163
164         * typemanager.cs (cons_param_array_attribute): Make private.
165         (Reset): Set it to null.
166         (InitCoreHelpers): Don't initialize it.
167         (ConsParamArrayAttribute): New.  Initialize it as needed.
168         * parameter.cs (ParamsParameter.ApplyAttribute): Update to change.
169
170 2006-01-31  Miguel de Icaza  <miguel@novell.com>
171
172         * expression.cs: There might be errors reported during the
173         selection of applicable methods.  If there are errors, do not
174         continue execution as it will lead the compiler to crash.
175
176 2006-01-30  Miguel de Icaza  <miguel@novell.com>
177
178         * expression.cs: Member access is not allowed on anonymous
179         methods.  Fixes #77402.
180
181 2006-01-30  Raja R Harinath  <rharinath@novell.com>
182
183         Fix #77401
184         * cs-parser.jay (VariableDeclaration): Don't set
185         current_array_type to null.
186         (field_declaration, event_declaration, declaration_statement):
187         Set it to null here.
188
189 2006-01-29  Raja R Harinath  <harinath@gmail.com>
190
191         Fix part of #77397
192         * generic.cs (TypeManager.IsEqual): Handle pass-by-ref types.
193
194 2006-01-28  Raja R Harinath  <harinath@gmail.com>
195
196         * typemanager.cs (GenericParameterPosition): New.
197         * doc.cs: Use it.
198
199 2006-01-28  Atsushi Enomoto  <atsushi@ximian.com>
200
201         * doc.cs : To process "include" elements, first we should create
202           another list than XmlNodeList, because it could result in node
203           removal, which could result in that the XmlNodeList gives up
204           yielding next node.
205
206 2006-01-25  Miguel de Icaza  <miguel@novell.com>
207
208         * expression.cs: Introduce an error report that we were not
209         catching before.   Gonzalo ran into it.
210
211 2006-01-23  Miguel de Icaza  <miguel@novell.com>
212
213         A fix for bug: #76957
214         
215         * iterators.cs (MoveNextMethod.CreateMethodHost): call
216         ComputeMethodHost before creating the method, this is a new
217         requirement. 
218
219         * anonymous.cs (AnonymousContainer): Now we track all the scopes
220         that this method references (RegisterScope).  The actual scope
221         where the method is hosted is computed with the ComputeMethodHost
222         before we create the method.
223
224         Moved the Deepest routine here.
225
226         (AnonymousContainer.ComputeMethodHost): New routine used to
227         compute the proper ScopeInfo that will host the anonymous method.
228
229         (ScopeInfo): Deal with multiple roots.  The problem was that we
230         did not have a unique root where all ScopeInfos could be hanged
231         from.   Remove `topmost' ScopeInfo, and instead keep an arraylist
232         of roots.  
233
234         Remove AdjustMethodScope which is now computed at the end.  Remove
235         LinkScope which did a partial link, instead link all ScopeInfos
236         before code generation from the new "LinkScopes" routine. 
237
238         Simplify all the Add* routines as they no longer need to maintain
239         the tree, they just need to record that they are using variables
240         from a ScopeInfo.
241
242         (IsAncestor, GetAncestorScopes, GetParentScope, LinkScope): New
243         routines to produce the forest of ScopeInfo trees.
244
245         * class.cs (TypeContainer.AppendMethod): This is just like
246         AddMethod, but ensures that an interface implementation method
247         (IEnumerable.XXX) is not inserted at the beginning of the queue of
248         methods, but at the end.
249
250         We use this functionality to ensure that the generated MoveNext
251         method in the iterator class is resolved/emitted before the
252         enumerator methods created.   
253
254         This is required because the MoveNext method computes the right
255         ScopeInfo for the method.  And the other methods will eventually
256         need to resolve and fetch information computed from the anonymous
257         method. 
258
259         
260 2006-01-23  Raja R Harinath  <rharinath@novell.com>
261
262         Improve implementation of section 14.4.2.2 (Better function member).
263         * expression.cs (Invocation.MoreSpecific): Compare all type
264         arguments before deciding if one type is more specific than
265         another.  Handle array types too.  Return the more specific type.
266         (Invocation.BetterFunction): Add more tie-breaking rules from
267         section 14.4.2.2.  Perform "more specific" check after
268         other tie-breaking rules.  Compare all parameter types before
269         choosing the "more specific" method.
270
271 2006-01-21  Raja R Harinath  <harinath@gmail.com>
272             Carlos Alberto Cortez  <calberto.cortez@gmail.com>
273
274         Fix rest of #76995.
275         * namespace.cs (NamespaceEntry.UsingExternalAliases): Don't add to
276         the 'aliases' hash.
277         (NamespaceEntry.LookupAlias): Lookup 'extern_aliases' hash too.
278         (NamespaceEntry.VerifyUsing): Resolve external aliases too.
279
280 2006-01-18  Martin Baulig  <martin@ximian.com>
281
282         * class.cs (TypeContainer.AddToMemberContainer): Use
283         `symbol.MemberName.MethodName' instead of just `symbol.Name';
284         fixes #77124.
285
286 2006-01-18  Martin Baulig  <martin@ximian.com>
287
288         Fix #76417: a generic class may now have methods which may unify
289         for some type parameter substitutions.
290
291         * class.cs (Method.IsDuplicateImplementation): Don't report CS0408
292         for methods which may unify anymore.
293
294         * expression.cs (Invocation.MoreSpecific): New private static
295         method; checks whether one method is more specific than another
296         according to 14.4.2.2 of the spec.
297         (Invocation.BetterFunction): Implement the tie-breaking rules from
298         14.4.2.2 of the spec: if two methods unify for some type parameter
299         substitution, we need to pick the more specific one.
300
301 2006-01-18  Raja R Harinath  <rharinath@novell.com>
302
303         Fix #76656, cs0231-2.cs.
304         * cs-parser.jay (formal_parameter_list): Make error case catch
305         more issues.
306         (parenthesized_expression_0): Add CS1026 check.
307         (invocation_expression): Remove unused { $$ = lexer.Location }.
308
309 2006-01-17  Raja R Harinath  <rharinath@novell.com>
310
311         Fix #76824.
312         * cs-parser.jay (statement_expression): Don't list out the
313         individual statement-expressions.  Convert syntax error into
314         CS0201 check.
315
316 2006-01-16  Raja R Harinath  <rharinath@novell.com>
317
318         Fix #76874.
319         * ecore.cs (MemberAccess.CheckIntermediateModification): Remove.
320         (UnboxCast.DoResolveLValue): New.  Move CS0445 check from
321         CheckIntermediateModification.
322         (FieldExpr.DoResolve): Add new two-argument version that
323         allows us to resolve the InstanceExpression as an lvalue.
324         The one-argument variant is now just a wrapper.
325         (FieldExpr.DoResolveLValue): Use two-argument DoResolve.
326         Resolve the lhs as an lvalue if the it has a value type.
327         (FieldExpr.AssignToReadonly): Move CS1648 and CS1650 checks
328         from Assign.DoResolve.
329         (PropertyExpr.InstanceResolve): Allow InstanceExpression to be
330         resolved as an lvalue.
331         (PropertyExpr.DoResolve): Update.
332         (PropertyExpr.DoResolveLValue): Resolve the lhs as an lvalue if it
333         has a value type.  Move CS1612 check here from
334         CheckIntermediateModification.
335         * assign.cs (Assign.DoResolve): Remove CS1648 and CS1650 checks.
336         * expression.cs (EmptyExpression.OutAccess): New.  Used as the
337         'right_side' of a ResolveLValue on an 'out' argument.
338         (EmptyExpression.LValueMemberAccess): New.  Used as the
339         'right_side' of a propagated ResolveLValue on a value type.
340         (LocalVariableReference.DoResolveBase): Recognize
341         EmptyExpression.OutAccess and EmptyExpression.LValueMemberAccess.
342         Add CS1654 check.
343         (Argument.Resolve): Use EmptyExpression.OutAccess rather than
344         EmptyExpression.Null.
345
346 2006-01-16  Atsushi Enomoto  <atsushi@ximian.com>
347
348         * typemanager.cs : added IsGenericParameter(). In gmcs it returns
349           Type.IsGenericParameter(). Fixed bug #77183.
350         * doc.cs : it is now identical to doc.cs in mcs.
351
352 2006-01-16  Martin Baulig  <martin@ximian.com>
353
354         * generic.cs (ConstraintChecker.CheckConstraint): Fix #77167.
355
356 2006-01-16  Martin Baulig  <martin@ximian.com>
357
358         * typemanager.cs (TypeManager.CSharpSignature): Make this work for
359         ctors; fixes #77250.
360
361 2006-01-12  Miguel de Icaza  <miguel@novell.com>
362
363         This fixes the problem where we used ldfld instead of ldflda to
364         load the "THIS" pointer on captured parameters, when THIS is a
365         value type.  See bug #77205.
366         
367         * iterators.cs (CapturedThisReference.Emit): Pass false to
368         EmitThis (we do not need the address).
369
370         * codegen.cs (EmitThis): it needs to know whether we need the
371         address of `this' or not.  This is used by value types.  
372
373         * expression.cs (This.AddressOf): Pass true to the EmitThis call,
374         every other call passes false.
375
376 2006-01-12  Raja R Harinath  <rharinath@novell.com>
377
378         Fix #77221.
379         * typemanager.cs (TryGetBaseDefinition): Rename from the mis-named
380         GetOverride.
381         * expression.cs (Invocation.OverloadResolve): Update.
382         (Invocation.DoResolve): Avoid double resolution of invocation.
383
384 2006-01-11  Raja R Harinath  <rharinath@novell.com>
385
386         Fix #77180.
387         * expression.cs (Unary.Emit): When in /checked+ mode, don't emit
388         unary negation of floating point types as 0-expr; negation cannot
389         overflow in floating point types.
390
391         Fix #77204.
392         * expression.cs (MemberAccess.DoResolve): Disallow the use of '.'
393         on operands of 'void' type.
394
395         Fix #77200.
396         * cfold.cs (BinaryFold): Implement folding of BinaryOr, BinaryAnd
397         and ExclusiveOr for boolean constants too.
398
399 2006-01-12  Ben Maurer  <bmaurer@andrew.cmu.edu>
400
401         * expression.cs: Fix Console.WriteLine ((this = x).foo);
402
403 2006-01-12  Miguel de Icaza  <miguel@novell.com>
404
405         * cs-tokenizer.cs (Position): New class used to save and restore
406         the position state in the tokenizer.  Before this patch the save
407         and restore was not complete enough so the line and columns would
408         start to drift and the debugger and stack traces will get the
409         wrong data.
410
411 2006-01-10  Martin Baulig  <martin@ximian.com>
412
413         * generic.cs
414         (TypeParameter.InflateConstraints): New public method.
415
416         * iterators.cs (Iterator.DefineNestedTypes): Also inflate the
417         constraints; fixes #77042.
418
419 2006-01-10  Martin Baulig  <martin@ximian.com>
420
421         * anonymous.cs (ScopeInfo.EmitScopeType): Use the `CurrentType'
422         instead of the `TypeBuilder' for this "<>THIS" variable; fixes
423         #77061. 
424
425 2006-01-09  Raja R Harinath  <rharinath@novell.com>
426
427         Fix #75636.
428         * expression.cs (Invocation.OverloadResolve): Replace reflected
429         override methods with their base virtual methods, rather than
430         skipping over them.
431         * typemanager.cs (TypeManager.GetOverride): New.
432
433 2005-12-21  Miguel de Icaza  <miguel@novell.com>
434
435         * driver.cs: Report the case of no source files and no -out:
436         argument provided.
437
438 2005-12-20  Raja R Harinath  <rharinath@novell.com>
439
440         Fix #77035.
441         * expression.cs (ComposedCast.GetSignatureForError): Define.
442
443 2006-01-05  Jb Evain  <jbevain@gmail.com>
444
445         * class.cs (Property.Define, Indexer.Define): do not tag the
446         properties as SpecialName | RTSpecialName.
447
448 2006-01-04  Miguel de Icaza  <miguel@novell.com>
449
450         * class.cs (MethodCore.IsDuplicateImplementation): This method was
451         doing a low-level comparission of parameter types.  It was lacking
452         a check for __argslist. 
453
454 2005-12-30  Miguel de Icaza  <miguel@novell.com>
455
456         * expression.cs (ParameterReference.DoResolveBase): Allow
457         reference parameters if they are local to this block. 
458
459         This allows the ref and out parameters of a delegate to be used in
460         an anonymous method, for example:
461
462         delegate void set (out int x);
463
464         set s = delegate (out int x){
465                 x = 0;
466         };
467
468         This is used by functionality introduced late in the C# language.
469         
470         * anonymous.cs (AnonymousMethod.Compatible): Allow anonymous
471         method that take ref and out parameters. 
472
473         Fixes #77119 which was a late change in the spec.
474
475 2005-12-23  Miguel de Icaza  <miguel@novell.com>
476
477         * anonymous.cs (ScopeInfo.LinkScope): Do not link the scope to its
478         parent if its the same scope.  Fixes #77060.
479
480 2005-12-22  Marek Safar  <marek.safar@seznam.cz>
481
482         * expression.cs (ComposedCast.DoResolveAsTypeStep): Fixed wrong merge.
483
484 2005-12-21  Carlos Alberto Cortez <calberto.cortez@gmail.com>
485
486         * codegen.cs (AssemblyClass.CheckInternalsVisibleAttribute): Generate
487         errors 1726 for strong named assemblies with InternalsVisibleToAttribute 
488         that doesn't contain the full public key. This is a update of the
489         friend assemblies in .Net 2.0 release.
490         
491 2005-12-18 Carlos Alberto Cortez <calberto.cortez@gmail.com>
492
493         Fix #76995
494
495         * namespace.cs (NamespaceEntry): Add extern_aliases as a
496         ListDictionary, to contain the ExternAliasEntry entries (in
497         addition to the NamespaceEntry.aliases hashtable). This field is
498         shared between the original entry and its doppelganger (bodyless 
499         copy of it).
500         (NamespaceEntry.UsingExternalAlias): Add the extern alias entry to
501         extern_aliases field.
502         (NamespaceEntry.Lookup): Move the IsImplicit check after the
503         lookup in extern_aliases.
504
505 2005-12-16  Raja R Harinath  <rharinath@novell.com>
506
507         Fix #77006.
508         * class.cs (TypeContainer.Mark_HasEquals): New.
509         (TypeContainer.Mark_HasGetHashCode): New.
510         (ClassPart): Override them.
511         (MethodCore.CheckBase): Use them instead of referring to Parent.Methods.
512
513         * generic.cs (GenericMethod.DefineMembers): Update to changes.
514         (TypeParameter.TypeParameter): Change type of 'parent' argument to
515         DeclSpace.
516
517         Fix #77008.
518         * enum.cs (EnumMember.EnumMember): Pass the parent_enum as the
519         'parent' argument to the base constructor.
520
521         Remove all mention of TypeContainer from decl.cs.
522         * decl.cs (MemberCore.Parent): Change into a DeclSpace.
523         (MemberCore.MemberCore): Change type of 'parent' argument to DeclSpace.
524         (DeclSpace.DeclSpace): Likewise.
525         (DeclSpace.DefineMembers): Remove unused argument.
526         * cs-parser.jay (pop_current_class): Update to changes.  Simplify
527         debugging check -- we don't care if the debug code throws an
528         InvalidCastException instead of an InternalErrorException.
529         * class.cs (TypeContainer.DefineMembers): Update to changes.
530         (TypeContainer.DoDefineMembers): Likewise.
531         (TypeContainer.GetMethods): Likewise.
532         (PropertyMember.Define): Likewise.
533         (MemberBase.Parent): New property that forwards to
534         MemberCore.Parent, but ensures that we get a TypeContainer.
535         * rootcontext.cs (RootContext.PopulateCoreType): Update to changes.
536         (RootContext.PopulateTypes): Likewise.  Remove special case code
537         for !RootContext.StdLib: DefineMembers is idempotent.
538
539 2005-12-13  Marek Safar  <marek.safar@seznam.cz>
540
541         * class.cs (Method.ApplyAttributeBuilder): Test out modifier properly.
542
543 2005-12-11  Atsushi Enomoto  <atsushi@ximian.com>
544
545         * doc.cs : The search for referenced namespace was insufficient to
546           get global one as it used to do. Fixed bug #76965.
547
548 2005-12-10  Atsushi Enomoto  <atsushi@ximian.com>
549
550         * doc.cs : check name in cref in the last phase that whether it is
551           namespace or not.
552
553 2005-12-09  Atsushi Enomoto  <atsushi@ximian.com>
554
555         * cs-tokenizer.cs : reverted the latest change: it somehow broke
556           Mono.C5.
557
558 2005-12-09  Atsushi Enomoto  <atsushi@ximian.com>
559
560         * doc.cs : so it turned out that we cannot skip override check for 
561           interface members. Fixed bug #76954.
562
563 2005-12-09  Atsushi Enomoto  <atsushi@ximian.com>
564
565         * cs-tokenizer.cs : fixed bug #75984:
566           - #warning and #error should not be handled when the source line
567             is disabled.
568           - #line is not checked strictly when the source line is disabled.
569           - #define and #undef is on the other hand checked strictly at any
570             state.
571
572 2005-12-08  Atsushi Enomoto  <atsushi@ximian.com>
573
574         * cs-tokenizer.cs : missing Location (actually, filename) in one of
575           CS1027 report.
576
577 2005-12-15  Raja R Harinath  <rharinath@novell.com>
578
579         * generic.cs (TypeManager.IsGeneric): Remove unused method.
580
581         * typemanager.cs (TypeManager.GetFullName): Rewrite to handle
582         nested types.
583
584 2005-12-14  Martin Baulig  <martin@ximian.com>
585
586         * typemanager.cs (TypeManager.GetFullName): Make this public;
587         `Type.Fullname' now never returns null.
588
589         * class.cs (Method.Define): Use TypeManager.GetFullName() for
590         explicit interface implementations; we're now using the same
591         naming convention than csc does.
592
593 2005-12-14  Miguel de Icaza  <miguel@novell.com>
594
595         * convert.cs (ExplicitConversionCore): Check the return value from
596         ExplicitConversionCore which can return null on failure.  Fixes #76914
597
598 2005-12-09  Raja R Harinath  <rharinath@novell.com>
599
600         * anonymous.cs (AnonymousMethod.Compatible): Use IsGenericType
601         instead of IsGenericInstance.
602         * generic.cs (TypeManager.IsEqual): Likewise.  Delete redundant
603         code that's now covered by the more general test.
604         * typemanager.cs (TypeManager.IsPrivateAccessible): Likewise.
605
606         * generic.cs (DropGenericTypeArguments): New.  Captures the common
607         pattern: if (t.IsGenericInstance) t = t.GetGenericTypeDefinition ();
608         * attribute.cs, class.cs, decl.cs, ecore.cs: Use it.
609         * generic.cs, report.cs, typemanager.cs: Likewise.
610
611 2005-12-08  Martin Baulig  <martin@ximian.com>
612
613         * generic.cs (TypeArguments.Resolve): Added CS1547 check.
614
615         * typemanager.cs (TypeManager.CSharpSignature): Include type
616         arguments in the signature of a generic method.
617
618 2005-12-07  Martin Baulig  <martin@ximian.com>
619
620         Add support for custom attributes on type parameters.
621
622         * cs-parser.jay (type_arguments): Added `opt_attributes'.
623
624         * generic.cs (TypeParameterName): New public class; we use this
625         instead of a `string' to store the name of a type parameter, so we
626         can also have `Attributes'.
627         (TypeArguments.GetDeclarations): Return a `TypeParameterName[]'
628         array instead of a `string[]' array.
629         (TypeParameter.ctor): We now also take an `Attributes' argument.
630         (TypeParameter.EmitAttributes): New public method; emit our
631         `OptAttributes' here.
632         (GenericMethod.EmitAttributes): New public method; emit the custom
633         attributes on all our type parameters.
634
635         * class.cs (TypeContainer.EmitType): Call EmitAttributes() on all
636         our type parameters.
637         (MethodData.Define): If we're a generic method, call
638         EmitAttributes() on it.
639
640 2005-12-07  Martin Baulig  <martin@ximian.com>
641
642         * generic.cs
643         (ConstraintChecker): New public abstract class; move the
644         constraint checking here from `ConstructedType' and also do
645         constraint checking for generic methods here.
646
647         * expression.cs (Invocation.OverloadResolve): Use
648         ConstraintChecker.CheckConstraints() if we resolved to a generic
649         method.  Fix #76806.
650
651 2005-12-05  Marek Safar  <marek.safar@seznam.cz>
652
653         * attribute.cs (GlobalAttribute.ctor): Pass NamespaceEntry only.
654
655         * class.cs (EmitFieldInitializers): Simplified and fixed to work with
656         event initializers.
657         (FieldBase.EmitInitializer): Moved from TypeContainer and simplified.
658         (FieldBase.Initializer): Initializer is now optional.
659         (EventField.Define): Only event field can have initializer.
660
661         * codegen.cs (EmitContext): DeclSpace is not readonly (small hack).
662
663         * const.cs (Const): Reuse initializer.
664
665         * cs-parser.jay: Updated after FieldBase changes.
666         Added current_array_type to simplify array initializers.
667
668         * ecore.cs (NullCast.IsDefaultValue): Implemented.
669
670         * expression.cs, iterators.cs: Updated.
671
672         * namespace.cs (NamespaceEntry): Made UsingFound private.
673
674 2005-12-05  Marek Safar  <marek.safar@seznam.cz>
675
676         * parameterCollection.cs: Obsolete, removed.
677         * parser.cs: Obsolete, removed.
678
679 2005-12-05  Marek Safar  <marek.safar@seznam.cz>
680
681         Fix #76849.
682         * class.cs (Constructor.Emit): Set obsolete checking for whole context.
683
684         * enum.cs (Enum.Define): Set obsolete context here.
685
686 2005-12-05  Atsushi Enomoto  <atsushi@ximian.com>
687
688         * doc.cs :
689           - FindDocumentedMember() now expects 1) paramList as null
690             when "we don't have to check the number of parameters" and
691             2) Type.EmptyTypes when "there is no arguments".
692           - Introduced FoundMember struct to hold the exact type which was
693             used to find the documented member (the above change broke
694             test-xml-044; it might be better just to use DeclaringType than
695             what MS does, like this change does, but it depends on usage.)
696
697 2005-12-05  Atsushi Enomoto  <atsushi@ximian.com>
698
699         * doc.cs : documented member might be from DeclaringType for nested
700           types. Fixed bug #76782.
701
702 2005-12-03  Ben Maurer  <bmaurer@ximian.com>
703
704         * anonymous.cs: Have the param code handle leaving copies on the
705         stack etc. Allows anonymous params to take part in the assignment
706         code (++, +=, etc). Fixes bug #76550
707
708         * expression.cs: Handle the prepare_for_load/leave_copy by passing
709         it down to the anon code.
710
711         * iterators.cs: Use dummy var here
712
713         * codegen.cs: Handle new vars
714
715 2005-12-01  Marek Safar  <marek.safar@seznam.cz>
716
717         Fix #76849.
718         * class.cs (MethodData.Define): Set proper Obsolete context.
719
720         * ecore.cs (FieldExpr.ResolveMemberAccess): Don't check [Obsolete] in
721         obsolete context.
722         (FieldExpr.DoResolve): Ditto.
723
724 2005-12-01  Marek Safar  <marek.safar@seznam.cz>
725
726         Fix #76849.
727         * class.cs (MethodCore.DoDefineParameters): Test [Obsolete] only when
728         parent is not obsolete.
729
730 2005-12-01  Atsushi Enomoto  <atsushi@ximian.com>
731
732         * doc.cs : (FindDocumentedMember) find parameterless members first
733           and get CS0419 in the early stage. Fixed first case of bug #76727.
734
735 2005-11-30  Marek Safar  <marek.safar@seznam.cz>
736
737         Fix #76859.
738         * ecore.cs (Expression.ResolveAsConstant): Report constant error only when
739         no error was reported.
740
741         *expression.cs (Binary.DoResolve): left can be null.
742
743 2005-12-06  Raja R Harinath  <rharinath@novell.com>
744
745         * class.cs (MethodCore.CheckGenericOverride): Delete unused
746         abstract method and all overrides.
747         * support.cs (ParameterData.GenericConstraints): Delete.
748         (ReflectionParameters.type_params): Delete.
749         (ReflectionParameters.ReflectionParameters): Make private.
750         (ReflectionParameters.GetConstaints): New factory method.
751         * generic.cs (TypeParameterDefineType): Use it.
752         (TypeManager.GetTypeParameterConstraints): Likewise.
753
754 2005-11-22  Marek Safar  <marek.safar@seznam.cz>
755
756         Fix #76783.
757         * class.cs (MethodData.Emit): Parameters should be labeled first.
758
759 2005-11-21  Marek Safar  <marek.safar@seznam.cz>
760
761         Fix #76761.
762         * parameter.cs (Parameter.ApplyAttributeBuilder): Fixed `ref' detection.
763
764 2005-11-18  Marek Safar  <marek.safar@seznam.cz>
765
766         * attribute.cs (AreParametersCompliant): Moved to Parameter.
767
768         * class.cs (MethodCore): Parameter clean up.
769         (IMethodData): Added ParameterInfo.
770         (MethodData): Parameter clean up.
771         (Indexer.Define): Parameter clean up.
772
773         * anonymous.cs,
774         * codegen.cs,
775         * cs-parser.jay,
776         * decl.cs,
777         * doc.cs,
778         * ecore.cs,
779         * flowanalysis.cs,
780         * iterators.cs,
781         * pending.cs,
782         * statement.cs,
783         * typemanager.cs: Parameter clean up.
784
785         * delegate.cs (Define): Get rid of duplicated code.
786
787         * expression.cs (ParameterReference): Removed useless parameters
788         and simplified.
789         (Invocation): Ditto.
790
791         * parameter.cs (ParamsParameter): New class, params specialization.
792         (ArglistParameter): Attemp to separate arglist.
793         (Parameter): Refactored to be reusable and faster.
794         (Parameter.Modifier): Made understandable.
795         (Parameters): Changed to be used as a class for `this' assembly
796         parameters. Refactored to use new specialized classes.
797
798         * support.cs (ParameterData): Added Types property.
799         (InternalParameters): Deleted.
800
801 2005-11-16  Atsushi Enomoto  <atsushi@ximian.com>
802
803         * doc.cs : the previous patch does not actually fix the bug.
804           PropertyInfo override check is now implemented and really fixed it.
805         * expression.cs : Invocation.IsAncestralType() is used from doc.cs.
806
807 2005-11-16  Atsushi Enomoto  <atsushi@ximian.com>
808
809         * doc.cs : apply "override filter" also to properties.
810           Fixed bug #76730.
811
812 2005-11-16  Atsushi Enomoto  <atsushi@ximian.com>
813
814         * doc.cs : renamed FindMembers() to FindMethodBase(). For interfaces,
815           no need to check overrides. For classes, omit those results from 
816           interfaces since they must exist in the class. Fixed bug #76726.
817
818 2005-11-15  Atsushi Enomoto  <atsushi@ximian.com>
819
820         * typemanager.cs : (GetFullNameSignature) differentiate indexers
821           with different parameters. Fixed the second problem in #76685.
822
823 2005-11-15  Atsushi Enomoto  <atsushi@ximian.com>
824
825         * doc.cs : (FindDocumentedMember) pass invocation_type as well (to
826           get expected 'protected' access in CheckValidFamilyAccess()).
827           Fixed bug #76692.
828
829 2005-11-15  Atsushi Enomoto  <atsushi@ximian.com>
830
831         * doc.cs : (GenerateTypeDocComment) Fields could be FixedField.
832           Fixed bug #76705.  CS1569 was incorrectly commented out.
833
834 2005-11-23  Martin Baulig  <martin@ximian.com>
835
836         * generic.cs (Constraints.Define): Removed.
837         (TypeParameter.DefineConstraints): Removed.
838         (TypeParameter.DefineType): Call SetGenericParameterAttributes()
839         on the GenericTypeParameterBuilder here.
840
841 2005-11-23  Martin Baulig  <martin@ximian.com>
842
843         * typemanager.cs (TypeManager.GetProperty): Make this public.
844
845         * generic.cs (Nullable.NullableInfo.ctor): Use
846         TypeManager.GetProperty() rather than using reflection directly.
847
848 2005-11-17  Martin Baulig  <martin@ximian.com>
849
850         * expression.cs (Indexers.GetIndexersForType): Added support for
851         generic parameters; fixes #76587.
852
853 2005-11-17  Martin Baulig  <martin@ximian.com>
854
855         * anonymous.cs
856         (CaptureContext.EmitMethodHostInstance): Use `Ldarg_0' if we
857         inherit the scope from our parent.  Fixes #76653.
858
859 2005-11-15  Martin Baulig  <martin@ximian.com>
860
861         * anonymous.cs (ScopeInfo.ScopeType): New public field; use this
862         instead of `ScopeTypeBuilder' to refer to the "current" type.
863         (AnonymousMethod.CreateScopeType): Correctly create the helper
864         class if we're inside a generic type definition.
865
866 2005-11-14  Atsushi Enomoto  <atsushi@ximian.com>
867
868         * doc.cs : use Invocation.IsOverride() to do real override check.
869         * expression.cs : made Invocation.IsOverride() internal.
870
871 2005-11-14  Atsushi Enomoto  <atsushi@ximian.com>
872
873         * doc.cs : use TypeManager.FindMembers() instead of (possible)
874           TypeBuilder.FindMembers() and filter overriden base members out.
875           Fixed bug #76990.
876
877 2005-11-13  Atsushi Enomoto  <atsushi@ximian.com>
878
879         * doc.cs : ref/out parameters are represented as '@' (instead of
880           '&' in type FullName). Fixed bug #76630 (additionally crefs).
881
882 2005-11-13  Atsushi Enomoto  <atsushi@ximian.com>
883
884         * doc.cs : when there was no '.' in cref to methods in doc comment,
885           then parameters were missing in the output. Fixed bug #76691.
886
887 2005-11-13  Atsushi Enomoto  <atsushi@ximian.com>
888
889         * driver.cs : don't output docs when there is an error.
890           Fixed bug #76693.
891
892 2005-11-13  Atsushi Enomoto  <atsushi@ximian.com>
893
894         * doc.cs :
895           Now it should detect indexers. Fixed primary concern in bug #76685.
896           Fixed CS0419 message to not show the identical member signature in
897           the message.
898
899 2005-11-13  Atsushi Enomoto  <atsushi@ximian.com>
900
901         * doc.cs : (FindDocumentedMember) use TypeManager.MemberLookup()
902           instead of Type.FindMembers() since it does not handle events.
903           Fixed bug #71604.
904
905 2005-11-12  Gert Driesen  <drieseng@users.sourceforge.net>
906
907         * codegen.cs: Fixed typo (speficied -> specified).
908
909 2005-11-11  Marek Safar  <marek.safar@seznam.cz>
910
911         Fix #76369.
912         * doc.cs (FindDocumentedTypeNonArray): Don't resolve again.
913
914 2005-11-11  Marek Safar  <marek.safar@seznam.cz>
915
916         * attribute.cs: Changed error message.
917
918         * cs-tokenizer.cs: One more check.
919
920 2005-11-10  Marek Safar  <marek.safar@seznam.cz>
921
922         * statement.cs (Block.Resolve): Ignore empty statement.
923
924 2005-11-10  Marek Safar  <marek.safar@seznam.cz>
925
926         * report.cs: Made error/warning methods more strict to avoid
927         their misuse.
928
929         * anonymous.cs, attribute.cs, class.cs, codegen.cs, constant.cs,
930         convert.cs, cs-parser.jay, cs-tokenizer.cs, decl.cs, delegate.cs,
931         doc.cs, driver.cs, ecore.cs, expression.cs, location.cs,
932         namespace.cs, parameter.cs, statement.cs, typemanager.cs: Updated.
933
934 2005-11-11  Carlos Alberto Cortez <calberto.cortez@gmail.com>
935
936         * codegen.cs (AssemblyClass.CheckInternalsVisibleAttribute): 
937         Use the more explicit AssemblyName.FullName instead of 
938         AssemblyName.Name to report errors.
939         
940 2005-11-11  Marek Safar  <marek.safar@seznam.cz>
941
942         * attribute.cs, class.cs, cs-tokenizer.cs, parameter.cs: Sync
943         with mcs.
944
945 2005-11-10  Marek Safar  <marek.safar@seznam.cz>
946
947         * class.cs,
948         * convert.cs,
949         * cs-parser.jay,
950         * decl.cs,
951         * enum.cs,
952         * expression.cs,
953         * generic.cs,
954         * pending.cs,
955         * report.cs: Fixed error reporting and typos.
956
957         * generic.cs (TypeParameter.GetSignatureForError): New method.
958         (ConstructedType.GetSignatureForError): Instead of DeclarationName.
959
960         * typemanager.cs (GetFullName): Refactored.
961
962 2005-11-08  Marek Safar  <marek.safar@seznam.cz>
963
964         * attribute.cs (Attribute.GetCoClassAttributeValue): New method.
965         (AttributeTester.GetCoClassAttribute): Get CoClassAttribute.
966
967         * class.cs (TypeContainer.IsComImport): New property.
968         (Constructor.Define): Create proper ctor for ComImport types.
969
970         * expression.cs (New.CheckComImport): Fixed.
971
972 2005-11-07  Miguel de Icaza  <miguel@novell.com>
973
974         * anonymous.cs (CaptureContext.AddParameterToContext): The fact
975         that a parameter has been captured does not mean that we do not
976         have to do the rest of the processing.  This fixes the second part
977         of #76592.  If there was another anonymous method capturing
978         values in the past, the Scope would never be set for the second
979         method that captured the same parameter.
980
981         (CaptureContext.EmitAssignParameter): When `leave_copy' is passed,
982         properly manipulate the stack.   Second part of fix for #76592.
983
984         * expression.cs (New): Add support for invoking "new" on
985         interfaces that have been flagged with the ComImport attribute and
986         the CoClass.  Fixes #76637 
987
988         * statement.cs (Try.DoEmit): When a variable is captured, do not
989         try to emit the vi.LocalBuilder variable as it has been captured.
990         Create a temporary variable and store the results on the
991         FieldBuilder.  Fixes #76642
992
993 2005-11-07  Marek Safar  <marek.safar@seznam.cz>
994
995         * class.cs (CheckPairedOperators): Made compilable with csc 2.0.
996
997         * ecore.cs (InstanceResolve): Fixed CS1540 detection.
998
999         * expression.cs (Binary.DoResolve): Added && optimalization.
1000     
1001         * typemanager.cs (AddUserType): Removed useless argument.
1002
1003 2005-11-04  Marek Safar  <marek.safar@seznam.cz>
1004
1005         * statement.cs (Block.variables): Uses ListDictionary.
1006
1007 2005-11-03  Marek Safar  <marek.safar@seznam.cz>
1008
1009         Fix #75969.
1010         * class.cs (PartialContainer.EmitType): Customized to emit
1011         security attributes.
1012         (ClassPart.ApplyAttributeBuilder): Transform security attribute
1013         for partial classes.
1014
1015 2005-11-03  Marek Safar  <marek.safar@seznam.cz>
1016
1017         Fix #76599.
1018         * expression.cs (ElementAccess.DoResolveLValue): Fixed buffer
1019         access has to be fixed.
1020         
1021         * typemanager.cs (IsUnmanagedType): Wrong common field type.
1022
1023 2005-11-01  Marek Safar  <marek.safar@seznam.cz>
1024
1025         Fix #76590.
1026         * ecore.cs (NullCast.Reduce): Implemented.
1027
1028         * expression.cs (ArrayCreation.CheckIndices): Correcly check
1029         constant type.
1030         
1031         * statement.cs (SwitchLabel.ResolveAndReduce): Catch null
1032         properly.
1033         (Foreach.Resolve): Catch null properly.
1034
1035 2005-10-29  Marek Safar  <marek.safar@seznam.cz>
1036  
1037         * cs-tokenizer.cs: Warning text fix.
1038
1039         * driver.cs: AllWarningNumbers exposed on public interface.
1040
1041         * report.cs (): Reviewed warning numbers.
1042         (IsValidWarning): Use binary search.
1043
1044 2005-10-29  Marek Safar  <marek.safar@seznam.cz>
1045  
1046         * driver.cs: Implemeted resource visibility.
1047         (Resources): New class for code sharing between /res: and
1048         /linkres:
1049  
1050 2005-11-07  Marek Safar  <marek.safar@seznam.cz>
1051
1052         decl.cs (CurrentTypeParameters): Fixed to be public.
1053
1054 2005-11-07  Marek Safar  <marek.safar@seznam.cz>
1055
1056         generic.cs, rootcontext.cs: Removed NewConstraintAttribute.
1057
1058 2005-11-07  Marek Safar  <marek.safar@seznam.cz>
1059
1060         gmcs.exe.sources: Use CryptoConvert.cs from corlib.
1061
1062 2005-11-05  Kornél Pál  <kornelpal@hotmail.com>
1063
1064         * gmcs.exe.config: Updated runtime version to v2.0.50727 (2.0 RTM).
1065
1066 2005-11-04  Carlos Alberto Cortez <calberto.cortez@gmail.com>
1067
1068         Add friend assembly access support.
1069         * typemanager.cs: assembly_internals_vis_attrs
1070         cache for friend assembly access. 
1071         (TypeManager.IsFriendAssembly): New method for
1072         checking friend assembly access.
1073         (TypeManager.Error_FriendAccessNameNotMatching): New
1074         helper method.
1075         (TypeManager.CompareKeyTokens): Likewise.
1076         (TypeManager.Filter): Handle friend accessible
1077         members.
1078
1079         * namespace.cs (RootNamespace.GetTypeInAssembly): Return
1080         friend accessible types.
1081
1082         * ecore.cs (Expression.IsAccessorAccessible): Handle
1083         friend accessible properties.
1084
1085         * decl.cs (DeclSpace.CheckAccessLevel): Handle friend
1086         accessible types.
1087         
1088 2005-10-28  Marek Safar  <marek.safar@seznam.cz>
1089
1090         Fix #76568.
1091         * cfold.cs (ConstantFold.BinaryFold): Implemented null cast
1092         folding.
1093         
1094         * convert (Convert.ImplicitReferenceConversion): NullCast holds
1095         contants only.
1096         
1097         * ecore.cs (NullCast): Child is contant only.
1098         
1099         * literal.cs (NullLiteral.Reduce): null can be converted to any
1100         reference type.
1101
1102 2005-10-28  Kornél Pál  <kornelpal@hotmail.com>
1103
1104         * driver.cs: Use Encoding.Default as default code page instead
1105           of ISO-28591.
1106
1107 2005-10-27  Raja R Harinath  <rharinath@novell.com>
1108
1109         Fix #76085.
1110         * expression.cs (Invocation.Error_InvalidArguments): Handle
1111         __arglist parameters.
1112         (Invocation.VerifyArgumentsCompat): Likewise.
1113         * support.cs (ReflectionParameters.GetSignatureForError): Print
1114         __arglist parameters.
1115         (InternalParamters.GetSignatureForError): Likewise.
1116         * parameter.cs (Parameters.GetSignatureForError): Likewise.
1117
1118 2005-10-26  Marek Safar  <marek.safar@seznam.cz>
1119
1120         * attribute.cs (GetPropertyValue): Made public.
1121
1122         * codegen.cs (AssemblyClass): ResolveClsCompliance renamed to
1123         Resolve.
1124         Add new property WrapNonExceptionThrows to handle 2.0 assembly
1125         attribute.
1126         (AssemblyClass.Emit): Emit RuntimeCompatibilityAttribute when it
1127         is not defined.
1128         
1129         * driver.cs: Reflect method name change.
1130         
1131         * statement.cs (Try.Resolve): Warn when try has both general
1132         exception handlers.
1133         
1134         * typemanager.cs: runtime_compatibility_attr_type new predefined
1135         type.
1136
1137 2005-10-26  Raja R Harinath  <harinath@gmail.com>
1138
1139         Fix #76419.
1140         * pending.cs (InterfaceMethod): Allow tm.args [i] to be null --
1141         treat it as an empty parameter list.
1142
1143 2005-10-26  Raja R Harinath  <rharinath@novell.com>
1144
1145         Fix #76271.     
1146         * ecore.cs (SimpleName.DoSimpleNameResolve): Make fall-back 
1147         ResolveAsTypeStep silent.
1148         * statement.cs (Block.AddConstant): Mark block as used.
1149         (Block.ResolveMeta): Avoid piling on error messages
1150         if a constant initializer resolution fails.
1151
1152 2005-10-25  Raja R Harinath  <rharinath@novell.com>
1153
1154         * namespace.cs (RootNamespace.VerifyUsingForAll, Namespace.VerifyUsing):
1155         Remove.
1156         (NamespaceEntry.VerifyAllUsing): New.
1157         (NamespaceEntry.AliasEntry.Resolve): New.  Handles common error
1158         behaviour.  Delegates actual resolution of alias to ...
1159         (NamespaceEntry.DoResolve): ... this.  Renamed from Resolve.
1160         (NamespaceEntry.LocalAliasEntry, NamespaceEntry.ExternAliasEntry):
1161         Update.
1162         * driver.cs (Driver.MainDriver): Update.
1163         
1164         * namespace.cs (NamespaceEntry.DefineNamespace): Remove.
1165         (NamespaceEntry.SymbolFileID): Make into a on-demand computed
1166         property.
1167         (Namespace.DefineNamespaces, RootNamespace.DefineNamespacesForAll):
1168         Remove.
1169         * symbolwriter.cs (SymbolWriter.Initialize): Don't call
1170         RootNamespace.DefineNamespacesForAll.
1171
1172 2005-10-24  Raja R Harinath  <harinath@gmail.com>
1173
1174         * typemanager.cs (assemblies, external_aliases, modules)
1175         (AddAssembly, AddExternAlias, AddModule GetAssemblies, Modules)
1176         (ComputeNamespaces, GetRootNamespace): Remove extra staging
1177         overhead.  Move resposibility ...
1178         * namespace.cs (GlobalRootNamespace): ... here.  Update to changes.
1179         * driver.cs, attribute.cs, codegen.cs: Update to changes.
1180
1181 2005-10-23  Raja R Harinath  <harinath@gmail.com>
1182
1183         * namespace.cs (RootNamespace.all_namespaces): Renamed from
1184         cached_namespaces.  Improve usage.
1185         (RootNamespace.Reset, RootNamespace.RegisterNamespace)
1186         (RootNamespace.VerifyUsingForAll, RootNamespace.DefineNamespacesForAll):
1187         Move from GlobalRootNamespace and simplify.
1188         (RootNamespace.Global): Make instance variable.
1189         (RootNamespace.RootNamespace): Add "alias name" parameter.
1190         (GlobalRootNamespace): Simplify drastically.
1191         (Namespace.Lookup): Don't use GetNamespace.
1192         * typemanager.cs (GetRootNamespace): Rename from
1193         ComputeNamespaceForAlias.
1194         (NamespaceClash): Use Global.IsNamespace instead of GetNamespace.
1195
1196 2005-10-23  Marek Safar  <marek.safar@seznam.cz>
1197
1198         * anonymous.cs (AnonymousContainer): Don't crash when container
1199         doesn't exist.
1200
1201 2005-10-23  Marek Safar  <marek.safar@seznam.cz>
1202
1203         * expression.cs (Binary.DoResolve): Warn when comparing same
1204         values.
1205
1206 2005-10-23  Marek Safar  <marek.safar@seznam.cz>
1207
1208         Fix #76486.
1209         * expression.cs (Binary.DoResolve): It looks like there are no
1210         convetsion rules in enum context.
1211
1212 2005-10-19  Carlos Alberto Cortez <calberto.cortez@gmail.com>
1213
1214         Add support for extern alias qualifiers.
1215         * typemanager.cs: Move some LookupTypeReflection code
1216         to namespace.cs, to have cleaner code. Added some methods
1217         to help us keep track of the extern aliased references.
1218         * driver.cs: Add suport for extern alias assemblies on command
1219         line and check for their warnings/errors. Also keep track of the
1220         extern aliased assemblies.
1221         * namespace.cs: Move the global functionality of Namespace
1222         to GlobalRootNamespace/RootNamespace. Now the global namespace
1223         is GlobalRootNamespace.Globa. Also the code moved from 
1224         typemanager.cs lives in GlobalRootNames.cs/RootNamespace.cs. 
1225         Finally added LocalAliasEntry (AliasEntry before) and
1226         ExternAliasEntry, to handle alias statements.
1227         * cs-parser.jay: Add support in the grammar for extern alias
1228         statement.
1229         * doc.cs, delegate.cs, expression.cs ecore.cs, symbolwriter.cs: 
1230         Update callings to Namespace (now in GlobalRootNamespace).
1231
1232 2005-10-25  Martin Baulig  <martin@ximian.com>
1233
1234         * convert.cs (ImplicitTypeParameterConversion): Make base
1235         interfaces actually work; fixes #76557.
1236
1237 2005-10-25  Martin Baulig  <martin@ximian.com>
1238
1239         * generic.cs
1240         (GenericMethod.Define): Call TypeParameter.DefineConstraints() on
1241         all the type parameters; fixes #76551.
1242
1243 2005-10-25  Martin Baulig  <martin@ximian.com>
1244
1245         Fix #76472.
1246
1247         * generic.cs
1248         (GenericMethod.ctor): Added `Expression return_type' and
1249         `Parameters parameters' arguments.
1250         (GenericMethod.DefineType): Call ResolveAsTypeTerminal() on the
1251         parameter and return types to check their constraints if they're
1252         generic types.
1253
1254         * codegen.cs (EmitContext.ResolvingGenericMethod): New public
1255         boolean field.
1256
1257         * ecore.cs (Expression.ResolveAsTypeTerminal): Don't check the
1258         constraints of a generic type if `ec.ResolvingGenericMethod'.
1259
1260         * class.cs (MethodCore.DoDefineParameters): Set
1261         `ec.ResolvingGenericMethod' if we're a generic method.
1262         (MemberBase.MemberType): Likewise.
1263
1264 2005-10-25  Carlos Alberto Cortez <calberto.cortez@gmail.com>
1265
1266         * typemanager.cs (TypeManager): Added 
1267         TypeManager.internals_visible_attr_type to cache
1268         S.R.CompilerServices.InternalsVisibleToAttribute.
1269
1270         * codegen.cs (AssemblyClass): Added checks for 
1271         InternalsVisibleToAttribute in new method 
1272         CheckInternalsVisibleAttribute () and also cache the
1273         AssemblyName in AssemblyClass.Name.
1274         
1275 2005-10-24  Martin Baulig  <martin@ximian.com>
1276
1277         * typemanager.cs
1278         (TypeManager.ExpandInterfaces): Added overloaded version which
1279         just takes a `Type[]' array.
1280
1281         * generic.cs
1282         (Constraints.Resolve): Don't expand the interfaces here; ie. we
1283         just use the interfaces which were explicitly specified and not
1284         the interfaces they inherit.  Fixes #76482.
1285         (TypeParameter.FindMembers): Expand the interfaces here.
1286
1287 2005-10-21  Martin Baulig  <martin@ximian.com>
1288
1289         * generic.cs
1290         (Constraints.Resolve): Also resolve the actual types here.
1291         (Constraints.ResolveTypes): Just check the constraints here.
1292         Fixes #76363; see gtest-218.cs.
1293
1294 2005-10-21  Martin Baulig  <martin@ximian.com>
1295
1296         * convert.cs
1297         (Convert.ImplicitTypeParameterConversion): Use a `ClassCast'
1298         instead of a `BoxedCast'; fixes gtest-217.cs.
1299
1300 2005-10-20  Atsushi Enomoto  <atsushi@ximian.com>
1301
1302         * generic.cs : (ConstructedType.CheckConstraints) warn CS0310 when
1303           1) "new()" is specified as generic parameter constraint and 2) the
1304           type is TypeBuilder and 3) the type is abstract even if it has a
1305           default .ctor(). Now errors/gcs0310-3.cs is correctly rejected.
1306
1307 2005-10-20  Martin Baulig  <martin@ximian.com>
1308
1309         * generic.cs
1310         (GenericConstraints.TypeParameter): New public property.
1311         (TypeParameter.ctor): Also take a `DeclSpace' argument.
1312         (TypeParameter.DeclSpace): New public property.
1313         (TypeParameter.DefineType): Inflate the constraints if our
1314         `DeclSpace' is an `Iterator'.   
1315
1316 2005-10-19  Atsushi Enomoto  <atsushi@ximian.com>
1317
1318         * class.cs, decl.cs : (MemberCache.FindMemberToOverride) added 
1319           GenericMethod argument to compare methods' generic type arguments.
1320           Fixed bug #76382.
1321
1322 2005-10-19  Martin Baulig  <martin@ximian.com>
1323
1324         * class.cs (TypeContainer.DefineType): Only use ResolveAsTypeStep(),
1325         not ResolveType() when resolving the base type, so we're not
1326         checking the constraints here.
1327         (TypeContainer.ResolveType): Call ResolveType() on our base_type
1328         if we have any.
1329
1330 2005-10-19  Martin Baulig  <martin@ximian.com>
1331
1332         * generic.cs (ConstructedType.CheckConstraints): Committing
1333         untested fix for #76441.
1334
1335 2005-10-18  Raja R Harinath  <rharinath@novell.com>
1336
1337         Fix #76371.
1338         * class.cs (TypeContainer.DefineType): Move updating of
1339         topological sort earlier in the code.
1340         * decl.cs (DeclSpace.ResolveBaseTypeExpr): Don't use TypeBuilder.
1341
1342 2005-10-18  Marek Safar  <marek.safar@seznam.cz>
1343
1344         Fix #76273.
1345         * cfold.cs (BinaryFold): Reduce constant in enum conversion.
1346         
1347         * constant.cs (Constant.TryReduce): Moved from Cast class.
1348         (Reduce): Made little bit more OO and fixed missing conversions.
1349         
1350         * ecore.cs (Reduce): Implemented.
1351         (Binary.EnumLiftUp): New method to upgrade values to enum values.
1352         
1353         * literal.cs (Reduce): Implemented.
1354         
1355         * class.cs: Reverted Miguel's wrong commit.
1356
1357 2005-10-14  Miguel de Icaza  <miguel@novell.com>
1358
1359         * ecore.cs (GetMemberType): Report the correct mapping for the MemberCore
1360
1361 2005-10-14  Atsushi Enomoto  <atsushi@ximian.com>
1362
1363         * cs-parser.jay, expression.cs : CS0214 was missing error location
1364           for constants. Fixed bug #76404.
1365
1366 2005-10-10  Raja R Harinath  <rharinath@novell.com>
1367
1368         * ecore.cs (PropertyExpr.Emit): Use Invocation.EmitCall to emit
1369         InstanceExpression.
1370         (PropertyExpr.EmitCall): Likewise.
1371         * expression.cs (Invocation.EmitArguments): Handle case where
1372         arguments == null.
1373         (Invocation.EmitCall): Avoid allocating temporary variable if
1374         there are no arguments.
1375
1376 2005-10-11  Marek Safar  <marek.safar@seznam.cz>
1377
1378         Fix #76370.
1379         * convert.cs (ExplicitConversionCore): Fixed object->enum
1380         conversion.
1381
1382 2005-10-07  Raja R Harinath  <rharinath@novell.com>
1383
1384         Fix #76323.
1385         * convert.cs (ImplicitConversionStandard): Move conversion of
1386         void* to arbitrary pointer types ...
1387         (ExplicitConversionStandard): .. here.
1388         * ecore.cs (Expression.Error_ValueCannotBeConverted): Fix CS0266
1389         error to always print typenames.
1390
1391 2005-10-07  Raja R Harinath  <rharinath@novell.com>
1392
1393         * convert.cs (GetConversionOperator): Rename from
1394         GetConversionOperators.  Move operator selection code from ...
1395         (UserDefinedConversion): ... here.
1396
1397 2005-10-06  Marek Safar  <marek.safar@seznam.cz>
1398
1399         * convert.cs (ExplicitConversionCore): Removed duplicate enum
1400         conversion.
1401
1402 2005-10-05  Marek Safar  <marek.safar@seznam.cz>
1403
1404         * assign.cs (Assign.DoResolve): Error method changed.
1405
1406         * cfold.cs (DoConstantNumericPromotions): Error method changed.
1407         
1408         * const.cs (ResolveValue): Reset in_transit immediately.
1409         
1410         * constant.cs: Error method changed.
1411         
1412         * convert.cs: Removed useless location parameter.
1413         (ExplicitNumericConversion): Don't do double enum check.
1414         (ExplicitConversionCore): Renamed from ExplicitConversion.
1415         (ExplicitUnsafe): Extracted from ExplicitConversion.
1416         (ExplicitConversion): Uses for error reporting.
1417         
1418         * ecore.cs (Error_ValueCannotBeConverted): More logic for more
1419         error messages.
1420         (ResolveBoolean): Uses common error method.
1421         (CastToDecimal): Get rid of ec.
1422         (CastFromDecimal): Optimized.
1423         (ConvCast): Get rid of ec.
1424         
1425         * enum.cs (ResolveValue): Reset in_transit immediately.
1426         (Emit): Return after first error.
1427         
1428         * expression.cs: Convert changes.
1429         
1430         * literal.cs: Error method changed.
1431         
1432         * statement.cs: Error method changed.
1433
1434 2005-10-06  Raja R Harinath  <rharinath@novell.com>
1435
1436         Fix gtest-131.cs and gtest-211.cs.
1437         * generic.cs (Nullable.LiftedBinaryOperator.EmitEquality):
1438         Only emit code for a label if it is used.  Unreachable code can
1439         violate ECMA evaluation stack invariants.
1440
1441 2005-09-27  Marek Safar  <marek.safar@seznam.cz>
1442
1443         * anonymous.cs: Implemented ExprClassName.
1444         
1445         * assign.cs (Assign.DoResolve): Don't chrash when type is not
1446         delegate.
1447         
1448         * attribute.cs (ResolveArguments): Enabled MethodImplOptions
1449         check.
1450         
1451         * class.cs (StaticClass.DefineContainerMembers): Report protected
1452         members as error.
1453         
1454         * codegen.cs: if(ed) PRODUCTION.
1455         
1456         * convert.cs (Error_CannotImplicitConversion): Better error
1457         distinction.
1458         
1459         * cs-parser.jay: More error checks.
1460         
1461         * cs-tokenizer.cs (consume_identifier): Fixed Miguel's revert.
1462         
1463         * driver.cs (CSCParseOption): Enabled wrong option check.
1464         
1465         * ecore.cs (Expression.ExprClassName): Turned to property.
1466         (MemberExpr.CheckIntermediateModification): For checking boxed
1467         value types     modification.
1468         
1469         * statement.cs (Fixed.Resolve): Expression type must be
1470         convertible to fixed type.
1471         (CollectionForeach.GetEnumeratorFilter,TryType):
1472         Small refactoring for easier error checking.
1473
1474 2005-09-26  Marek Safar  <marek.safar@seznam.cz>
1475
1476         * attribute.cs (Attribute.Resolve): Check Obsolete attribute for
1477         attributes.
1478         
1479         * class.cs (GeneratedBaseInitializer): New class for customization
1480         compiler generated initializers.
1481         (MemberBase.DoDefine): Check Obsolete attribute here.
1482         (FieldMember.DoDefine): Ditto.
1483         
1484         * const.cs (ExternalConstant.CreateDecimal): Builder for decimal
1485         constants.
1486         
1487         * decl.cs (MemberCore.EmitContext): Returns valid current ec.
1488         (MemberCore.GetObsoleteAttribute): Removed argument.
1489         (MemberCore.CheckObsoleteness): Obsolete attributes are hierarchic.
1490         (MemberCore.CheckObsoleteType): New helper.
1491         
1492         * delegate.cs,
1493         * enum.cs,
1494         * statement.cs: Updates after MemberCore changes.
1495         
1496         * ecore.cs (TypeExpr.ResolveType): Check type obsoleteness here.
1497         (FieldExpr.ResolveMemberAccess): Fixed decimal constants checks.
1498         
1499         * expression.cs (ComposedCast.DoResolveAsTypeStep): Don't check
1500         obsolete attribute for compiler construct.
1501         (As.DoResolve): Cache result.
1502         
1503         * iterators.cs (Define_Constructor): Use GeneratedBaseInitializer.
1504
1505 2005-10-01  Miguel de Icaza  <miguel@novell.com>
1506
1507         * expression.cs (Probe): instead of having a "Type probe_type"
1508         keep the extra information as a TypeExpr probe_type_expr since the
1509         "As" operator needs to perform some type checks.
1510
1511         * (As.DoResolve): If the type is a type parameter, ensure that it
1512         is constrained by a class.
1513
1514 2005-09-22  Miguel de Icaza  <miguel@novell.com>
1515
1516         * statement.cs (Lock): Use the TemporaryVariable class instead of
1517         manually using local variables as those do not work when variables
1518         are captured.
1519
1520         * ecore.cs: Moved the TemporaryVariable class from being a nested
1521         class inside Foreach to be a public class that can be employed in
1522         other places. 
1523
1524 2005-09-19  Marek Safar  <marek.safar@seznam.cz>
1525
1526         * cs-parser.jay: interface_accessors replaced by
1527         accessor_declarations.
1528
1529         * ecore.cs, literal.cs, statement.cs: NullLiteral holds null
1530         location.
1531         
1532         * statement.cs (GotoCase.Resolve): Convert null constant to
1533         null case.
1534         (SwitchLabel.ResolveAndReduce): Ditto.
1535         (SwitchLabel.NullStringCase): Custom null stamp.
1536         (Switch.SimpleSwitchEmit): Fix from NullLiteral to NullStringCase.
1537         
1538         typemanager.cs (CSharpSignature): Don't skip first argument
1539         for full names.
1540
1541 2005-09-16  Marek Safar  <marek.safar@seznam.cz>
1542
1543         * cfold.cs, constant.cs, convert.cs, ecore.cs,
1544         expression.cs, iterators.cs, literal.cs: Store constants and
1545         literals location.
1546         
1547         * class.cs (MemberBase.ShortName): Pass location.
1548         
1549         * cs-parser.jay: Some location fixes.
1550         
1551         * ecore.cs (Expression.Location): Made virtual.
1552
1553 2005-09-27  Marek Safar  <marek.safar@seznam.cz>
1554
1555         Fix #72930.
1556         * const.cs (Const.ResolveValue): Check for assigning non-null
1557         value to reference type.
1558
1559 2005-09-26  Raja R Harinath  <rharinath@novell.com>
1560
1561         Fix #76133.
1562         * expression.cs (This.VerifyFixed): In a value type T, the type of
1563         'this' is T&, iow, 'this' is either an out or ref parameter.  In a
1564         value type R, 'this' is treated as a value parameter.
1565
1566 2005-09-05  Miguel de Icaza  <miguel@novell.com>
1567
1568         * expression.cs (Cast.TryReduce): Only reduce to an EnumConstant
1569         if the underlying types are the same, otherwise we need to produce
1570         code that will do the proper cast.
1571
1572         This was exposed by Marek's constant rewrite which produced
1573         invalid code for the call site:
1574
1575         enum X : long { a }
1576         void Method (X v) {}
1577
1578         Method ((X) 5)
1579
1580         This fixes test-49.cs
1581
1582 2005-09-05  Atsushi Enomoto  <atsushi@ximian.com>
1583
1584         * attribute.cs : (Attribute.IsValidArgumentType): array of string/
1585           Type/Object should be allowed as well. Fixed bug #75968.
1586
1587 2005-09-05  Atsushi Enomoto  <atsushi@ximian.com>
1588
1589         * expression.cs : (Binary.DoResolve): when one is enum constant and
1590           another is constant 0, then return enum one *as enum type*.
1591           Fixed bug 74846.
1592
1593 2005-10-04  Martin Baulig  <martin@ximian.com>
1594
1595         * ecore.cs (PropertyExpr.ResolveAccessors): Cosmetic fix; make the
1596         `SetMemberIsUsed()' work for generics, too.
1597
1598 2005-10-04  Martin Baulig  <martin@ximian.com>
1599
1600         * expression.cs (DelegateInvocation.EmitStatement): Make this work
1601         for corlib.  Fixes #75691.
1602
1603 2005-09-28  Marek Safar  <marek.safar@seznam.cz>
1604
1605         Fix #76255.
1606         * driver.cs: Fix compilation files with full root path.
1607
1608 2005-09-25  Miguel de Icaza  <miguel@novell.com>
1609
1610         * report.cs (SymbolRelatedToPreviousError): Format the output so
1611         it does not use an open parenthesis that is never closed. 
1612
1613         * driver.cs: Follow coding guidelines
1614
1615 2005-09-18  Miguel de Icaza  <miguel@novell.com>
1616
1617         * driver.cs: Set InEmacs based on the environment variable EMACS. 
1618
1619         * location.cs (InEmacs): in this mode, do not report column
1620         location as it confuses Emacs.
1621
1622 2005-10-03  Raja R Harinath  <rharinath@novell.com>
1623
1624         * support.cs (SeekableStreamReader.Position): Don't error out when
1625         the requested position is just beyond the end of the current
1626         buffered data.
1627
1628 2005-09-28  Raja R Harinath  <rharinath@novell.com>
1629
1630         * support.cs (SeekableStreamReader): Simplify drastically.  Don't
1631         try to keep in sync with the byte count of the underlying Stream.
1632         However, this limits us to a window size of 2048 characters: i.e.,
1633         the maximum lookahead of our lexer/parser can be 2048 characters.
1634
1635 2005-09-22  Martin Baulig  <martin@ximian.com>
1636
1637         * driver.cs: Removed a debugging FIXME.
1638
1639 2005-09-21  Raja R Harinath  <rharinath@novell.com>
1640
1641         * cs-parser.jay (type_arguments): Add CS1644 check.
1642         * decl.cs (DeclSpace.AddToContainer): Restore CS0694 check.
1643
1644 2005-09-15  Raja R Harinath  <rharinath@novell.com>
1645
1646         * Makefile (PROGRAM): Make profile specific.
1647         (gmcs.exe) [PROFILE=net_2_0]: Add utility rule to copy gmcs.exe to
1648         the current directory.
1649
1650         Fix test-455.cs.
1651         * expression.cs (Invocation.EmitCall): Remove optimization on
1652         this_call since it doesn't handle 'this' being a value type.
1653
1654 2005-09-05  Geoff Norton  <gnorton@customerdna.com>
1655
1656         * driver.cs: Ensure file handles are closed after parsing
1657
1658 2005-09-05  Miguel de Icaza  <miguel@novell.com>
1659
1660         * expression.cs (Cast.TryReduce): Only reduce to an EnumConstant
1661         if the underlying types are the same, otherwise we need to produce
1662         code that will do the proper cast.
1663
1664         This was exposed by Marek's constant rewrite which produced
1665         invalid code for the call site:
1666
1667         enum X : long { a }
1668         void Method (X v) {}
1669
1670         Method ((X) 5)
1671
1672         This fixes test-49.cs
1673
1674 2005-09-05  Martin Baulig  <martin@ximian.com>
1675
1676         * expression.cs (As.DoResolve): Use `probe_type.IsValueType'
1677         instead of `TypeManager.IsValueType (probe_type)'; fixes #75668.
1678
1679         * cs-parser.jay (delegate_declaration): Small fix for #75852.
1680
1681 2005-09-05  Atsushi Enomoto  <atsushi@ximian.com>
1682
1683         * typemanager.cs: (IsUnmanagedType) : generic parameter is not allowed
1684           to be a pointer type due to the spec 25.2, so check if declaring
1685           type is generic type definition. Fixed bug #75772.
1686
1687 2005-09-05  Atsushi Enomoto  <atsushi@ximian.com>
1688
1689         Fixed bug #75957.
1690         * generic.cs : (TypeManager.IsEqual(Type,Type)): it should work when
1691           both types are not defined by methods.
1692         * expression.cs : (Invocation.IsApplicable): it should work when
1693           the argument type is equal to the parameter type, not only when
1694           ImplicitConversionExists() returns true.
1695
1696 2005-09-02  Raja R Harinath  <rharinath@novell.com>
1697
1698         * attribute.cs (GetMarshal): Work even if "DefineCustom" is
1699         internal.
1700
1701         Fix #75941.
1702         * ecore.cs (SimpleNameResolve.DoSimpleNameResolve): Disable
1703         flow-branching for LocalVariableReferences in case we were invoked
1704         from a MemberAccess.
1705         * expression.cs (LocalVariableReference.VerifyAssigned): New.
1706         Carved out of ...
1707         (LocalVariableReference.DoResolveBase): ... this.
1708         (MemberAccess.Resolve): Do the check that was disabled during
1709         SimpleNameResolve.
1710
1711 2005-09-01  Atsushi Enomoto  <atsushi@ximian.com>
1712
1713         * class.cs :
1714           (PartialContainer.Create): check abstract/sealed/static strictly
1715           but abstract/sealed can exist only at one side. Fixed bug #75883.
1716
1717 2005-09-01  Kornél Pál  <kornelpal@hotmail.com>
1718
1719         Fix #75945.
1720         * attribute.cs (Attribute.GetMarshal): If ArraySubType is not
1721         specified, don't default to UnmanagedType.I4.
1722
1723 2005-09-01  Atsushi Enomoto  <atsushi@ximian.com>
1724
1725         * expression.cs : conditional operator should check possibly
1726           incorrect assign expression. Fixed bug #75946.
1727
1728 2005-08-30  Raja R Harinath  <rharinath@novell.com>
1729
1730         Fix #75934.
1731         * anonymous.cs (ScopeInfo.MakeFieldName): New helper.
1732         (ScopeInfo.EmitScopeType): Use it to construct field names from
1733         names of captured locals.
1734
1735         Fix #75929.
1736         * ecore.cs (BoxedCast.BoxedCast) [1-argument variant]: Remove.
1737         * convert.cs (ImplicitReferenceConversion, TryImplicitIntConversion):
1738         Pass 'target_type' to BoxedCast.  Don't default to 'object'.
1739         (ExplicitConversion): Remove enum cases already handled by
1740         implicit conversion.  Move implicit conversion check to the beginning.
1741         * delegate.cs (DelegateCreation.ResolveMethodGroupExpr): Update.
1742         * expression.cs (ArrayCreation.EmitDynamicInitializers):
1743         Don't treat System.Enum as a struct.
1744
1745 2005-08-30  Jb Evain  <jbevain@gmail.com>
1746
1747         * attribute.cs: handles as expression in parameters.
1748
1749 2005-08-30  Raja R Harinath  <rharinath@novell.com>
1750
1751         Fix #75802.
1752         * class.cs (TypeContainer.VerifyClsName): Don't use a
1753         PartialContainer when verifying CLS compliance.
1754         (AbstractPropertyEventMethod): Set Parent here, ...
1755         (PropertyMethod): ... not here.
1756
1757 2005-08-30  Atsushi Enomoto  <atsushi@ximian.com>
1758
1759         * attribute.cs : escaped attribute name should not be allowed to be
1760           resolved (e.g. @class as classAttribute). Fixed bug #75930.
1761
1762 2005-08-29  Raja R Harinath  <rharinath@novell.com>
1763
1764         Fix #75927.
1765         * convert.cs (ImplicitStandardConversionExists): Allow zero also
1766         when converting a long constant to unsigned long.
1767         * expression.cs (Invocation.OverloadResolve): Add sanity check to
1768         detect where IsApplicable and VerifyArgumentsCompat disagree.
1769
1770 2005-08-29  Raja R Harinath  <rharinath@novell.com>
1771         and Carlos Alberto Cortez  <carlos@unixmexico.org>
1772
1773         Fix #75848.
1774         * class.cs (TypeContainer.CanElideInitializer): New helper.
1775         (TypeContainer.EmitFieldInitializers): Use it to determine if we
1776         can safely emitting the initializer of a field.
1777
1778 2005-08-25  Atsushi Enomoto  <atsushi@ximian.com>
1779
1780         * statement.cs : (Continue.Resolve()) Unlike break, continue is not
1781           allowed inside a switch (without loop). Fixed bug #75433.
1782
1783 2005-08-26  Kornél Pál  <kornelpal@hotmail.com>
1784
1785         * AssemblyInfo.cs: Using Consts.MonoVersion instead of MonoVersion.cs.
1786         * mcs.exe.sources: Using Consts.MonoVersion instead of MonoVersion.cs.
1787
1788 2005-08-25  Atsushi Enomoto  <atsushi@ximian.com>
1789
1790         * driver.cs : kinda reverting the default encoding changes (not exact 
1791           revert since I noticed that "codepage:reset" might not work fine).
1792
1793 2005-08-25  Atsushi Enomoto  <atsushi@ximian.com>
1794
1795         * class.cs : (AbstractPropertyEventMethod) SetupName() now takes
1796           Location. Now getter and setter store location correctly.
1797           (errors/cs0111-12.cs now reports the expected location.)
1798
1799 2005-08-25  Atsushi Enomoto  <atsushi@ximian.com>
1800
1801         * driver.cs : Use default encoding on the environment.
1802           Removed (now that) extra parameter for SeekableStreamReader.
1803         * support.cs : (SeekableStreamReader) third .ctor() argument for
1804           StreamReader is not required (always true). preamble size could
1805           be acquired in simpler and safe way.
1806
1807 2005-08-24  Atsushi Enomoto  <atsushi@ximian.com>
1808
1809         * cs-parser.jay: report CS0642 at warning level 3
1810           and report CS0642 for an if else statement also
1811           fixes bug #74745. Patch by John Luke (and a bit
1812           modified by me).
1813           Removed extra CS0642 warning check for "while",
1814           "for" and "fixed".
1815         * statement.cs: In Block.Resolve(), CS0642 check
1816           is reimplemented to check a sequence of an empty
1817           statement and a block.
1818
1819           Both fix bug #66777.
1820
1821 2005-08-24  Marek Safar  <marek.safar@seznam.cz>
1822
1823         * attribute.cs (GetMethodObsoleteAttribute): Disabled obsolete properties
1824         detection until I fix it.
1825         
1826         * cs-tokenizer.cs: Changed error message.
1827         
1828         * cs-parser.jay: Fixed 2 error locations.
1829         
1830         * ecore.cs (Error_TypeDoesNotContainDefinition): Share error message.
1831         (PropertyExpr.Error_PropertyNotFound): First attempt to detect non C#
1832         properties.
1833         
1834         * enum.cs (GetSignatureForError): Fixed.
1835         
1836         * expression.cs (Invocation.IsSpecialMethodInvocation): Improved special
1837         method detection.
1838         
1839         * class.cs,
1840         * typemanager.cs (RegisterProperty): Removed.
1841         
1842         * statement.cs (CheckInvariantMeaningInBlock): Changed error message.
1843
1844 2005-08-24  Raja R Harinath  <rharinath@novell.com>
1845
1846         Fix #75874.
1847         * expression.cs (ArrayAccess.EmitLoadOpcode): Emit ldelem.i for pointers.
1848         (ArrayAccess.GetStoreOpcode): Return stelem.i for pointers.
1849
1850 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
1851
1852         * expression.cs : tiny fix is required for not warning positive ulong.
1853           See test-441.cs.
1854
1855 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
1856
1857         * expression.cs : add CS0652 check for constant and integral
1858           expression. Fixed bug #53974.
1859
1860 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
1861
1862         * expression.cs : in DoNumericPromotions(), check if there is implicit
1863           conversion overload for string (to check CS0034). Fixed bug #52492.
1864
1865 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
1866
1867         * cs-tokenizer.cs : Check newline in char constant. Fixed bug #75245.
1868
1869 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
1870
1871         * ecore.cs : report location when it is *not* Null.
1872
1873 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
1874
1875         * codegen.cs,
1876           ecore.cs,
1877           flowanalysis.cs,
1878           expression.cs:
1879           Added OmitStructFlowAnalysis to EmitContext to handle CS0165 check
1880           correctly. Fixed bug #75721.
1881
1882 2005-08-23  Raja R Harinath  <rharinath@novell.com>
1883
1884         * support.cs (SeekableStreamReader.Position): Avoid an expensive
1885         loop that performs 'min (pos, char_count)'.
1886
1887         Fix #75862.
1888         * expression.cs (Unary.ResolveOperator): Don't discard implicit
1889         converted value in Operator.OnesComplement.
1890
1891 2005-08-22  Ben Maurer  <bmaurer@ximian.com>
1892
1893         * anonymous.cs: If the anon method is pulled into a helper class,
1894         it needs to be `internal' not `private'. Fixes runtime behavior on
1895         msft. bug #75704
1896
1897 2005-08-17  Marek Safar  <marek.safar@seznam.cz>
1898
1899         Fix #75803
1900         * decl.cs (DeclSpace.VerifyClsCompliance): Skip when collision object
1901         is a partial class.
1902
1903 2005-08-16  Marek Safar  <marek.safar@seznam.cz>
1904
1905         The big constants rewrite
1906         Fix #75746, #75685 and more
1907         As a side effect saved 1MB for MWF ;-)
1908         
1909         * attribute.cs (GetAttributeArgumentExpression): Use ToType, GetTypedValue.
1910         (GetMarshal, GetMethodImplOptions, GetLayoutKindValue): Values are not
1911         enum based for corlib compilation.
1912         
1913         * cfold.cs (BinaryFold): Convert operand for enum additions. Fixed enum
1914         subtractions.
1915         
1916         * class.cs (FixedField.Define): Use ResolveAsConstant.
1917         
1918         * const.cs (IConstant): Interface constants and enums.
1919         (Const.ResolveValue): New method for constant resolvning.
1920         (ExternalConstant): Constants from imported assemblies.
1921         
1922         * constant.cs (Constant.GetTypedValue): Used to get constant with forced
1923         conversion; like enums.
1924         (Constant.ToType): Converts this constant to different type.
1925         (Constant.Increment): Adds 1.
1926         
1927         * convert.cs (ImplicitConversionRequired): Simplified.
1928         
1929         * cs-parser.jay: Create EnumMember directly.
1930         
1931         * decl.cs (MemberCore.CheckObsoleteness): Checks for ObsoleteAttribute presence.
1932         
1933         * doc.cs (GenerateEnumDocComment): Removed.
1934         
1935         * ecore.cs (Expression.ResolveAsConstant): New constant specific method.
1936         (ConvertIntLiteral): Removed.
1937         (FieldExpr.ResolveMemberAccess): Refactored to remove constant specific if(s).
1938         
1939         * enum.cs (EnumMember): Implement IConstant.
1940         (Enum.IsValidEnumConstant): Removed.
1941         (Enum.GetNextDefaultValue): Removed.
1942         (Enum.FindMembers): Updated.
1943         (Enum.GenerateDocComment): Iterate enum members.
1944         
1945         * expression.cs (Cast.TryReduce): Handle enums correctly.
1946         (New.Constantify): Made public.
1947         (MemberAccess.DoResolve): Removed contant specific if(s).
1948         
1949         * literal.cs (NullLiteral): Implement new abstract methods.
1950         
1951         * statement.cs (GotoCase.Resolve): Use new constant methods.
1952         (SwitchLabel.ResolveAndReduce): Use new constant methods.
1953         
1954         * typemanager.cs (LookupEnum): Removed.
1955         (IsEnumType): Fixed to work with corlib.
1956         (RegisterConstant): Removed.
1957         (LookupConstant): Removed.
1958         (GetConstant): Changed to work with IConstant.
1959
1960 2005-08-04  Atsushi Enomoto  <atsushi@ximian.com>
1961
1962         * location.cs : Fixed overflown (>255) column number.
1963
1964 2005-08-03  Raja R Harinath  <rharinath@novell.com>
1965
1966         First cut of the qualified-alias-member feature.
1967         * cs-tokenizer.cs (Tokenizer.is_punct): Recognize the double-colon
1968         token.
1969         * cs-parser.jay (DOUBLE_COLON): New token.
1970         (namespace_or_type_name): Add rule for recognizing
1971         qualified-alias-members.
1972         (primary_expression): Likewise.
1973         (element_access): Allow QualifiedAliasMember as a possible
1974         type-bearing expression.
1975         (local_variable_type, local_variable_pointer_type): Likewise.
1976         * namespace.cs (NamespaceEntry.LookupAlias): New.  Looks up
1977         aliases in the current and enclosing namespace declarations.
1978         (NamespaceEntry.UsingAlias): Add CS0440 warning.
1979         * decl.cs (MemberName.is_double_colon): New.
1980         (MemberName.MemberName): Add new constructor for alias-member.
1981         (MemberName.GetTypeExpression): Generate QualifiedAliasMember too.
1982         * expression.cs (QualifiedAliasMember): New expression type.
1983
1984 2005-08-02  Atsushi Enomoto  <atsushi@ximian.com>
1985
1986         * location.cs : it borked when no argument was specified.
1987
1988 2005-08-02  Atsushi Enomoto  <atsushi@ximian.com>
1989
1990         * location.cs : tiny ToString() format fix.
1991
1992 2005-08-02  Atsushi Enomoto  <atsushi@ximian.com>
1993
1994         * statement.cs : oops, it was missing.
1995
1996 2005-08-02  Atsushi Enomoto  <atsushi@ximian.com>
1997
1998         A set of fixes for precise line/column location.
1999
2000         * location.cs :
2001           "token" field now holds a file/line "delta", a line number offset 
2002           from the segment, and a column number. See also:
2003           http://lists.ximian.com/pipermail/mono-devel-list/2004-
2004           December/009508.html
2005           Removed static IsNull. Use instance IsNull property instead.
2006         * cs-tokenizer.cs :
2007           For some tokens it stores Location. For Identifier it stores
2008           LocatedToken which is a pair of string name and location.
2009           Column numbers are adjusted only at getChar().
2010         * report.cs :
2011           Use Location.ToString() for reporting (it now contains column).
2012         * cs-parser.jay :
2013           Largely modified to use LocatedToken instead of
2014           string (IDENTIFIER), and to acquire Location from some tokens.
2015         * namespace.cs, decl.cs, ecore.cs, class.cs, delegate.cs,
2016           iterators.cs, const.cs, anonymous.cs, tree.cs, enum.cs,
2017           codegen.cs :
2018           Now MemberName holds Location. DeclSpace.ctor() receives Location
2019           as a parameter. Removed extra parameters to all derived classes.
2020           Replaced Location.IsNull() with instance property.
2021         * assign.cs, expression.cs :
2022           Added .ctor() overload that omits Location.
2023         * attribute.cs :
2024           Added "nameEscaped" flag that indicates the identifier was escaped
2025           in the source file. This fixes bug #57047.
2026
2027 2005-09-02  Martin Baulig  <martin@ximian.com>
2028
2029         * class.cs: Make CS3005 a warning, not an error.
2030
2031 2005-08-02  Marek Safar  <marek.safar@seznam.cz>
2032
2033         * attribute.cs (AttributeTester.GetImportedIgnoreCaseClsType):
2034         New method, looking for lo-case imported cls type.
2035
2036         * decl.cs (DeclSpace.VerifyClsCompliance): Check CS3005 for types
2037         here.
2038
2039         * driver.cs: Removed VerifyTopLevelNameClsCompliance usage.
2040
2041         * enum (Enum.VerifyClsCompliance): Hardcode non-compliant types.
2042
2043         * typemanager.cs (TypeManager.AllClsTopLevelTypes): Renamed from
2044         all_imported_types.
2045         (TypeManager.LoadAllImportedTypes): Lo-case imported types.
2046
2047         Optimized to save 3.5 MB for SWF compilation.
2048
2049 2005-08-01  Marek Safar  <marek.safar@seznam.cz>
2050
2051         * class.cs (AddToTypeContainer): Use inheritance insted of if(s).
2052         (PartialContainer.Create): Moved logic AddToContainer.
2053         (PartialContainer.MarkForDuplicationCheck): Shares name.
2054         
2055         * decl.cs (DeclSpace.AddToContainer): Check name collisions at one
2056         place.
2057         
2058         * namespace.cs (Namespace.AddDeclSpace): Lazy declspaces
2059         initialization.
2060         (Namespace.GetSignatureForError): New method.
2061         
2062         * tree.cs (Tree.RecordDecl): Moved to AddToContainer.
2063         (RootTypes.AddToTypeContainer): se inheritance insted of if(s).
2064
2065 2005-08-01  Raja R Harinath  <rharinath@novell.com>
2066
2067         Fix #75669.
2068         * ecore.cs (Expression.MemberLookupFailed): Use queried_type for
2069         member lookup rather than qualifier_type, since qualifier_type can
2070         be null.
2071
2072 2005-08-01  Marek Safar  <marek.safar@seznam.cz>
2073
2074         * enum.cs (Enum.VerifyClsName): Fixed to allow not CLSCompliant
2075         enum member.
2076
2077 2005-07-31  Miguel de Icaza  <miguel@novell.com>
2078
2079         * statement.cs: Copy the local exception into the exception
2080         captured local.  Fixes 75674
2081
2082 2005-07-31  Raja R Harinath  <harinath@gmail.com>
2083
2084         Fix #75658.
2085         * expression.cs (Invocation.OverloadResolve): Don't report error
2086         CS1501 if error CS1502 has been reported.
2087         (New.DoResolve): Delegate CS1501 reporting to
2088         Invocation.OverloadResolve.
2089
2090         Fix #75656.
2091         * statement.cs (Block.CheckInvariantMeaningInBlock): Verify
2092         invariant-meaning-in-block property in an enclosing block if
2093         necessary.
2094
2095 2005-07-29  Marek Safar  <marek.safar@seznam.cz>
2096
2097         * statement.cs (SwitchLabel.ResolveAndReduce): Refactored.
2098         (SwitchLabel.Erorr_AlreadyOccurs): Share error message.
2099         (Switch.CheckSwitch): Just save 50kb for SWF.
2100
2101 2005-07-27  Martin Baulig  <martin@ximian.com>
2102
2103         * anonymous.cs (CaptureContext.AddField): Added
2104         `AnonymousContainer am' argument; compute its toplevel scope if
2105         it's not already computed.  Fixes #75649.
2106
2107 2005-07-26  Raja R Harinath  <rharinath@novell.com>
2108
2109         Fix #75628.
2110         * class.cs (Constructor.Emit): Reset block to null if the block
2111         resolve fails.
2112
2113 2005-07-25  Marek Safar  <marek.safar@seznam.cz>
2114
2115         * class.cs (TypeContainer.VerifyMembers): Be compatible in warning 169.
2116
2117 2005-07-25  Marek Safar  <marek.safar@seznam.cz>
2118
2119         * class.cs (MethodData.Define): Check whether accessor implementing
2120         interface is public.
2121
2122         * driver.cs (Driver.parse): Try to be smart and check for `MZ' header.
2123
2124 2005-07-22  Marek Safar  <marek.safar@seznam.cz>
2125
2126         Fix #57245
2127         * namespace.cs (LookupType): Moved same type check to...
2128         
2129         * typemanager.cs (LookupTypeReflection): Don't allow to import more types
2130         with the same name.
2131
2132 2005-07-21  Raja R Harinath  <rharinath@novell.com>
2133
2134         * namespace.cs (NamespaceLookupType): Avoid a string allocation when we
2135         already found a typebuilder.
2136         * class.cs (MethodCore.IsDuplicateImplementation): Compare
2137         MemberNames, not strings.
2138
2139         * const.cs (Error_ExpressionMustBeConst): 
2140         Rename from Error_EpressionMustBeConst.
2141         * const.cs, class.cs, statement.cd: Update.
2142
2143 2005-07-21  Marek Safar  <marek.safar@seznam.cz>
2144
2145         Fix #65573
2146
2147         * const.cs (Const.LookupConstantValue): Report missing contant expression
2148         everytime.
2149         (Error_EpressionMustBeConstant): Only one error method.
2150
2151         * class.cs, statement.c: Updated.
2152
2153 2005-07-20  Raja R Harinath  <rharinath@novell.com>
2154
2155         * statement.cs (Block.Flags): Add back HasVarargs.
2156         (Block.flags): Make protected.
2157         (ToplevelBlock.HasVarargs): Convert to a property that updates flags.
2158
2159         * typemanager.cs (types, typecontainers, user_types): Remove.
2160         (UserTypes, TypeContainers): Likewise.
2161         (HandleDuplicate, AddDelegateType, AddEnumType): Likewise.
2162         (CleanUp, Reset): Update.
2163         (AddUserType): Combine variants.  Now, only updates builder_to_declspace.
2164         (GetNestedType): Use Type.GetNestedType.
2165         (CoreLookupType): Take two arguments, the namespace and the
2166         basename of the type.  Update to use the Namespace.Lookup
2167         mechanism.
2168         (InitEnumUnderlyingTypes, InitCoreTypes): Update.
2169         (RealMemberLookup): Use IsNestedChildOf instead of playing with
2170         string concatenation and substring matches.
2171         * class.cs, enum.cs, delegate.cs: Update to changes.
2172
2173 2005-07-20  Marek Safar  <marek.safar@seznam.cz>
2174
2175         * constant.cs (Constant.Error_ConstantValueCannotBeConverted): Moved from
2176         Expression and made virtual.
2177
2178         * convert.cs (ImplicitReferenceConversionExists): Skip for value types.
2179         (ImplicitStandardConversionExists): Fixed `byte' typo ?
2180
2181         * ecore.cs (Expression.Error_ConstantValueCannotBeConverted): Moved.
2182
2183         * literal.cs (NullLiteral.Error_ConstantValueCannotBeConverted): Customize
2184         error message.
2185
2186         * convert.cs, ecore.cs, enum.cs: Reflect Error_ConstantValueCannotBeConverted
2187         change.
2188
2189 2005-07-18  Marek Safar  <marek.safar@seznam.cz>
2190
2191         Fix #57707
2192         * codegen.cs (AssemblyClass.ApplyAttributeBuilder): Check whether
2193         AssemblyCultureAttribute is not used on executable.
2194
2195         * rootcontext.cs,
2196         * typemanager.cs: Add System.Reflection.AssemblyCultureAttribute.
2197
2198 2005-07-16  Raja R Harinath  <rharinath@novell.com>
2199
2200         Fix #60638.
2201         * expression.cs (Binary.Warning_UnintendeReferenceComparison):
2202         New.  Reports CS0252/CS0253.
2203         Mostly taken from preliminary patch by Duncak Mak.
2204         (Binary.DoResolveOperator): Store results of operator lookup.
2205         Use them to detect if we need to warn about unintended reference
2206         comparisons.
2207
2208 2005-07-15  Raja R Harinath  <rharinath@novell.com>
2209
2210         Fix #72969.
2211         * namespace.cs (Namespace.Lookup): Add back location parameter.
2212         (Namespace.LookupType): Add CS0436 report.  Add location parameter.
2213         * delegate.cs, ecore.cs, expression.cs: Update to changes.
2214
2215         * codegen.cs (EmitContext.DeclSpace): Make readonly.
2216         * namespace.cs (Namespace.Lookup): Carve out type lookup into ...
2217         (Namespace.LookupType): ... this.
2218         (NamespaceEntry.GetUsingTable): Allocate only one zero-sized array
2219         of namespaces.
2220         * typemanager.cs (LookupTypeReflection): Remove buggy code that
2221         purported to handle pointers.
2222         (char_ptr_type, void_ptr_type): Use GetPointerType rather than
2223         CoreLookupType.
2224
2225 2005-07-15  Marek Safar  <marek.safar@seznam.cz>
2226
2227         * expression.cs (MemberAccess.ResolveNamespaceOrType): Don't report nested
2228         type as namespace.
2229
2230 2005-07-15  Raja R Harinath  <rharinath@novell.com>
2231
2232         * namespace.cs (Namespace.Lookup): Drop location parameter.
2233         (NamespaceEntry.LookupAlias): Remove.  Merge into ...
2234         (NamespaceEntry.Lookup): ... this.
2235         (NamespaceEntry.Error_AmbiguousTypeReference):
2236         Move here from DeclSpace.
2237         (NamespaceEntry.LookupNamespaceOrType): Move support for dotted
2238         names ...
2239         * ecore.cs (TypeLookupExpression.DoResolveAsTypeStep): ... here.
2240         * decl.cs (DeclSpace.ErrorAmbiguousTypeReference):
2241         Move to NamespaceEntry.
2242         * delegate.cs, expression.cs: Update to changes.
2243
2244 2005-08-31  Martin Baulig  <martin@ximian.com>
2245
2246         Committing a patch from Atsushi Enomoto for #75850.
2247
2248         * statement.cs (Foreach.CollectionForeach.GetEnumeratorFilter):
2249         Prefer a generic enumerator over a non-generic one.
2250
2251 2005-08-26  Kornél Pál  <kornelpal@hotmail.com>
2252
2253         * AssemblyInfo.cs: Using Consts.MonoVersion instead of MonoVersion.cs.
2254         * gmcs.exe.sources: Using Consts.MonoVersion instead of MonoVersion.cs.
2255
2256 2005-08-25  Atsushi Enomoto  <atsushi@ximian.com>
2257
2258         * driver.cs : reverting default encoding change as well as mcs.
2259
2260 2005-08-25  Atsushi Enomoto  <atsushi@ximian.com>
2261
2262         * driver.cs, support.cs : merged r48826.
2263           Marek Safer wrote:
2264           > could you integrate your mcs changes to gmcs otherwise
2265           > gmcs cannot compile some files.
2266
2267 2005-08-20  Martin Baulig  <martin@ximian.com>
2268
2269         * anonymous.cs (CaptureContext.CaptureThis): Create the topmost
2270         scope if we don't already have it.
2271
2272         * expression.cs (Invocation.EmitCall): Use `ec.EmitThis ()' rather
2273         than `ig.Emit (OpCodes.Ldarg_0)' to make it work inside iterators;
2274         fixes #75867.
2275
2276 2005-07-31  Miguel de Icaza  <miguel@novell.com>
2277
2278         * statement.cs: Copy the local exception into the exception
2279         captured local.  Fixes 75674
2280
2281 2005-07-15  Marek Safar  <marek.safar@seznam.cz>
2282
2283         * expression.cs (MemberAccess.ResolveNamespaceOrType): Don't report nested
2284         type as namespace.
2285
2286 2005-08-12  Martin Baulig  <martin@ximian.com>
2287
2288         * expression.cs (MemberAccess.ResolveNamespaceOrType): Only search
2289         for nested types here to avoid hitting the cache too early.
2290
2291 2005-08-09  Miguel de Icaza  <miguel@novell.com>
2292
2293         * enum.cs: On the new compiler CLS error 3005 is now a warning not
2294         an error. 
2295
2296 2005-08-03  Martin Baulig  <martin@ximian.com>
2297
2298         Make iterators in generic methods work; see gtest-191.cs.
2299
2300         * generic.cs
2301         (Constraints.Resolve): Protect against being called twice.
2302
2303         * class.cs
2304         (TypeContainer.GetClassBases): Make this `protected virtual'.
2305
2306         * iterator.cs (Iterator.ctor): Added `GenericMethod' argument.
2307         (Iterator.GetClassBases): Override this and compute the base
2308         classes here.
2309         (Iterator.DefineNestedTypes): If we're a generic method, all our
2310         method type parameters become class type parameters on the proxy
2311         class.
2312
2313         * statement.cs
2314         (ToplevelBlock.Parameters): Make this a property, not a field.
2315         (ToplevelBlock.ResolveMeta): Update the `parameters' from the `ip'.
2316
2317 2005-08-03  Martin Baulig  <martin@ximian.com>
2318
2319         * typemanager.cs (TypeManager.IsSubclassOf): Use
2320         `TypeManager.IsEqual' instead of `Type.Equals'; fixes gtest-190.cs.
2321         (TypeManager.GetFullName_recursed): Improved.
2322
2323 2005-07-27  Carlos Alberto Cortez <calberto.cortez@gmail.com>
2324
2325         Fix #75417
2326         * ecore.cs (Expression.IsAccessorAccessible): Change the check for
2327         Private accessor case, using TypeManager.IsPrivateAccessible instead of
2328         invocation_type == mi.DeclaringType, since the first one also checks
2329         other condition used by generic instances.
2330         
2331 2005-07-27  Martin Baulig  <martin@ximian.com>
2332
2333         * anonymous.cs (CaptureContext.AddField): Added
2334         `AnonymousContainer am' argument; compute its toplevel scope if
2335         it's not already computed.  Fixes #75649.
2336
2337 2005-07-14  Marek Safar  <marek.safar@seznam.cz>
2338
2339         * attribute.cs (Attribute.ResolveAttributeType): Renamed from
2340         CheckAttributeType and refactored.
2341         (Attribute.ResolvePossibleAttributeType): Changed to reuse
2342         ResolveAsTypeTerminal error handling.
2343         (ResolveAsTypeTerminal): Introduced because of global attributes extra
2344         handling.
2345         (GetSignatureForError): Print errors in same way.
2346
2347         * class.cs,
2348         * codegen.cs: Reflect attribute GetSignatureForError change.
2349
2350         * ecore.cs,
2351         * expression.cs: Add silent parameter to ResolveAsTypeStep.
2352
2353         * namespace.cs (UsingEntry): Refactored to make fields private.
2354
2355         * assign.cs,
2356         statement.cs: Error_UnexpectedKind has extra parameter.
2357
2358 2005-07-14  Raja R Harinath  <rharinath@novell.com>
2359
2360         * ecore.cs (IAlias): Remove.
2361         * decl.cs (DeclSpace): Don't derive from IAlias.  Remove members
2362         that implement the interface.
2363         * namespace.cs (Namespace): Likewise.
2364         (Namespace.declspaces): Renamed from 'defined_names'.
2365         (Namespace.AddDeclSpace): Renamed from 'DefineName'.  Take a
2366         DeclSpace instead of an IAlias.
2367         * tree.cs (Tree.AddDecl): Update.
2368
2369 2005-07-12  Raja R Harinath  <rharinath@novell.com>
2370
2371         * statement.cs (Block.Flags); Remove HasVarargs.
2372         (Block.HasVarargs): Move to ToplevelBlock.
2373         (Block.ThisVariable, Block.AddThisVariable): Likewise.
2374         (Block.Variables): Make protected.  Initialize variable hashtable
2375         if necessary.
2376         (Block.AddVariable): Update.
2377         (Block.Resolve): Update to changes.
2378         (ToplevelBlock.HasVarargs): New boolean.
2379         (ToplevelBlock.ThisVariable): Move here from Block.
2380         (ToplevelBlock.AddThisVariable): Likewise.
2381         (ToplevelBlock.IsThisAssigned): New.  Forwards call to this_variable.
2382         * expression.cs (This.ResolveBase): Update to changes.
2383         (ArglistAccess.DoResolve): Likewise.
2384
2385 2005-07-11  Marek Safar  <marek.safar@seznam.cz>
2386
2387         Fix #75321
2388         * ecore.cs, class.cs: Use SetAssigned instead of direct access.
2389
2390         * class.cs (TypeContainer.VerifyMembers): Distinguish between
2391         not used and not used & assigned.
2392         (FieldBase.ASSIGNED): Moved to MemberCore.Flags.
2393
2394 2005-07-11  Marek Safar  <marek.safar@seznam.cz>
2395
2396         Fix #75053
2397         * expression.cs (Is.DoResolve): null is never provided type.
2398
2399 2005-07-08  Marek Safar  <marek.safar@seznam.cz>
2400
2401         Fix #52496
2402         * cs-parser.jay: Less strict event error rule to catch more errors.
2403
2404 2005-07-11  Martin Baulig  <martin@ximian.com>
2405
2406         * generic.cs (ConstructedType.CheckConstraints): Improve the check
2407         for the constructor constraint: we do not only have to check
2408         whether the class has a public constructor, but also ensure that
2409         it's parameterless.  Fixes #75492.
2410
2411 2005-07-11  Martin Baulig  <martin@ximian.com>
2412
2413         * expression.cs (Binary.ResolveOperator): Only allow `==' and `!='
2414         between type parameters if they either have the reference type
2415         constraint or the class constraint.
2416
2417 2005-07-10  Kamil Skalski <nazgul@nemerle.org>
2418
2419         * generic.cs: Use MakeGenericType instead of BindGenericParameters.
2420
2421 2005-07-07  Marek Safar  <marek.safar@seznam.cz>
2422
2423         Fix #74975
2424         * attribute.cs (orig_sec_assembly): Holds original version of assembly.
2425         (ExtractSecurityPermissionSet): Cope with self referencing security
2426         attributes properly.
2427
2428         * driver.cs (SetOutputFile): Made public property OutputFile.
2429
2430 2005-07-07  Raja R Harinath  <rharinath@novell.com>
2431
2432         Fix #75486.
2433         * class.cs (TypeContainer.first_nonstatic_field): Rename from
2434         has_nonstatic_fields.  Make into a FieldBase pointer.
2435         (TypeContainer.AddField): Add CS0282 check.
2436         (TypeContainer.EmitType): Update.
2437
2438 2005-07-06  Miguel de Icaza  <miguel@novell.com>
2439
2440         * cs-tokenizer.cs (consume_identifier): Do not create strings to
2441         compare if they start with __.
2442
2443 2005-07-06  Raja R Harinath  <rharinath@novell.com>
2444
2445         * statement.cs (Switch.SwitchGoverningType): Only look at
2446         UserCasts that don't need implicit standard conversions to one of
2447         the allowed switch types (Fixes test-322.cs).
2448         (LocalInfo.Resolve): Re-enable sanity-test.
2449
2450 2005-07-06  Marek Safar  <marek.safar@seznam.cz>
2451
2452         * cs-tokenizer.cs (consume_identifier): Detect double undescores
2453         
2454         * ecore.cs (FieldExpr.AddressOf): Changed volatile error to warning.
2455         
2456         * expression.cs (Invocation.DoResolve): Report error CS0245 here.
2457
2458 2005-07-06  Raja R Harinath  <rharinath@novell.com>
2459
2460         Fix #75472.
2461         * ecore.cs (SimpleName.GetSignatureForError): Add.
2462         * expression.cs (MemberAccess.DoResolve): Don't clobber 'expr' field.
2463         (MemberAccess.GetSignatureForError): Add.
2464
2465 2005-07-05  Marek Safar  <marek.safar@seznam.cz>
2466  
2467         The big error and warning messages review.
2468         
2469         * anonymous.cs,
2470         * assign.cs,
2471         * attribute.cs,
2472         * class.cs,
2473         * codegen.cs,
2474         * convert.cs,
2475         * cs-parser.jay,
2476         * cs-tokenizer.cs,
2477         * decl.cs,
2478         * delegate.cs,
2479         * doc.cs,
2480         * driver.cs,
2481         * ecore.cs,
2482         * enum.cs,
2483         * expression.cs,
2484         * flowanalysis.cs,
2485         * iterators.cs,
2486         * literal.cs,
2487         * location.cs,
2488         * modifiers.cs,
2489         * namespace.cs,
2490         * parameter.cs,
2491         * pending.cs,
2492         * report.cs,
2493         * rootcontext.cs,
2494         * statement.cs,
2495         * support.cs,
2496         * tree.cs,
2497         * typemanager.cs: Updated.
2498         
2499         * class.cs: (MethodCore.SetYields): Moved here to share.
2500         (PropertyMethod.Define): Moved iterator setup here.
2501         
2502         * iterators.cs: Add orig_method to have full access to parent
2503         container.
2504
2505 2005-07-05  Raja R Harinath  <rharinath@novell.com>
2506
2507         Make 'fixed variable' handling standards compliant. Fix #70807, #72729.
2508         * ecore.cs (IVariable.VerifyFixed): Remove 'is_expression' parameter.
2509         (FieldExpr.VerifyFixed): Ensure that the field is part of a fixed
2510         variable of struct type.
2511         * expression.cs (Unary.ResolveOperator): Update to change.
2512         (Indirection.VerifyFixed): Likewise.
2513         (LocalVariableReference.VerifyFixed): A local variable is always fixed.
2514         (ParameterReference.VerifyFixed): Value parameters are fixed.
2515         (This.VerifyFixed): Treat 'this' as a value parameter.
2516         * statement.cs (LocalInfo.IsFixed): Remove.
2517
2518 2005-07-01  Martin Baulig  <martin@ximian.com>
2519
2520         * iterators.cs (Iterator.CapturedThisReference.Emit): Use
2521         `ec.EmitThis ()' to get the correct scope.
2522
2523 2005-07-01  Martin Baulig  <martin@ximian.com>
2524
2525         * ecore.cs (FieldExpr.DoResolve): Don't capture the field if it's
2526         instance is a ParameterReference; fixes #75299.
2527
2528 2005-06-30  Raja R Harinath  <rharinath@novell.com>
2529
2530         Fix #75412.
2531         * expression.cs (Indexers.map): Remove.
2532         (Indexers.Append): Filter out inaccessible setters and getters.
2533         (IndexerAccess.DoResolve, IndexerAccess.DoResolveLValue): Update.
2534
2535         Fix #75283.
2536         * ecore.cs (MemberExpr.EmitInstance): New.  Add CS0120 check.
2537         Refactored from ...
2538         (FieldExpr.EmitInstance, PropertyExpr.EmitInstance): ... these.
2539         (FieldExpr.Emit, PropertyExpr.Emit): Update.
2540         (FieldExpr.EmitAssign, PropertyExpr.EmitAssign): Update.
2541         * expression.cs (Invocation.EmitCall): Add CS0120 check.
2542
2543 2005-06-30  Marek Safar  <marek.safar@seznam.cz>
2544
2545         Fix #75322
2546         * class.cs (FieldBase.GetInitializerExpression): One more field
2547         for backup.
2548
2549 2005-06-28  Miguel de Icaza  <miguel@novell.com>
2550
2551         * pending.cs: Do not define a proxy if the base method is virtual,
2552         it will be picked up by the runtime (bug 75270).
2553
2554 2005-07-08  Martin Baulig  <martin@ximian.com>
2555
2556         * anonymous.cs (CaptureContext.EmitParameterInstance): Correctly
2557         handle parameters in nested scopes; fixes #74808; see gtest-188.cs.
2558
2559 2005-07-07  Martin Baulig  <martin@ximian.com>
2560
2561         * generic.cs (ConstructedType.CheckConstraint): Use
2562         ResolveAsTypeStep(), not ResolveAsTypeTerminal() so we're not
2563         called recursively; fixes #75329.
2564
2565 2005-07-06  Martin Baulig  <martin@ximian.com>
2566
2567         * generic.cs (TypeManager.InferTypeArguments): Added support for
2568         anonymous methods; fixes #75461.
2569
2570 2005-07-01  Martin Baulig  <martin@ximian.com>
2571
2572         * iterators.cs (Iterator.CapturedThisReference.Emit): Use
2573         `ec.EmitThis ()' to get the correct scope.
2574
2575 2005-07-01  Martin Baulig  <martin@ximian.com>
2576
2577         * ecore.cs (FieldExpr.DoResolve): Only capture the field if it's
2578         instance is `This'; fixes #75299.
2579
2580 2005-06-30  Martin Baulig  <martin@ximian.com>
2581
2582         * class.cs (Indexer): Implement IIteratorContainer; added support
2583         for iterators in indexers.
2584
2585         * codegen.cs
2586         (EmitContext.CurrentIterator): Make this a property, not a field.
2587
2588         * anonymous.cs (AnonymousContainer.Iterator): New public property.
2589
2590 2005-06-28  Miguel de Icaza  <miguel@novell.com>
2591
2592         * pending.cs: Do not define a proxy if the base method is virtual,
2593         it will be picked up by the runtime (bug 75270).
2594
2595 2005-06-28  Martin Baulig  <martin@ximian.com>
2596
2597         * cs-parser.jay (interface_method_declaration): Avoid a
2598         reduce/reduce conflict by moving some of the code into a separate
2599         `interface_method_declaration_body' rule; fixes #75368.
2600
2601 2005-06-28  Martin Baulig  <martin@ximian.com>
2602
2603         * typemanager.cs (TypeManager.MemberLookup_FindMembers): Move the
2604         array check after the check for TypeBuilder's.
2605
2606 2005-06-21  Raja R Harinath  <rharinath@novell.com>
2607
2608         * convert.cs (FindMostEncompassedType): Add two trivial special
2609         cases (number_of_types == 0 || number_of_types == 1).
2610         (FindMostEncompasingType): Likewise.
2611
2612 2005-06-17  Raja R Harinath  <rharinath@novell.com>
2613
2614         Some cleanups preparing for the fix of #75283.
2615         * ecore.cs (PropertyExpr.InstanceResolve): Tighten conditions for
2616         error testing.
2617         (EventExpr.InstanceResolve): Likewise.
2618         (EventExpr.DoResolve): Remove redundant checks.
2619
2620 2005-06-08  Miguel de Icaza  <miguel@novell.com>
2621
2622         * class.cs: Small fix.
2623
2624 2005-06-08  Raja R Harinath  <rharinath@novell.com>
2625
2626         Fix #75160.
2627         * class.cs (GetPartialBases): Fix return value check of
2628         part.GetClassBases.
2629
2630 2005-06-07  Raja R Harinath  <rharinath@novell.com>
2631
2632         Ensure that partial classes are registered in their enclosing
2633         namespace.  Initial part of fix of #75160.
2634         * tree.cs (Tree.RecordDecl): Add new namespace argument.
2635         Register declspace with namespace here, not in
2636         DeclSpace.RecordDecl.
2637         * cs-parser.jay: Pass namespace to RecordDecl.
2638         * class.cs (PartialContainer.Create): Likewise.
2639         (ClassPart.DefineType): New sanity-check.  Throws an exception if
2640         called.
2641         * decl.cs (Declspace.RecordDecl): Remove.
2642         * namespace.cs (NamespaceEntry.DefineName): Remove.
2643
2644 2005-06-06  Marek Safar  <marek.safar@seznam.cz>
2645
2646         * rootcontext.cs: Reset TargetExt as well.
2647
2648 2005-06-03  Raja R Harinath  <rharinath@novell.com>
2649
2650         * ecore.cs (Expression.Resolve): Emit CS0654 error when
2651         -langversion:ISO-1.
2652
2653 2005-06-02  Raja R Harinath  <rharinath@novell.com>
2654
2655         Fix #75080, cs0119.cs.
2656         * ecore.cs (Expression.ExprClassToResolveFlags): New.  Broken out
2657         of ...
2658         (Expression.Resolve): ... this.  Use it.  Remove bogus code
2659         allowing ExprClass.Type and ExprClass.Namespace for
2660         ResolveFlags.VariableOrValue.
2661         (Expression.Resolve) [1-argument variant]: Change default resolve
2662         flags based on language version.
2663         (Expression.Error_UnexpectedKind): Use a simple string array
2664         rather than an ArrayList.
2665         * expression.cs (TypeOf.DoResolve): Set eclass to ExprClass.Value,
2666         not ExprClass.Type.
2667         (TypeOfVoid.DoResolve): Likewise.
2668         (MemberAccess.DoResolve) [3-argument variant]: Make private.  Drop
2669         flags argument -- it always has the same value.
2670
2671 2005-05-31  Raja R Harinath  <rharinath@novell.com>
2672
2673         Fix #75081.
2674         * ecore.cs (Expression.ResolveLValue): Add a Location parameter.
2675         Use it in the error message.
2676         * assign.cs, expression.cs, statement.cs: Update.
2677
2678 2005-05-30  Raja R Harinath  <rharinath@novell.com>
2679
2680         Fix #75088.
2681         * ecore.cs (Expression.MemberLookupFailed): Add CS0122 check in
2682         the "almostMatchedMember" case too.
2683         * typemanager.cs (Closure.CheckValidFamilyAccess): Add anything
2684         that failed the accessibility checks to 'almost_match'.
2685
2686 2005-05-27  Vladimir Vukicevic  <vladimir@pobox.com>
2687
2688         * attribute.cs: Use internal MethodBuilder methods to set
2689         ExactSpelling and SetLastError on PInvoke methods, instead
2690         of passing them via charset.  Fixes #75060.
2691
2692 2005-05-27  Raja R Harinath  <rharinath@novell.com>
2693
2694         * parameter.cs (Parameter): Remove TODO comment.
2695         (Parameter.DefineParameter): Remove Location parameter.
2696         (Parameters.LabelParameters): Likewise.
2697         * class.cs (Constructor.Emit): Update to change.
2698         (MethodData.Emit): Likewise.
2699         * anonymous.cs (AnonymousMethod.EmitMethod): Likewise.  
2700         * delegate.cs (Delegate.Define, Delegate.Emit): Likewise.
2701
2702 2005-05-27  Atsushi Enomoto  <atsushi@ximian.com>
2703
2704         * parameter.cs,
2705           Removed Parameters.Location and added Parameter.Location instead.
2706           Removed Location parameter from Emit() and GetSignature().
2707         * anonymous.cs,
2708           class.cs,
2709           cs-parser.jay,
2710           delegate.cs,
2711           iterators.cs,
2712           statement.cs :
2713           Modified all related calls.
2714
2715 2005-06-21  Martin Baulig  <martin@ximian.com>
2716
2717         * generic.cs (NullCoalescingOperator.Emit): Make this work if the
2718         left-hand side is not a nullable type; fixes #75328.
2719
2720 2005-06-21  Martin Baulig  <martin@ximian.com>
2721
2722         * typemanager.cs
2723         (TypeManager.CSharpName): Use GetFullName() instead of `t.FullName'.
2724         (TypeManager.GetFullNameSignature): Likewise.
2725
2726         * convert.cs (Convert.Error_CannotImplicitConversion): Compare
2727         `source.FullName' and `target.FullName' to check whether there are
2728         two conflicting definitions.
2729
2730 2005-06-21  Martin Baulig  <martin@ximian.com>
2731
2732         * convert.cs (Convert.ImplicitTypeParameterConversion): Always use
2733         a BoxedCast - also for reference types - to be compatible with csc.
2734
2735 2005-06-21  Martin Baulig  <martin@ximian.com>
2736
2737         * expression.cs (MemberAccess.DoResolve): Add support for nested
2738         types in a generic instance; fixes #75320.
2739
2740 2005-06-20  Martin Baulig  <martin@ximian.com>
2741
2742         * generic.cs (TypeManager.InferType): Also walk the class
2743         hierarchy for generic instances; fixes #75261.
2744
2745 2005-06-17  Martin Baulig  <martin@ximian.com>
2746
2747         * typemanager.cs (TypeManager.IsBuiltinType): Use TypeToCoreType()
2748         to make things work for corlib.
2749
2750 2005-06-15  Martin Baulig  <martin@ximian.com>
2751
2752         * attribute.cs (Attribute.CheckSecurityActionValidity): Remove the
2753         obsolete `SecurityAction' values.
2754
2755 2005-06-06  Marek Safar  <marek.safar@seznam.cz>
2756
2757         * rootcontext.cs: Reset TargetExt as well.
2758         
2759 2005-06-09  Martin Baulig  <martin@ximian.com>
2760
2761         * delegate.cs (Delegate.VerifyMethod): Added
2762         `MethodGroupExpr old_mg' argument; inherit its
2763         `HasTypeParameters'; fix #75085.
2764
2765 2005-06-09  Martin Baulig  <martin@ximian.com>
2766
2767         * expression.cs (Invocation.OverloadResolve): Correctly handle
2768         generic methods for the SetMemberIsUsed(); fix #75064.
2769
2770 2005-06-09  Martin Baulig  <martin@ximian.com>
2771
2772         * statement.cs (Throw.Resolve): Use TypeManager.IsSubclassOf();
2773         fixes #75062.
2774
2775 2005-06-08  Martin Baulig  <martin@ximian.com>
2776
2777         * cs-parser.jay (nullable_type_or_conditional): If we put the
2778         nullable back and our `type' is a `ComposedCast', remove the
2779         nullable from it.  Fixes #75156.
2780
2781         * expression.cs (ComposedCast.RemoveNullable): New public method.
2782
2783 2005-06-08  Martin Baulig  <martin@ximian.com>
2784
2785         The big Iterators rewrite :-)
2786
2787         * iterators.cs: Rewrite this to use the anonymous methods framework.
2788
2789         * rootcontext.cs (RootContext.DefineTypes): Define Delegates
2790         before the TypeContainers; see 2test-21.cs.
2791
2792         * class.cs
2793         (TypeContainer.DefineType): Don't create a new EmitContext if we
2794         already have one (this only happens if we're an Iterator).
2795         (TypeContainer.Define): Also call Define() on all our iterators.
2796         (Method.CreateEmitContext): Added support for iterators.
2797
2798         * anonymous.cs
2799         (AnonymousContainer): New abstract base class for `AnonymousMethod'.
2800         (AnonymousContainer.CreateMethodHost): Moved here from
2801         AnonymousMethod and made abstract.
2802         (AnonymousContainer.CreateScopeType): New abstract method.
2803         (AnonymousContainer.IsIterator): New public property.
2804         (ScopeInfo.EmitScopeType): Call CreateScopeType() on our Host to
2805         get the ScopeTypeBuilder rather than manually defining it here. 
2806         (ScopeInfo.EmitScopeInstance): New public method; correctly handle
2807         iterators here.
2808
2809         * driver.cs (Driver.MainDriver): Call TypeManager.InitCodeHelpers()
2810         before RootContext.DefineTypes().
2811
2812         * codegen.cs (EmitContext.RemapToProxy): Removed.
2813         (EmitContext.CurrentAnonymousMethod): Changed type from
2814         AnonymousMethod -> AnonymousContainer.
2815         (EmitContext.ResolveTopBlock): Protect from being called twice.
2816         (EmitContext.MapVariable, RemapParameter(LValue)): Removed.
2817         (EmitContext.EmitThis): Removed the iterators hacks; use the
2818         anonymous methods framework for that.
2819
2820         * statement.cs
2821         (ToplevelBlock.Container): Make this a property, not a field.
2822         (ToplevelBlock.ReParent): New public method; move the
2823         ToplevelBlock into a new container.
2824         (Foreach.TemporaryVariable): Simplify.
2825
2826 2005-06-05  Martin Baulig  <martin@ximian.com>
2827
2828         * statement.cs (LocalInfo.CompilerGenerated): New flag.
2829         (Block.AddTemporaryVariable): New public method; creates a new
2830         `LocalInfo' for a temporary variable.
2831         (Block.EmitMeta): Create the LocalBuilders for all the temporary
2832         variables here.
2833         (Foreach.TemporaryVariable): Use Block.AddTemporaryVariable() for
2834         non-iterator variables.
2835
2836 2005-06-05  Martin Baulig  <martin@ximian.com>
2837
2838         * statement.cs (Foreach.TemporaryVariable): Create the
2839         LocalBuilder in the Emit phase and not in Resolve since in some
2840         situations, we don't have an ILGenerator during Resolve; see
2841         2test-19.cs for an example.
2842
2843 2005-06-04  Martin Baulig  <martin@ximian.com>
2844
2845         The big Foreach rewrite - Part II.
2846
2847         * typemanager.cs (TypeManager.object_getcurrent_void): Replaced
2848         with `PropertyInfo ienumerator_getcurrent'.
2849
2850         * codegen.cs (VariableStorage): Removed.
2851
2852         * statement.cs
2853         (Foreach): Derive from Statement, not ExceptionStatement.
2854         (Foreach.CollectionForeach): New nested class.  Moved all the code
2855         dealing with collection foreach here.
2856         (Foreach.ForeachHelperMethods): Removed.
2857         (Foreach.TemporaryVariable): Implement IMemoryLocation.
2858
2859 2005-05-23  Martin Baulig  <martin@ximian.com>
2860
2861         * statement.cs (Try.DoResolve): Don't create a `finally' if we
2862         don't need to.  Fix #75014.
2863
2864 2005-05-26  Raja R Harinath  <rharinath@novell.com>
2865
2866         Improve user-defined conversion handling.
2867         * convert.cs (GetConversionOperators): Rewrite.  Return only the
2868         applicable operators.
2869         (AddConversionOperators): New.  Helper for GetConversionOperators.
2870         (FindMostEncompassedType, FindMostEncompassingType): Verify that
2871         there is only one most encompassed/encompassing type.
2872         (FindMostSpecificSource, FindMostSpecificTarget): Remove
2873         "applicable operator" handling.
2874         (UserConversion): Move cache here from GetConversionOperators.
2875         Directly cache the chosen operator, rather than the whole
2876         MethodGroup.
2877         (ExplicitNumericConversion): Fix buggy implementation of Decimal
2878         case.  Allow conversion of decimal to sbyte and byte too.
2879         * expression.cs (EmptyExpression.Grab, EmptyExpression.Release):
2880         New static methods.  Used to avoid allocating EmptyExpressions in
2881         convert.cs.
2882
2883 2005-05-24  Duncan Mak  <duncan@novell.com>
2884
2885         * ecore.cs (CastFromDecimal): New class for casting a decimal to
2886         another class, used in Convert.ExplicitNumericConversion.
2887         (CastToDecimal): New class, similar to above, but casts to
2888         System.Decimal, used in Convert.ImplicitNumericConversion and also
2889         in explicit convesion from double/float to decimal.
2890
2891         * convert.cs (ImplicitNumericConversion): Handle implicit
2892         conversions to System.Decimal.
2893         (ExplicitNumericConversion): handle explicit conversions to
2894         System.Decimal.
2895
2896         This fixes #68711.
2897         
2898 2005-05-20  Miguel de Icaza  <miguel@novell.com>
2899
2900         * typemanager.cs: Do not throw an exception in the TypeBuilder
2901         case, we take care of it on the TypeCode.
2902
2903 2005-05-17  Marek Safar  <marek.safar@seznam.cz>
2904         
2905         * attribute.cs (Attribute.ResolveArguments): GuidAttribute check
2906         is back.
2907         
2908         * cs-parser.jay: Catch more lexical errors.
2909         
2910         * report.cs: Add one more Error method.
2911         
2912         * rootcontext.cs,
2913         * typemanager.cs: Register System.Runtime.InteropServices.GuidAttribute
2914
2915 2005-05-20  Martin Baulig  <martin@ximian.com>
2916
2917         * class.cs (TypeContainer.CircularDepException): Removed.
2918         (TypeContainer.DefineType): Removed the `InTransit' stuff.
2919         (TypeContainer.CheckRecursiveDefinition): Check for circular class
2920         (CS0146) and interface (CS0529) dependencies here.
2921
2922 2005-05-20  Martin Baulig  <martin@ximian.com>
2923
2924         * expression.cs (New.DoResolve): Move the CS0712 check above the
2925         CS0144 check; otherwise it can never be reached.
2926
2927 2005-05-20  Martin Baulig  <martin@ximian.com>
2928
2929         * cs-parser.jay: Fix CS0080 check; add CS0231 and CS0257 from MCS.
2930
2931 2005-05-20  Martin Baulig  <martin@ximian.com>
2932
2933         * class.cs (TypeContainer.DefineType): Fix CS0698 check.
2934
2935         * typemanager.cs (TypeManager.IsAttributeType): New public method.
2936
2937 2005-05-19  Martin Baulig  <martin@ximian.com>
2938
2939         * delegate.cs
2940         (ImplicitDelegateCreation.Check): Added `bool check_only' argument
2941         to disable error reporting.
2942
2943         * convert.cs (Convert.ImplicitStandardConversionExists): Use it
2944         here since we don't want to report an error; see the new test-336.cs.
2945
2946 2005-05-19  Raja R Harinath  <rharinath@novell.com>
2947
2948         * statement.cs (ToplevelBlock.GetParameterReference)
2949         (ToplevelBlock.IsParameterReference,ToplevelBlock.IsLocalParameter):
2950         Move here from class Block.
2951         * ecore.cs (SimpleName.SimpleNameResolve): Update to changes.
2952         * expression.cs (ParameterReference.DoResolveBase): Likewise.
2953
2954 2005-05-18  Martin Baulig  <martin@ximian.com>
2955
2956         Fix #74978.
2957
2958         * flowanalysis.cs
2959         (FlowBranching.Reachability): Add non-static public And() and Or()
2960         methods.
2961         (FlowBranchingSwitch): New class; do the `break_origins' thing
2962         like in FlowBranchingLoop.
2963         (FlowBranching.UsageVector.MergeBreakOrigins): Also merge the
2964         reachability, not just locals and parameters.
2965         (FlowBranching.MergeChild): Remove some of the hacks for loop and
2966         switch; MergeBreakOrigins() now takes care of that.
2967
2968 2005-05-18  Martin Baulig  <martin@ximian.com>
2969
2970         * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
2971         a loop and may leave it, reset the barrier; fixes #74974.
2972
2973 2005-05-16  Raja R Harinath  <rharinath@novell.com>
2974
2975         Fix test-382.cs.  Emit values of decimal constants.
2976         * class.cs (TypeContainer.RegisterFieldForInitialization): New.
2977         Carved out of ...
2978         (TypeContainer.AddField): ... this.
2979         (TypeContainer.EmitFieldInitializers): Allow the list of fields
2980         with initializers to include 'Const's.
2981         (ClassPart.RegisterFieldForInitialization): Forward to
2982         PartialContainer.
2983         * const.cs (Const.Const): Pass initializer to base class.
2984         (Const.Define): In case of decimal constants, register them for
2985         initialization in a static constructor.
2986
2987 2005-05-14  Martin Baulig  <martin@ximian.com>
2988
2989         * statement.cs (Block.Resolve): Correctly handle unreachable code;
2990         do not call ResolveUnreachable() on unreachable statements in
2991         here, see the comment in the source code.
2992
2993 2005-05-13  Raja R Harinath  <rharinath@novell.com>
2994
2995         Fix #74934.
2996         * expression.cs (BinaryResolveOperator): If one of the operands of
2997         an equality comparison is 'null' and the other is a pointer type,
2998         convert the null to a NullPointer.
2999         * convert.cs (ImplicitReferenceConversion): If the expression is a
3000         NullLiteral and the target type is a pointer type, return a
3001         NullPointer instead.
3002         (ImplicitConversionStandard): Likewise.
3003
3004 2005-05-13  Marek Safar  <marek.safar@seznam.cz>
3005         
3006         * cs-parser.jay: Set readonly context based on special constructs.
3007         
3008         * expression.cs (LocalVariableReference.DoResolveBase): Improved
3009         readonly variable error handling.
3010         
3011         * rootcontext.cs (EmitCode): Don't verify members when error
3012         occurred.
3013         
3014         * statement.cs (LocalInfo): Add reaodnly context information.
3015         (SetReadOnlyContext, GetReadOnlyContext): New methods.
3016
3017 2005-05-17  Martin Baulig  <martin@ximian.com>
3018
3019         * expression.cs (Argument.Resolve): Turn on flow analysis; fix
3020         #70970. 
3021
3022 2005-05-13  Martin Baulig  <martin@ximian.com>
3023
3024         * statement.cs (Block.Resolve, ResolveUnreachable): Correctly
3025         handle unreachable blocks.
3026
3027 2005-05-13  Martin Baulig  <martin@ximian.com>
3028
3029         * class.cs
3030         (ConstructorInitializer.GetOverloadedConstructor): Don't crash.
3031         (MethodCore.CheckCore): Use TypeManager.IsEqual(); fix #74904 and
3032         #74905. 
3033
3034 2005-05-13  Martin Baulig  <martin@ximian.com>
3035
3036         * statement.cs (Block.Resolve): Make the `bool unresolved' flag an
3037         instance variable, not a local.  Fix #74873.
3038         (Block.ResolveUnreachable): Set it to true here.
3039
3040 2005-05-12  Martin Baulig  <martin@ximian.com>
3041
3042         * cs-parser.jay (property_declaration): Pass the `current_class',
3043         not the `current_container' to Property's .ctor.  Fixes #74912.
3044
3045 2005-05-11  Martin Baulig  <martin@ximian.com>
3046
3047         * typemanager.cs (Closure): Copy this from MCS and merge all the
3048         GMCS-specific changes into it.
3049
3050 2005-05-12  Raja R Harinath  <harinath@gmail.com>
3051
3052         Fix #74920.
3053         * typemanager.cs (unmanaged_enclosing_types): New.
3054         (IsUnmanagedType): Avoid infloops by using
3055         'unmanaged_enclosing_types' to talk with recursive invocations.
3056
3057 2005-05-11  Duncan Mak  <duncan@novell.com>
3058
3059         * cs-tokenizer.cs (get_cmd_arg): Check that 'c' is not -1 before
3060         continuing to process for 'arg'.
3061         (handle_preprocessing_directive): Check the argument of the #endif
3062         directive and report error CS1025 if there are any trailing
3063         characters.
3064
3065         According to the C# spec, having even whitespace after the #endif
3066         directive is illegal; however, because we call arg.TrimEnd ()
3067         beforehand, we have the same behavior as csc, allowing whitespace
3068         after the directive.
3069
3070         Fixes #74892.
3071
3072 2005-05-11  Marek Safar  <marek.safar@seznam.cz>
3073
3074         Fix #74863.
3075         
3076         * class.cs (ConstructorInitializer.GetOverloadedConstructor): Removed.
3077         (Constructor.GetObsoleteAttribute): Implemented correctly.
3078
3079 2005-05-10  Martin Baulig  <martin@ximian.com>
3080
3081         * generic.cs (Constraints.Resolve): Report CS0246 if we cannot
3082         resolve the type; fixes #74864.
3083         (DefaultValueExpression): Create the LocalTemporary in Emit(), not
3084         in DoResolve(); fixes #74862.
3085
3086 2005-05-10  Martin Baulig  <martin@ximian.com>
3087
3088         * support.cs (ReflectionParameters.ParameterModifier): Use
3089         `Parameter.Modifier.REF' if we both have `ParameterAttributes.Out'
3090         and `ParameterAttributes.In'.  Fixes #74884.
3091
3092 2005-05-10  Martin Baulig  <martin@ximian.com>
3093
3094         * typemanager.cs (TypeManager.MemberLookup_FindMembers): Don't use
3095         the cache if we're just looking for `MemberTypes.NestedType' in a
3096         generic instance.
3097
3098         * ecore.cs (Expression.ResolveAsTypeTerminal): Don't check the
3099         constraints if we're still resolving the type tree.
3100         (Expression.MemberLookup): If we're resolving the type tree, only
3101         look for `MemberTypes.NestedType' since we're only interested in
3102         getting types.
3103
3104         * class.cs (TypeContainer.DefineType): Don't resolve the type
3105         parameters here; do this later in ResolveType() after the type
3106         tree has been resolved.
3107         (TypeContainer.ResolveType): New public method; this is called
3108         after the type tree is resolved and before the types are being
3109         populated.  We resolve the generic constraints here.
3110         (TypeContainer.DoDefineMember): Check the constraints on our base
3111         class and interfaces.
3112
3113         * decl.cs (DeclSpace.ResolveBaseTypeExpr): Make this protected;
3114         set the `ResolvingTypeTree' flag on the EmitContext.
3115
3116         * codegen.cs (EmitContext.ResolvingTypeTree): New public field.
3117
3118 2005-05-10  Marek Safar  <marek.safar@seznam.cz>
3119
3120         * class.cs (Method.Define): Catch attempt for Finalizer declaration.
3121         
3122         * expression.cs (Argument.GetParameterModifier): Turned to property.
3123         (Invocation.Error_InvalidArguments): Add more descriptive errors.
3124         
3125         * parameter.cs (Parameter.GetModifierSignature): Translates modifier to
3126         its C# equivalent.
3127         
3128 2005-05-09  Raja R Harinath  <rharinath@novell.com>
3129
3130         Fix #74852.
3131         * decl.cs (MemberCache.AddMethods): Register override methods,
3132         rather than non-override methods.
3133         * typemanager.cs (RegisterOverride): New.
3134         (IsOverride): Update.
3135
3136 2005-05-09  Marek Safar  <marek.safar@seznam.cz>
3137
3138         * typemanager.cs (TypeManager): Moved InitGenerics to Reset method.
3139
3140 2005-05-06  Martin Baulig  <martin@ximian.com>
3141
3142         * attribute.cs
3143         (Attributable.IsClsComplianceRequired): Fix typo in the method name.
3144         (AttributeTester.AnalyzeTypeCompliance): Add generics support.
3145
3146 2005-05-09  Marek Safar  <marek.safar@seznam.cz>
3147
3148         Fix #73105.
3149         
3150         * ecore.cs (SimpleName.SimpleNameResolve): Add in_transit to catch
3151         recursive declaration.
3152         
3153         * statement.cs (Block.ResolveMeta): Report any error in resolving.
3154         
3155 2005-05-06  Marek Safar  <marek.safar@seznam.cz>
3156
3157         * cfold (DoConstantNumericPromotions): Don't try to convert 0 enum.
3158         
3159         * expression.cs (Binary.DoResolve): (x && 0) is always 0.
3160
3161 2005-05-05  Raja R Harinath  <rharinath@novell.com>
3162
3163         Fix #74797.
3164         * decl.cs (DeclSpace.FamilyAccessible): 
3165         Use TypeManager.IsNestedFamilyAccessible.
3166
3167         Fix reopened #64812.
3168         * typemanager.cs (Closure.Filter): Introduce checks for 'protected
3169         internal'.
3170
3171 2005-05-04  Raja R Harinath  <rharinath@novell.com>
3172             Abin Thomas  <projectmonokochi@rediffmail.com>
3173             Anoob V E  <projectmonokochi@rediffmail.com>
3174             Harilal P R  <projectmonokochi@rediffmail.com>
3175
3176         Fix #64812.
3177         * typemanager.cs (Closure.CheckValidFamilyAccess): Don't blindly
3178         allow access to all static members.
3179
3180 2005-05-04  Martin Baulig  <martin@ximian.com>
3181
3182         * ecore.cs (FieldExpr.DoResolveLValue): Always call fb.SetAssigned().
3183
3184 2005-05-04  Martin Baulig  <martin@ximian.com>
3185
3186         Fix #74655.
3187
3188         * statement.cs (Switch.SimpleSwitchEmit): Always emit the default
3189         section at the end; make things work if `default' is not the last
3190         section.        
3191
3192 2005-05-04  Martin Baulig  <martin@ximian.com>
3193
3194         Fix #70400.
3195
3196         * statement.cs (Switch): Replaced the `got_default' field with a
3197         `default_section' one.
3198         (Switch.CheckSwitch): Set `default_section' here.
3199         (Switch.Resolve): If we're a constant switch and the constant is
3200         not found, use the default section.
3201
3202 2005-05-03  Martin Baulig  <martin@ximian.com>
3203
3204         * expression.cs (ArrayAccess.EmitGetLength): New public method.
3205
3206         * statement.cs (Foreach.ArrayForeach): New nested class.
3207         (Foreach.TemporaryVariable): New nested class.
3208         (Foreach.EmitArrayForeach): Removed; this is now in the new
3209         ArrayForeach class.
3210
3211 2005-05-03  Raja R Harinath  <rharinath@novell.com>
3212
3213         * pending.cs (BaseImplements): Move the #74773 fix here.  This is
3214         more conservative.
3215         (VerifyPendingMethods): Revert change below.
3216
3217         * typemanager.cs (IsOverride, RegisterNonOverride): New.
3218         * decl.cs (MemberCache.AddMethod): Register "non-override" methods
3219         that used to trigger warning -28.  Remove warning -28.
3220         * expression.cs (Invocation.OverloadResolve): Use
3221         TypeManager.IsOverride to distinguish override methods.
3222
3223         Fix #74773.
3224         * pending.cs (VerifyPendingMethods): If a base type implements the
3225         requested interface, don't bother checking individual methods of
3226         the base type.  As a side-effect, this prevents the creation of
3227         unnecessary proxies.
3228
3229 2005-05-02  Martin Baulig  <martin@ximian.com>
3230
3231         Fix #70182.
3232
3233         * flowanalysis.cs (FlowBranching.UsageVector.MergeJumpOrigins):
3234         Also `And' the locals if the old vector is null.
3235         (FlowBranching.UsageVector.BitVector.And): Allow `vector' being
3236         null; in this case we basically reset all the variables.        
3237
3238 2005-05-02  Martin Baulig  <martin@ximian.com>
3239
3240         Fix #74529.
3241
3242         * flowanalysis.cs (FlowBranching.UsageVector.MergeBreakOrigins):
3243         Added `FlowBranching branching' argument; always `and' the
3244         variables instead of `or'ing them unless we're an infinite loop.
3245
3246         * statement.cs (While.Resolve): Create a new sibling unless we're
3247         infinite.       
3248
3249 2005-05-02  Martin Baulig  <martin@ximian.com>
3250
3251         Fix #70140.
3252
3253         * class.cs (ConstructorInitializer.Resolve): Added `Block block'
3254         arguments; use it instead of creating a new TopLevelBlock.
3255         (Constructor.Emit): Call `block.ResolveMeta ()' before resolving
3256         our ConstructorInitializer.
3257
3258         * statement.cs
3259         (TopLevelBlock.TopLevelBranching): New public property.
3260         (TopLevelBlock.ResolveMeta): New public method; call ResolveMeta()
3261         and create our `TopLevelBranching'.
3262
3263         * codegen.cs (EmitContext.ResolveTopBlock): If we're not an
3264         anonymous method host, use `block.TopLevelBranching' rather than
3265         creating a new branching.
3266
3267 2005-04-20  Miguel de Icaza  <miguel@novell.com>
3268
3269         * anonymous.cs (ScopeInfo.AddChild): when adding a new child to
3270         a ScopeInfo, if any of the current children is a child of the new
3271         entry, move those children there.
3272
3273 2005-04-30  Martin Baulig  <martin@ximian.com>
3274
3275         * statement.cs (Switch.SimpleSwitchEmit): Reset `default_at_end'
3276         at the beginning of a SwitchSection.  Fix #73335.
3277
3278 2005-04-27  Marek Safar  <marek.safar@seznam.cz>
3279
3280         Fix #74378
3281         * class.cs (EmitFieldInitializers): Use FieldExpr in initializer.
3282         
3283         * ecore.cs (FieldExpr): Add a new ctor with in_initializer.
3284         (FieldExpr.DoResolve): Obsolete members are ignored for field
3285         initializers.
3286         
3287 2005-04-26  Marek Safar  <marek.safar@seznam.cz>
3288
3289         * attribute.cs (AreOverloadedMethodParamsClsCompliant): Add array
3290         of arrays detection.
3291
3292         * class.cs (Interface.VerifyClsCompliance): Add base interfaces
3293         verification.
3294         (Field.VerifyClsCompliance): Volatile fields are not compliant.
3295
3296         * decl.cs (MemberCache.VerifyClsParameterConflict): Add array of
3297         arrays report.
3298
3299 2005-04-25  Ben Maurer  <bmaurer@ximian.com>
3300
3301         * cs-parser.jay: Use the prefered version of -unsafe in error
3302         message.
3303
3304 2005-04-22  Marek Safar  <marek.safar@seznam.cz>
3305
3306         * driver.cs (CompilerCallableEntryPoint.Invoke): Reset under any
3307         circumstances.
3308
3309 2005-04-20  John Luke  <john.luke@gmail.com>
3310
3311         * driver.cs: fix typo in error message, --outout to --output
3312
3313 2005-04-30  Martin Baulig  <martin@ximian.com>
3314
3315         * attribute.cs (Attribute.CheckSecurityActionValidity): Correctly
3316         handle the .NET 2.x security attributes.
3317
3318 2005-04-30  Martin Baulig  <martin@ximian.com>
3319
3320         * typemanager.cs
3321         (TypeManager.ExpandInterfaces): Don't add things twice.
3322
3323         * class.cs
3324         (TypeContainer.VerifyClsCompliance): Allow generic instances.
3325
3326 2005-04-29  Martin Baulig  <martin@ximian.com>
3327
3328         * generic.cs (Constraints.ResolveTypes): Expand interfaces.
3329
3330         * anonymous.cs: Added support for anonymous generic methods.
3331
3332 2005-04-29  Martin Baulig  <martin@ximian.com>
3333
3334         * typemanager.cs (TypeManager.GetInterfaces): Correctly handle
3335         generic instances.
3336
3337 2005-04-29  Martin Baulig  <martin@ximian.com>
3338
3339         * generic.cs (TypeManager.HasConstructorConstraint): Removed.
3340
3341         * expression.cs (New.DoResolve): Fix the CS0304 check.
3342
3343 2005-04-29  Martin Baulig  <martin@ximian.com>
3344
3345         * typemanager.cs (TypeManager.GetFullName): Updated to the new
3346         naming schema.
3347
3348         * class.cs (MethodCore.IsDuplicateImplementation): If we're an
3349         explicit interface implementation, compare the interface types.
3350         (MethodData.Define): Use the new naming scheme from the latest
3351         .NET 2.x beta2.
3352         (MemberBase.DoDefineBase): Resolve `InterfaceType' here.
3353
3354         * decl.cs (MemberName.GetMemberName): Removed.
3355         (MemberName.MethodName, FullName): New properties.
3356
3357 2005-04-25  Raja R Harinath  <rharinath@novell.com>
3358
3359         * gmcs.exe.config: Update v2.0.40607 -> v2.0.50215.
3360
3361 2005-04-22  Martin Baulig  <martin@ximian.com>
3362
3363         * generic.cs (GenericMethod): Create the EmitContext in the
3364         `Define()'; in `Define(MethodBuilder)', create the type parameters
3365         before calling `Define()'.  Fixes #73933.
3366
3367 2005-04-22  Martin Baulig  <martin@ximian.com>
3368
3369         * generic.cs
3370         (Constraints.Resolve): Make things work wrt. the new type lookup system.
3371         (ConstructedType.ResolveAsTypeTerminal): Don't override this.
3372
3373         * ecore.cs (Expression.ResolveAsTypeTerminal): If `te' is a
3374         ConstructedType, check its constraints.
3375
3376 2005-04-20  Marek Safar  <marek.safar@seznam.cz>
3377
3378         * codegen.cs (InRefOutArgumentResolving): New field.
3379         
3380         * ecore.cs (FieldExpr.DoResolve): Check for assigning to readonly
3381         fields outside contructor.
3382         
3383         * expression.cs (Argument.Resolve): Set InRefOutArgumentResolving.
3384         
3385 2005-04-19  Miguel de Icaza  <miguel@novell.com>
3386
3387         * anonymous.cs (CaptureContext.EmitParameterInstance): The
3388         parameter code was not completed ever, so it was not as up-to-date
3389         as local variables.  Must finish it.
3390
3391         The bug fix was to compare the Toplevel of the block, not the
3392         current block.  Thanks for Ben for pointing this out. 
3393
3394 2005-04-19  Raja R Harinath  <rharinath@novell.com>
3395
3396         * decl.cs (AddMethods): Use the declaring type of the problem
3397         method to determine if we want to squash a warning.
3398
3399 2005-04-19  Marek Safar  <marek.safar@seznam.cz>
3400
3401         * attribute.cs: Removed debug output.
3402
3403         * decl.cs (MemberCache.AddMethods): Fixed Finalize ignoring.
3404         
3405         * driver.cs (Driver.parse): Synchronize parser ErrorOutput with
3406         Report.Stderr.
3407         
3408 2005-04-18  Raja R Harinath  <rharinath@novell.com>
3409
3410         Fix #74481.
3411         * expression.cs (Binary.EqualsNullIsReferenceEquals): New.
3412         (Binary.DoResolveOperator): Use it to avoid blindly optimizing out
3413         all null comparisons against reference types.
3414
3415 2005-04-18  Marek Safar  <marek.safar@seznam.cz>
3416
3417         Fix# 74565
3418         * class.cs (TypeContainer.CircularDepException) New nested
3419         exception class.
3420         (GetPartialBases, GetNormalBases, GetClassBases): Removed error.
3421         (TypeContainer.DefineType): Removed error, reset InTransit before
3422         exit.
3423         (Class.DefineType): Throw exception when is in Transit.
3424         Catch exception and report error.
3425         (Struct.DefineType): Throw exception when is in Transit.
3426         Catch exception and report error.
3427         (Interface.DefineType): Throw exception when is in Transit.
3428         Catch exception and report error.
3429
3430         * codegen.cs: Add InCatch,InFinally to EmitContext to easily
3431         handle nested exception handlers.
3432
3433         * flowanalysis.cs (InTryWithCatch): New method, search for try with
3434         a catch.
3435
3436         * iterators.cs (Yield.CheckContext): Add CS1626 report. Updated
3437         InFinally and InCatch storage.
3438
3439         * statement.cs (Throw.Resolve): Use InCatch, InFinally from ec.
3440         (Catch.Resolve): Set and Restore ec.InCatch.
3441         (Try.Resolve): Set and Restore ec.InFinally.
3442         (Try.HasCatch): True when try has catch.
3443
3444 2005-04-17  Atsushi Enomoto  <atsushi@ximian.com>
3445
3446         * doc.cs : In some cases FilterName returns MonoEvent and MonoField
3447           for the same event member, so exclude such cases from warning 419.
3448           Fixed bug #74633.
3449
3450 2005-04-16  Miguel de Icaza  <miguel@novell.com>
3451
3452         * expression.cs (Binary.ResolveOperator): Apply patch from John
3453         Luke to fix bug 59864: operators &, | and ^ on enumerations
3454         require that the same enum type on both sides.
3455
3456         * driver.cs: Add warnings to old flag usage, this is to assist
3457         people who produce Makefiles and hope that the Makefiles will be
3458         used on Windows.
3459
3460         * class.cs (TypeContainer.EmitType): Moved the definition of the
3461         special $PRIVATE$ field from the resolve phase to the Emit phase.
3462         During resolve we do not know if we are a struct with
3463         HasExplicitLayout, we know this only after the attributes for the
3464         type are emitted.
3465
3466         Set the FieldOffset to zero on the dummy field that we create for
3467         the class.   Fixes 74590.
3468
3469 2005-04-16  Raja R Harinath  <rharinath@novell.com>
3470
3471         Fix #73834.
3472         * ecore.cs (PropertyExpr.resolved): New.
3473         (DoResolve): Use it to handle a case of double resolution here.
3474         Handle a case of identical-name-and-type-name.
3475         * expression.cs (ArrayCreation.CheckIndices): Avoid double
3476         resolution by storing the results of expression resolution back
3477         into the "probes" array.
3478
3479 2005-04-15  Raja R Harinath  <rharinath@novell.com>
3480
3481         Fix cs0208-7.cs and cs0208-8.cs.
3482         * typemanager.cs (IsUnmanagedType): Arrays are not allowed
3483         (cf. ECMA standard, behaviour of CSC 1.1 and CSC 2.0).  Improve
3484         error reporting to point out the reason a struct is not unmanaged.
3485
3486 2005-04-13  Atsushi Enomoto  <atsushi@ximian.com>
3487
3488         * doc.cs : In FindDocumentedType(), avoid TypeExpr.ResolveType() and 
3489           just use TypeExpr.Type. This fixes bug #74595 when merged to gmcs.
3490
3491 2005-04-13  Raja R Harinath  <rharinath@novell.com>
3492
3493         Fix #74528.
3494         * ecore.cs (PropertyExpr.InstanceResolve): Handle a case of
3495         IdenticalNameAndTypeName here.
3496         (EventExpr.InstanceResolve): Likewise.
3497
3498 2005-04-13  Marek Safar  <marek.safar@seznam.cz>
3499
3500         C# 2.0 DefaultCharSetAttribute implementation
3501         
3502         * attribute.cs (Attribute.ResolveAsTypeStep): New protected method
3503         which allows us to set GlobalNamespace for every resolve.
3504         (Attribute.ResolveArguments): Cut from Resolve.
3505         (Attribute.GetCharSetValue): Returns CharSet named argument.
3506         (Attribute.DefinePInvokeMethod): Gets default charset from
3507         module settings.
3508         (GlobalAttribute.ResolveAsTypeStep): Override.
3509         (GlobalAttribute.ResolveArguments): Override.
3510         
3511         * class.cs (TypeAttr): Is protected.
3512         
3513         * codegen.cs (ModuleClass.DefaultCharSet): New member.
3514         (ModuleClass.DefaultCharSetType): New memeber.
3515         (ModuleClass.ResolveAttributes): Resolves DefaultCharSetAttribute.
3516         
3517         * decl.cs (Decl.TypeAttr): New protected virtual. Returns default
3518         charset from module.
3519         
3520         * delegate.cs (TypeAttr): Override.
3521         (Delegate.DefineType): Use this TypeAttr.
3522         
3523         * driver.cs (Driver.MainDriver): Call Module.ResolveAttributes
3524         at very early stage (before types are defined) to resolve model
3525         module attributes. It will probably not work with corlib but it
3526         should be ok.
3527         
3528         * enum.cs (Enum.TypeAttr): New protected virtual. Returns default
3529         charset from module.
3530         
3531         * typemanager.cs (default_charset_type): New type.
3532
3533 2005-04-13  Raja R Harinath  <rharinath@novell.com>
3534
3535         * decl.cs (MemberCache.AddMethods): Don't warn if
3536         System.Object.Finalize has buggy MethodAttributes.
3537
3538         * typemanager.cs (IsUnmanagedType): Restore !IsValueType check
3539         removed below.
3540
3541 2005-04-13  Atsushi Enomoto  <atsushi@ximian.com>
3542
3543         * doc.cs : detect ambiguous reference to overloaded members.
3544           Fixed bug #71603. MS 1.1 csc does not detect it.
3545
3546 2005-04-13  Atsushi Enomoto  <atsushi@ximian.com>
3547
3548         * doc.cs : delegates must not be referenced with parameters.
3549           Fixed bug #71605.
3550
3551 2005-04-12  Miguel de Icaza  <miguel@novell.com>
3552
3553         * typemanager.cs (IsUnmanagedType): Arrays are allowed.
3554
3555 2005-04-10  Miguel de Icaza  <miguel@novell.com>
3556
3557         * driver.cs (MainDriver): Stop processing if the CLS stage found
3558         errors. 
3559
3560         (CompilerCallableEntryPoint.InvokeCompiler): Always
3561         reset after execution;   Take a TextWriter argument for the
3562         output.
3563
3564         * report.cs: Use the error stream instead of hardcoding stderr. 
3565
3566 2005-04-09  Miguel de Icaza  <miguel@novell.com>
3567
3568         * class.cs: Reduce code paths to test, too small of an
3569         optimization to make it worth the extra testing.  Always perform
3570         it. 
3571
3572 2005-04-08  Raja R Harinath  <rharinath@novell.com>
3573
3574         Fix #74510.
3575         * class.cs (OperatorArrayList.CheckPairedOperators): Skip
3576         operators that had errors reported on them.
3577
3578 2005-04-08  Marek Safar  <marek.safar@seznam.cz>
3579
3580         * attribute.cs (Attribute.IsValidArgumentType): Test valid named
3581         argument types.
3582         (Attribute.Resolve): Add named argument type checking.
3583         
3584         * class.cs (FixedField.Define): Use IsPrimitiveType
3585         
3586         * expression.cs (Binary.ResolveOperator): Reflect IsCLRType renaming.
3587         
3588         * iterators.cs (Iterator.DefineIterator): Add check for arglist and
3589         unsafe parameter types.
3590         
3591         * statement.cs (Using.ResolveExpression): Add better error description.
3592         
3593         * typemanager.cs (IsCLRType): Renamed to IsPrimitiveType.
3594         
3595 2005-04-08  Raja R Harinath  <rharinath@novell.com>
3596
3597         Fix #74484.
3598         * attribute.cs (Attribute.GetAttributeUsage): Resolve
3599         AttributeUsageAttribute in the emitcontext of the attribute class,
3600         not in the emitcontext of the attributable entity it was attached to.
3601         * cs-parser.jay: Use 'current_class', not 'current_container',
3602         when creating a GlobalAttribute.
3603
3604 2005-04-08  Alp Toker  <alp@atoker.com>
3605
3606         * pending.cs: The fix to #58413 failed to compile methods implementing
3607         interfaces with/without params modifiers and vice versa, even though
3608         params modifiers aren't part of the signature. Make the modifier check
3609         less strict as in csc.
3610
3611 2005-04-07  Abin Thomas  <projectmonokochi@rediffmail.com>
3612             Anoob V E  <projectmonokochi@rediffmail.com>
3613             Harilal P R  <projectmonokochi@rediffmail.com>
3614
3615         Fix #58413.
3616         * pending.cs (TypeAndMethods.mods): New.  Store the parameter
3617         modifiers of pending methods.
3618         (PendingImplementation.PendingImplementation): Initialize it.
3619         Add Parameter.Modifier [][] mods and initialize it with ParameterData.
3620         (PendingImplementation.InterFaceMethod): Repalce Type[] argument
3621         with ParameterData.  Add check for modifiers.
3622         * class.cs (MethodData.Define): Update to changes.
3623
3624 2005-04-07  Raja R Harinath  <rharinath@novell.com>
3625
3626         * ecore.cs (Expression.IsAccessorAccessible): Clarify code somewhat.
3627
3628 2005-04-07  Marek Safar  <marek.safar@seznam.cz>
3629
3630         * class.cs (PropertyMethod.Define): Check private accessor in abstract
3631         property.
3632         
3633         * decl.cs (DeclSpace.ApplyAttributeBuilder): Don't allow RequiredAttribute
3634         
3635         * rootcontext.cs,
3636         * typemanager.cs: Registered RequiredAttributeAttribute.
3637         
3638 2005-04-06  Marek Safar  <marek.safar@seznam.cz>
3639
3640         * class.cs (VerifyMembers): Doesn't need EmitContext argument.
3641         Warning CS0169 is back at level 3.
3642         (IMethodData.SetMemberIsUsed): New method.
3643         
3644         * decl.cs (IsUsed): New value; moved from FieldBase.Status
3645         (SetMemberIsUsed, IsUsed): New methods, encapsulate IsUsed.
3646         
3647         * delegate.cs (ResolveMethodGroupExpr): Call SetMemberIsUsed.
3648
3649         * ecore.cs (FieldExpr.ResolveMemberAccess): Call SetMemberIsUsed for
3650         contants.
3651         (PropertyExpr.ResolveAccessors): Call SetMemberIsUsed when delegate
3652         is used.
3653         
3654         * expression.cs (OverloadResolve): Call SetMemberIsUsed. when method
3655         is used.
3656         
3657         * rootcontext.cs (RootContext.EmitCode): Call VerifyMembers in extra run
3658         to avoid the problems with nested types.
3659
3660 2005-04-05  Abin Thomas  <projectmonokochi@rediffmail.com>
3661             Anoob V.E  <projectmonokochi@rediffmail.com>
3662             Harilal P.R  <projectmonokochi@rediffmail.com>
3663             Raja R Harinath  <rharinath@novell.com>
3664
3665         Fix #73820.
3666         * delegate.cs (Define): Emit ParamArrayAttribute for 'params'
3667         attribute.
3668         * typemanager (GetConstructor): Make public.
3669
3670 2005-04-05  John Luke  <john.luke@gmail.com>
3671             Raja R Harinath  <rharinath@novell.com>
3672
3673         Fix #62232.
3674         * typemanager.cs (IsUnmanagedType): Check non-public fields of a
3675         struct too.  Return false quicker in a few cases.
3676         (VerifyUnManaged): Use it.
3677
3678 2005-04-05  Raja R Harinath  <rharinath@novell.com>
3679
3680         Fix #74041.
3681         * statement.cs (Block.Resolve): Initialize 'unreachable' to false,
3682         not 'unreachable_seen'.
3683
3684 2005-04-04  Marek Safar  <marek.safar@seznam.cz>
3685
3686         * attribute.cs (Attribute.GetValue): Removed unused.
3687         
3688         * codegen.cs (CodeGen.TrimExt): Removed unused.
3689         
3690         * cs-parser.jay (output): Removed unused.
3691         
3692         * cs-tokenizer.cs (hex_digits): Removed unused.
3693         
3694         * enum.cs (MapToInternalType, GetEnumeratorName): Removed unused.
3695         
3696         * expression.cs (Indirection.LoadExprValue): Removed unused.
3697         (ArrayCreation.ExpressionToArrayArgument): Removed unused.
3698         
3699         * iterators.cs (Iterator.param_types): Removed unused.
3700         
3701         * statement.cs (Goto.block): Removed unused.
3702         (ToplevelBlock.did): Removed unused.
3703         (Switch.ResolveConstantSwitch): Removed unused.
3704
3705 2005-04-01  Ben Maurer  <bmaurer@ximian.com>
3706
3707         * rootcontext.cs: Allow mcs to bootstrap with the compilation
3708         resetting thingy.
3709
3710 2005-04-19  Martin Baulig  <martin@ximian.com>
3711
3712         Merged r42462 from MCS and made it work for GMCS.
3713
3714         * class.cs (MethodCore.ds): Moved this field to `MemberBase'.
3715
3716         * generic.cs (GenericMethod.Define): Removed `return_type' argument.
3717
3718 2005-04-01  Raja R Harinath  <rharinath@novell.com>
3719
3720         Fix #74232 and cs0208-3.cs.
3721         * expression.cs (ComposedCast.DoResolveAsTypeStep): Add CS0208 check.
3722         * typemanager.cs (IsUnmanagedType): Don't allow 'object' as an
3723         unmanaged type.  Don't use FieldBuilders when 't' is a
3724         TypeBuilder.  Use ModFlags and MemberType fields.
3725         * class.cs (MemberBase.member_type): Rename from MemberType.
3726         (MemberBase.MemberType): New property.  Determines member_type on
3727         demand.
3728         (MemberBase.DoDefine): Don't initialize MemberType here.
3729         (FieldMember.Define): Likewise.
3730
3731 2005-04-01  Marek Safar  <marek.safar@seznam.cz>
3732
3733         Fix #74241
3734         * class.cs (Event.Emit): Call Add/Remove emit even for interfaces.
3735         Attributes are emitted there.
3736         
3737 2005-04-01  Raja R Harinath  <rharinath@novell.com>
3738
3739         * cs-tokenizer.cs (consume_identifier): Treat 'partial' as a
3740         keyword in 'partial enum' too.
3741         * cs-parser.jay (enum_declaration): Add CS0267 check ('partial enum'
3742         is not allowed).
3743         Report from Kamil Skalski <nazgul@omega.pl>.
3744
3745         Fix #74309.
3746         * rootcontext.cs (ResolveTree): The 'root.Interfaces' list can
3747         have partial containers too.
3748
3749         * ecore.cs (SimpleName.SimpleNameResolve): Move 'invariant meaning
3750         in block' checks to Block.CheckInvariantMeaningInBlock.
3751         * statement.cs (Block.GetKnownVariableInfo): Make private.
3752         (Block.IsVariableUsedInChildBlock): Remove.
3753         (Block.IsVariableUsedInBlock): Likewise.
3754         (Block.CheckInvariantMeaningInBlock): New.  Show location of
3755         conflicting declaration.
3756         (Block.AddVariable): Make error messages less long-winded and more
3757         specific.  Show location of conflicting declaration.
3758         * parameter.cs (Parameters.Location): New readonly property.
3759
3760 2005-03-31  Raja R Harinath  <rharinath@novell.com>
3761
3762         Clean up semantics of invoking ResolveMemberAccess.
3763         * ecore.cs (SimpleName.DoSimpleNameResolve): If a MemberExpression
3764         can have an instance, ensure that we pass in a non-TypeExpression
3765         to ResolveMemberAccess.  Tighten up IdenticalNameAndTypeName checks.
3766         (MemberExpr.DoSimpleNameResolve): Remove type_is_inferred
3767         argument.  Update to changes and simplify.
3768         (FieldExpr.Emitinstance): Remove CS0120 check.
3769         (PropertyExpr.EmitInstance): Likewise.
3770         * expression.cs (Argument.Resolve): Likewise.
3771         (Invocation.DoResolve): Update to changes in semantics of
3772         InstanceExpression.
3773
3774 2005-03-31  Marek Safar  <marek.safar@seznam.cz>
3775
3776         Fix #74241
3777         * class.cs (AbstractPropertyEventMethod.EmitMethod): Enable emit method
3778         customization.
3779         
3780         * decl.cs (MemberCache.AddMethods): Fix infinite loop.
3781
3782 2005-03-31  Raja R Harinath  <rharinath@novell.com>
3783
3784         Fix difference in behaviour with commandline invocation.
3785         * driver.cs (Driver.Reset): New.
3786         (CompilerCallableEntryPoint): Call it.
3787
3788         * statement.cs (If.Resolve): Avoid spurious "uninitialized
3789         variable" warnings if the boolean expression failed to resolve.
3790
3791 2005-03-30  Sebastien Pouliot  <sebastien@ximian.com>
3792
3793         * attribute.cs: Fix the union of several permissions when some of them
3794         are unrestricted (so the result isn't an unrestricted permission set).
3795         Fix #74036.
3796
3797 2005-03-30  Raja R Harinath  <rharinath@novell.com>
3798
3799         * ecore.cs (MemberExpr): New class.  Convert from interface
3800         IMemberExpr.
3801         (MemberExpr.ResolveMemberAccess): Refactor and move here from
3802         MemberAccess.ResolveMemberAccess.  Tighten up pre-conditions and
3803         error checks.
3804         (MethodGroupExpr, FieldExpr, PropertyExpr, EventExpr): Update.
3805         (MethodGroupExpr.IsExplicitImpl): Remove.
3806         (Expression.GetFieldFromEvent): Remove.
3807         (SimpleName.MemberStaticCheck): Remove.
3808         (SimpleName.DoSimpleNameResolve): Update to changes.
3809         * expression.cs (MemberAccess.ResolveMemberAccess): Refactor.
3810         (MemberAccess.IdenticalNameAndTypeName): Remove.
3811         (MemberAccess.error176): Move to MemberExpr.
3812         (MemberAccess.DoResolve): Update to changes.
3813         (BaseAccess.DoResolve): Likewise.
3814
3815 2005-03-30  Marek Safar  <marek.safar@seznam.cz>
3816
3817         C# 2.0 Conditional attribute class implementation
3818         
3819         * attribute.cs (AttributeTester.IsAttributeExcluded): New method.
3820         Analyzes class whether it has attribute which has ConditionalAttribute
3821         and its condition is not defined.
3822         
3823         * class.cs (Class.ApplyAttributeBuilder): Add IsAttributeExcluded check.
3824         (Class.IsExcluded): New method. Search for at least one defined
3825         condition in ConditionalAttribute of attribute class.
3826
3827 2005-03-30  Raja R Harinath  <rharinath@novell.com>
3828
3829         * ecore.cs (PropertyExpr): Derive from Expression, not
3830         ExpressionStatement.
3831         (PropertyExpr.EmitStatement): Remove.
3832
3833 2005-03-29  Raja R Harinath  <rharinath@novell.com>
3834
3835         Fix #74060.
3836         * expression.cs (MemberAccess.ResolveMemberAccess): Allow the
3837         internal field "value__" of an enum be private.  The examples for
3838         "value__" that I found on MSDN all used FieldAttributes.Private.
3839
3840         * decl.cs (MemberCache.AddMethods): Use C# terminology in warning.
3841         Don't mention IL method attribute names.
3842
3843         Fix #47991.  Remove a TODO.
3844         * statement.cs (Block.Toplevel): Make into a field.
3845         (Block.Parameters): Move into ToplevelBlock.
3846         (Block.known_variables): Rename from child_variable_names.
3847         (Block.Block): Remove variants that take Parameters.  Initialize
3848         'Toplevel' with the immediately surrounding toplevel block.
3849         (Block.AddKnownVariable): Rename from AddChildVariableName.  Add a
3850         LocalInfo parameter.
3851         (Block.GetKnownVariableInfo): New.
3852         (Block.IsVariableNameUsedInChildBlock): Update.
3853         (Block.IsVariableNameUsedInBlock): New.  Checks if a name is used in
3854         the block, even though it may not be in scope.
3855         (Block.AddVariable): Remove Parameters parameter.  Use
3856         Toplevel.Parameters instead.
3857         (Block.AddConstant): Remove Parameters parameter.
3858         (Block.GetParameterReference): Update to use Toplevel.Parameters.
3859         (Block.IsParamaterReference): Likewise.
3860         (Block.IsLocalParameter): Likewise.  Simplify a lot.
3861         (ToplevelBlock.Parameters): New.  Moved from Block.
3862         (ToplevelBlock.ToplevelBlock): Update to changes.  Always
3863         initialize Parameters to a non-null value.
3864         * cs-parser.jay: Update to changes.
3865         * ecore.cs (SimpleName.SimpleNameResolve): Emit cs0136 error for
3866         simple names that mean different things in the same block.  Use
3867         Block.IsVariableNameUsedInBlock.
3868
3869 2005-03-28  Raja R Harinath  <rharinath@novell.com>
3870
3871         * enum.cs (Enum.LookupEnumValue): Remove debugging code.
3872
3873 2005-03-26  Raja R Harinath  <harinath@acm.org>
3874
3875         Fix #73038.
3876         * assign.cs (Assign.DoResolve): When the RHS of an assignment
3877         fails to resolve, ensure that the LHS is still resolved as an
3878         lvalue.
3879
3880 2005-03-25  Raja R Harinath  <harinath@acm.org>
3881
3882         * enum.cs (Enum.DefineType): Set ec.InEnumContext and
3883         ec.ContainerType.
3884         (Enum.current_ec): Remove.
3885         (Enum.LookupEnumValue): Remove EmitContext argument.
3886         Just uses the one created during DefineType.
3887         (Enum.FindMembers): Update.
3888         * expression.cs (MemberAccess.DoResolve): Update.
3889
3890 2005-03-22  Marek Safar  <marek.safar@seznam.cz>
3891
3892         * assign.cs (Assign.DoResolve): Check for CS1717 when
3893         source and target are same (uses Equals).
3894
3895         * expression.cs (LocalVariableReference, ParameterReference,
3896         This): Implemented Equals, GetHashCode.
3897
3898         * statement.cs (Block.GetParameterReference): Removed useless
3899         local variable.
3900
3901 2005-03-22  Raja R Harinath  <rharinath@novell.com>
3902
3903         Fix cs0128.cs
3904         * statement.cs (Block.AddVariable): Ensure that we skip implicit
3905         blocks before deciding whether the error is cs0136 or cs0128.
3906
3907         * cs-parser.jay: Pass MemberName to RootContext.Tree.RecordDecl.
3908         (using_alias_directive, using_namespace_directive): Pass
3909         MemberName, not an expression to Namespace.UsingAlias and
3910         Namespace.Using.
3911         (MakeName): Use the MemberName of the namespace.
3912         * namespace.cs (Namespace.MemberName): New.
3913         (UsingEntry.UsingEntry): Take a MemberName, not an expression.
3914         (AliasEntry.AliasEntry, Namespace.Using, Namespace.UsingAlias):
3915         Likewise.
3916         * decl.cs (MemberName.Name): Make readonly.
3917         (MemberName.FromDotted): New "constructor".
3918         (MemberName.Equals, MemberName.GetHashCode): Implement overrides.
3919         (MemberCore.Name): Compute from MemberName on demand.
3920         (MemberCore.SetMemberName): Provide a way to change the
3921         MemberName.
3922         (MemberCore.AddToContainer): Don't take a fullname parameter.
3923         * class.cs (TypeContainer.AddToMemberContainer): Don't add the
3924         fully qualified name of the container to the member name.
3925         (TypeContainer.AddToTypeContainer): Use a fully qualified name
3926         only if the type is a member of the root container.
3927         (TypeContainer.AddMethod, TypeContainer.AddProperty): Use
3928         MemberName.Left rather than searching for an embedded ".".
3929         (PartialContainer.CreatePart): Update to changes in RootContext.
3930         (MemberBase.ShortName): Turn into a property.  Use
3931         MemberCore.SetMemberName.
3932         (MemberBase.ExplicitInterfaceName): Remove.
3933         (MemberBase.UpdateMemberName): Remove.
3934         (AbstractPropertyEventMethod.UpdateName): Use SetMemberName.
3935         (PropertyBase.SetMemberName): New override.
3936         * tree.cs (Tree.RecordDecl): Take a MemberName and use it as hash key.
3937         (Tree.GetDecl): New.
3938         (Tree.AllDecls): Rename from Decls.
3939         * attribute.cs, enum.cs, report.cs: Update to changes.
3940         * driver.cs (MainDriver): Use MemberName.FromDotted on
3941         RootContext.MainClass.
3942
3943 2005-03-21  Marek Safar  <marek.safar@seznam.cz>
3944
3945         * class.cs (FixedField.Define): Check for CS1664 and more sanity
3946         checks.
3947
3948         * expression.cs (ElementAccess.DoResolveLValue): Check for CS1708.
3949
3950 2005-03-18  Marek Safar  <marek.safar@seznam.cz>
3951
3952         * modifiers.cs (Modifiers.PROPERTY_CUSTOM): New constant for
3953         property accessor modifiers.
3954
3955         * class.cs (FieldMember.ApplyAttributeBuilder): Don't allow apply
3956         fixed buffer attribute (CS1716).
3957         (PropertyMethod.HasCustomAccessModifier): When property accessor
3958         has custom modifier.
3959
3960         * ecore (PropertyExpr.DoResolve): Add CS0271 for custom accessor
3961         modifiers.
3962         (PropertyExpr.DoResolveLValue): Add CS0272.
3963
3964 2005-03-17  Miguel de Icaza  <miguel@novell.com>
3965
3966         * convert.cs: When converting to a pointer, use the proper Conv.U
3967         or Conv.I depending on the source data type.
3968
3969         * cs-tokenizer.cs: Make the size for large decimal constants,
3970         fixes #72957.
3971
3972 2005-03-17  Martin Baulig  <martin@ximian.com>
3973
3974         * anonymous.cs (AnonymousMethod.method_modifiers): Change default
3975         from `Modifiers.INTERNAL' to `Modifiers.PRIVATE'.  Fixes #73260.
3976
3977 2005-03-17  Martin Baulig  <martin@ximian.com>
3978
3979         * anonymous.cs (AnonymousMethod.EmitMethod): Changed return type
3980         to bool so we can return an error condition.
3981         (AnonymousDelegate.Emit): Check whether AnonymousMethod.EmitMethod()
3982         returned an error.
3983
3984 2005-03-16  Zoltan Varga  <vargaz@freemail.hu>
3985
3986         * attribute.cs: Encode ThrowOnUnmappableChar and BestFitMapping
3987         attributes.
3988
3989 2005-03-16  Raja R Harinath  <rharinath@novell.com>
3990
3991         Remove TypeManager.LookupType and TypeManager.LookupTypeDirect.
3992         Refactor to avoid traversing the list of assemblies, and to avoid
3993         string concatenation.
3994         * typemanager.cs (guid_attr_type): Remove.
3995         (negative_hits, pointers, references): Remove hashes.
3996         (type_hash): New.
3997         (GetConstructedType): New.  Uses type_hash to handle constructed
3998         types (arrays, references, pointers).
3999         (GetReferenceType, GetPointerType): Use it.
4000         (GetNestedType): New.  Uses type_hash to handle nested types of
4001         reflected types.
4002         (LookupType, LookupTypeDirect): Remove.
4003         (CoreLookupType): Inline parts of old LookupTypeDirect code.  Use
4004         'types' hash and LookupTypeReflection directly.
4005         (params_string, params_object): Use GetConstructedType.
4006         * namespace.cs (Namespace.cached_types): New.  Cache of reflected
4007         top-level types.
4008         (Namespace.Lookup): Use cached_types.
4009         (NamespaceEntry.LookupNamespaceOrType): Inline the functionality
4010         provided by old TypeManager.LookupType.
4011         * rootcontext.cs (MakeFQN): Remove.
4012         * decl.cs (DeclSpace.MakeFQN): Likewise.
4013         (DeclSpace.LookupType): Use TypeManager.GetNestedType.
4014         * expression.cs (ComposedCast.DoResolveAsTypeStep): Use
4015         TypeManager.GetConstructedType.
4016         * tree.cs (decl_ns_hash, LookupByNamespace): Remove.
4017
4018 2005-04-16  Zoltan Varga  <vargaz@freemail.hu>
4019
4020         * cs-parser.jay: Fix build.
4021
4022 2005-03-15  Marek Safar  <marek.safar@seznam.cz>
4023
4024         * class.cs (TypeContainer.CircularDepException) New nested
4025         (MethodCore.CheckBase): Report CS1715 for properties and indexers.
4026
4027         * cs-parser.jay: Reports CS1527 for any namespace element.
4028
4029         * delegate.cs (DelegateCreation.Error_NoMatchingMethodForDelegate):
4030         Added CS0407.
4031
4032         * expression.cs (ParameterReference.IsAssigned): Changed error to
4033         CS0269.
4034         (Error_WrongNumArguments): Moved CS0245 detection here.
4035
4036         * statement.cs (Return.Resolve): Add CS1622 report.
4037
4038 2005-03-11  Marek Safar  <marek.safar@seznam.cz>
4039
4040         * class.cs (StaticClass.DefineContainerMembers): Added CS0720.
4041
4042 2005-03-11  Zoltan Varga  <vargaz@freemail.hu>
4043
4044         * attribute.cs expression.cs: Get rid of some allocations.
4045
4046 2004-03-11  Atsushi Enomoto  <atsushi@ximian.com>
4047
4048         * doc.cs : just eliminate the latest change.
4049
4050 2004-03-10  Atsushi Enomoto  <atsushi@ximian.com>
4051
4052         * doc.cs : commented out the latest change. It breaks xml-030.cs
4053
4054 2004-03-10  Atsushi Enomoto  <atsushi@ximian.com>
4055
4056         * doc.cs : When TypeBuilder did not create Type yet, GetEvents() will
4057           fail. So invoke CreateType() in FindDocumentedType().
4058
4059 2004-03-10  Atsushi Enomoto  <atsushi@ximian.com>
4060
4061         * cs-tokenizer.cs : added IsKeyword().
4062         * doc.cs : Detect keyword incorrectly used as identifier.
4063           Allow identifiers prefixed by @.
4064
4065 2005-03-10  Marek Safar  <marek.safar@seznam.cz>
4066
4067         * attributes.cs (Attributes.Emit): Continue after CheckTargets.
4068         It caused exception in namespace resolving (again!).
4069         
4070         * class.cs (Class.ctor): Removed exit.
4071         (PropertyMethod.ctor): ditto.
4072         
4073         * codegen.cs (Codegen.Reset): Reset static data.
4074         (Codegen.ResolveTopBlock): Forward error status from ResolveMeta.
4075         
4076         * cs-tokenizer.cs (Cleanup): Removed.
4077         
4078         * driver.cs (GetSystemDir): Rewrote to one line command.
4079         It caused problem with unloaded dynamic modules.
4080         (UnixParseOption): Removed Exit.
4081         (CompilerCallableEntryPoint.InvokeCompiler): Make static.
4082         (CompilerCallableEntryPoint.Reset): Reset suitable static data.
4083         Now can be mcs used as library.
4084         
4085         * ecore.cs (Expression.ResolveBoolean): Use Location.Null for
4086         empty location.
4087         
4088         * location.cs (Reset): Reset static data.
4089         
4090         * namespace.cs (Reset): Reset static data.
4091         
4092         * report.cs (Report.Reset): Reset static data.
4093         
4094         * rootcontext.cs (RootContext.Reset): Reset static data.
4095         
4096         * tree.cs (RootTypes.ctor): Use Location.Null
4097         
4098         * typemanager.cs (TypeManager.Reset): Reset static data.
4099         (CoreLookupType): Removed Exit.
4100         (TypeHandle.Reset): Reset static data.
4101         
4102 2005-03-10  Raja R Harinath  <rharinath@novell.com>
4103
4104         Fix #73516.
4105         * typemanager.cs (ComputeNamespaces): Import namespaces from
4106         referenced modules too.
4107
4108 2005-03-09  Raja R Harinath  <rharinath@novell.com>
4109
4110         * class.cs (TypeContainer.AddToMemberContainer): Use "." rather
4111         than '.'.
4112
4113 2005-03-09  Raja R Harinath  <rharinath@novell.com>
4114
4115         * decl.cs (DeclSpace.LookupType): Don't loop but recurse into
4116         enclosing DeclSpace.  This ensures that a name-lookup populates
4117         more caches and there are fewer 'TypeExpression's.  Carve out
4118         nested type lookup into ...
4119         (LookupNestedTypeInHierarchy): ... this.
4120
4121 2005-04-15  Martin Baulig  <martin@ximian.com>
4122
4123         Merged r41590 from MCS and make it work in the generics land.
4124
4125         * generic.cs (TypeParameter.UpdateConstraints): Removed the
4126         `check' argument.
4127
4128         * class.cs (PartialContainer.UpdateConstraints): Removed.
4129         (PartialContainer.CheckConstraints): Removed.
4130         (PartialContainer.SetParameterInfo): Store the constraints here.
4131         (PartialContainer.DefineTypeParameters): New public method;
4132         resolve the type parameter's constraints here.  Note that the
4133         PartialContainer doesn't have an EmitContext anymore, so we must
4134         do this in the ClassPart.
4135
4136 2005-03-09  Raja R Harinath  <rharinath@novell.com>
4137
4138         Clean up a few partial-class semantics.  
4139         Fixes test-357.cs and cs1618-2.cs.
4140         * cs-parser.jay (struct_declaration): Use 'current_class' as
4141         parent of newly-created struct.  Remove call to Register ().
4142         Use 'pop_current_class' to complete handing the current struct.
4143         (interface_declaration): Likewise.
4144         (class_declaration): Likewise.
4145         (enum_declaration): Use 'current_class' as parent of newly created
4146         enum.
4147         (delegate_declaration): Likewise.
4148         (pop_current_class): New function.  This is used to handle closing
4149         up the 'current_class' and 'current_container', and pointing them
4150         to the enclosing class/container.
4151         (CSharpParser): Initialize 'current_class' too.
4152         * decl.cs (MemberCore): Add check for invariant: a partial
4153         container is not a parsed entity, and thus does not enclose any
4154         parsed members.
4155         (DeclSpace.TypeResolveEmitContext): Expose 'type_resolve_ec'.
4156         (DeclSpace.BaseTypeExpr): Use it.
4157         (DeclSpace.LookupType): Add check for invariant.
4158         * class.cs (TypeContainer): Add check for invariant: a nested
4159         class should have the same NamespaceEntry as its enclosing class.
4160         (TypeContainer.EmitFieldInitializers): Make virtual.
4161         (TypeContainer.DefineDefaultConstructor): Adhere to invariant in
4162         MemberCore.
4163         (TypeContainer.Register): Remove.
4164         (TypeContainer.DefineType): Set the 'ec' of a PartialContainer to
4165         null.  Use TypeResolveEmitContext for resolving base types and
4166         interfaces.  Move initialization of Parts.TypeBuilder here from
4167         ...
4168         (TypeContainer.DefineNestedTypes): ... here.
4169         (PartialContainer): Take a Namespace not a NamespaceEntry.
4170         (PartialContainer.Create): Don't use Register.  Call the
4171         appropriate Add... function directly.
4172         (ClassPart): Take both the PartialContainer and the enclosing
4173         class as constructor arguments.
4174         (ClassPart.EmitFieldInitializers): Override.
4175         (ClassPart.PartFindNestedTypes): Remove.
4176         (FieldBase.GetInitializerExpression): Resolve the initializer
4177         expression in the emit context of the enclosing class.
4178         * tree.cs (RootTypes): Remove Register ().
4179         
4180 2005-03-08  Marek Safar  <marek.safar@seznam.cz>
4181
4182         * cs-parser.jay: Removed CS0134.
4183         
4184         * driver.cs: Removed CS1901.
4185         
4186         * expression.cs (SizeOf.DoResolve): Don't report CS0233
4187         for predefined types.
4188
4189 2005-03-07  Duncan Mak  <duncan@novell.com>
4190
4191         * codegen.cs (Save):  Catch UnauthorizedAccessException as
4192         well. Fixes bug #73454.
4193
4194 2005-03-07  Marek Safar  <marek.safar@seznam.cz>
4195
4196         * cs-tokenizer.cs (xtoken): Add CS1035.
4197         
4198         * class.cs (MethodData.Define): Add CS0683.
4199         (FieldMember.ctor): Add CS0681.
4200
4201 2005-03-07  Raja R Harinath  <rharinath@novell.com>
4202
4203         * ecore.cs (SimpleName.DoResolve): Rename from
4204         SimpleName.DoResolveAllowStatic.
4205         (SimpleName.DoSimpleNameResolve): Remove 'allow_static' argument.
4206         Pass 'intermediate' flag to MemberStaticCheck.
4207         (SimpleName.MemberStaticCheck): Skip "static check" only in case
4208         of "intermediate" lookups via MemberAccess.
4209         (SimpleName.IdenticalNameAndTypeName): New.  Carved out of ...
4210         * expression.cs (MemberAccess.IdenticalNameAndTypeName): ... this.
4211
4212 2005-03-07  Raja R Harinath  <rharinath@novell.com>
4213
4214         Fix #73394.
4215         * ecore.cs (FieldExpr.EmitInstance): Catch cases of CS0120 that
4216         slipped in because of variable names that are identical to a
4217         builtin type's BCL equivalent ('string String;', 'int Int32;').
4218         (PropertyExpr.EmitInstance): Likewise.
4219
4220 2005-03-04  Marek Safar  <marek.safar@seznam.cz>
4221
4222         * cs-tokenizer.cs (PreProcessPragma): Add warning 1633, 1635.
4223         
4224         * report.cs (warning_ignore_table): Made public.
4225
4226 2005-03-04  Raja R Harinath  <rharinath@novell.com>
4227
4228         Fix #73282.
4229         * class.cs (MethodData.Emit): Pass 'container' to
4230         container.GetObsoleteAttribute instead of 'container.Parent'.
4231
4232 2005-03-03  Marek Safar  <marek.safar@seznam.cz>
4233
4234         * cs-parser.jay: Add 1534 error test.
4235
4236         * iterators.cs (Yield.CheckContext): Add error 1629.
4237         (Iterator.ctor): Save unsafe modifier.
4238         (MoveNextMethod.DoEmit): Restore unsafe context.
4239
4240         * namespace.cs (UsingAlias): Better error message.
4241
4242 2005-03-03  Dan Winship  <danw@novell.com>
4243
4244         * convert.cs (Error_CannotImplicitConversion): fix two bugs in
4245         the warning message [#73219]
4246
4247 2005-03-03  Raja R Harinath  <rharinath@novell.com>
4248
4249         Fix compile with MCS 1.0.0.0.
4250         * cs-tokenizer.cs (PreProcessPragma): Simplify w_disable and
4251         w_restore to not depend on string constant folding.
4252
4253 2005-03-03  Raja R Harinath  <rharinath@novell.com>
4254
4255         * decl.cs (DeclSpace.LookupType): Remove 'silent' argument.  Move
4256         CS0246 check to users who passed 'silent = false'.
4257         * ecore.cs (TypeLookupExpression.DoResolveAsTypeStep): Add CS0246
4258         check.
4259         (SimpleName.SimpleNameResolve): Update.
4260         * expression.cs (ComposedCast.DoResolveAsTypeStep): Add CS0246 check.
4261         (MemberAccess.IdenticalNameAndTypeName): Update.
4262         * doc.cs (FindDocumentedTypeNonArray): Update.
4263
4264 2005-03-03  Raja R Harinath  <rharinath@novell.com>     
4265
4266         * codegen.cs (EmitContext): Remove ResolvingTypeTree.
4267         * parameters.cs (ComputeAndDefineParameters): Remove.
4268         * decl.cs (ResolveBaseTypeExpr): Don't set ResolvingTypeTree.
4269         * delegate.cs (Define): Don't invoke ComputeAndDefineParameters.
4270         Use GetParameterInfo.
4271
4272 2005-03-02  Marek Safar  <marek.safar@seznam.cz>
4273
4274         * report.cs (StaticClass.DefineContainerMembers): Add warning 628.
4275
4276 2005-03-02  Raja R Harinath  <rharinath@novell.com>
4277
4278         Unify DeclSpace.LookupType and DeclSpace.FindType.
4279         * decl.cs (DeclSpace.FindNestedType): New virtual function.  This
4280         is in charge of defining nested types on demand.
4281         (DeclSpace.LookupType): Use it when the current_type is a
4282         TypeBuilder.  Use LookupTypeDirect for reflected types.
4283         (DeclSpace.FindType): Remove.
4284         (DeclSpace.LookupInterfaceOrClass): Likewise.
4285         (DeclSpace.DefineTypeAndParents): Likewise.
4286         * ecore.cs (SimpleName.ResolveAsTypeStep): Just call
4287         DeclSpace.LookupType.
4288         * doc.cs (FindDocumentedTypeNonArray): Use DeclSpace.LookupType.
4289         * typemanager.cs (LookupType): Simplify.
4290         (AddUserType): Remove type from negative_hits.
4291         * namespace.cs (Namespace.Lookup): Use TypeManager.LookupTypeDirect.
4292         * class.cs (TypeContainer.FindMembers): Move handling of nested
4293         types ...
4294         (TypeContainer.FindMembers_NestedTypes): ... here.
4295         (TypeContainer.FindNestedType): Implement override.
4296         (ClassPart.FindNestedType): Delegate to PartialContainer.
4297         (ClassPart.PartFindNestedType): Looks up the nested types of the
4298         part alone.
4299
4300 2005-04-14  Martin Baulig  <martin@ximian.com>
4301
4302         * generic.cs (ConstructedType): Moved all the type lookup and
4303         nested class logic into SimpleName.
4304         (ConstructedType.ResolveConstructedType): Our underlying type is
4305         already fully resolved; all the type lookup stuff is in
4306         SimpleName.
4307
4308         * ecore.cs (SimpleName.ResolveAsTypeStep): Resolve nested
4309         constructed types here instead of in ConstructedType.
4310
4311         * decl.cs (MemberName.GetTypeExpression): Always create a
4312         SimpleName, not a ConstructedType.
4313         (DeclSpace.ResolveNestedType): Removed; this is now in SimpleName.
4314
4315 2005-03-02  Martin Baulig  <martin@ximian.com>
4316
4317         * class.cs (TypeContainer.DoDefineMembers): We also need a default
4318         static constructor in static classes.
4319
4320 2005-03-01  Zoltan Varga  <vargaz@freemail.hu>
4321
4322         * attribute.cs: Pass -1 to DefineLPArrayInternal if sizeConst or
4323         sizeParamIndex is not specified.
4324
4325 2005-03-01  Marek Safar  <marek.safar@seznam.cz>
4326
4327         Fix #73117
4328         * report.cs (WarningMessage.IsEnabled): Missing null check.
4329
4330 2005-02-28  Marek Safar  <marek.safar@seznam.cz>
4331
4332         * attribute.cs (DefinePInvokeMethod): Fix, all data are stored
4333         in the fields and not in the properties.
4334
4335 2005-02-28  Zoltan Varga  <vargaz@freemail.hu>
4336
4337         * attribute.cs (GetMarshal): Marshal SizeConst and SizeParamIndex 
4338         fields as well.
4339
4340 2005-02-28  Marek Safar  <marek.safar@seznam.cz>
4341
4342         * attribute.cs: Small refactoring (improved robustness).
4343         (ImplOptions, UnmanagedType, UsageAttribute): Removed members.
4344         (ValidateGuid): Removed.
4345         (Resolve): Removed referenced to above mentioned.
4346         (GetAttributeUsage): Made private and changed to work without
4347         class assistance.
4348         (GetIndexerAttributeValue): Don't crash.
4349         (GetConditionalAttributeValue): Ditto.
4350         (GetClsCompliantAttributeValue): Ditto.
4351         (ExtractSecurityPermissionSet): All attributes exceptions are
4352         error 648.
4353         (GetPropertyValue): New helper.
4354         (GetMethodImplOptions): New method.
4355         (DefinePInvokeMethod): Reuse common code. Implemented handling of
4356         some missing properties.
4357         
4358         * class.cs (ClassOrStruct.ApplyAttributeBuilder): Updated.
4359         (Method.ApplyAttributeBuilder): Updated.
4360         
4361         * decl.cs (DeclSpace.ApplyAttributeBuilder): Don't catch shared
4362         exception.
4363
4364 2005-02-28  Raja R Harinath  <rharinath@novell.com>
4365
4366         Fix #73052.
4367         * report.cs (Report.SymbolRelatedToPreviousError): Handle
4368         non-simple types (array, pointer, reference).
4369
4370 2005-02-28  Marek Safar  <marek.safar@seznam.cz>
4371
4372         * cs-parser.jay: Add errors 1617, 650, 1007, 531, 547, 548
4373
4374         * class.cs (MethodCore.IsDuplicateImplementation): Special error
4375         for operators.
4376         (Method.CheckBase): Catch wrong destructor here.
4377         (MethodData.Define): Add errors 550, 668.
4378
4379         * cs-tokenizer.cs (PreProcessPragma): Add warning 1634.
4380
4381         * ecore.cs (PropertyExpr.DoResolveLValue): Fixed wrong error code.
4382
4383         * pending.cs (VerifyPendingMethods): Add error 551.
4384
4385         * typemanager.cs (CSharpName): Next error report helper.
4386
4387 2005-02-25  Marek Safar  <marek.safar@seznam.cz>
4388
4389         * attribute.cs (Atttribute.Resolve): Add cache for parameter-less
4390         attributes. Removed useless attribute double check.
4391         It saves almost 2MBs for corlib.
4392
4393 2005-02-25  Raja R Harinath  <rharinath@novell.com>
4394
4395         Fix #72924.
4396         * statement.cs (ExpressionStatement.Resolve): Make robust to being
4397         called twice in case of error.
4398
4399 2005-02-23  Chris Toshok  <toshok@ximian.com>
4400
4401         Fix compiler portions of #72827.
4402         * statement.cs (Block.Emit): call Begin/EndScope on the
4403         EmitContext instead of the ILGenerator.
4404
4405         * codegen.cs (EmitContext.BeginScope): new method, call
4406         ILGenerator.BeginScope as well as the SymbolWriter's OpenScope (if
4407         we have one.)
4408         (EmitContext.BeginScope): same, but EndScope and CloseScope
4409
4410         * symbolwriter.cs (SymbolWriter.OpenScope): get the current il
4411         offset and call the superclass's OpenScope(int) with it.
4412         (SymbolWriter.CloseScope): get the current il
4413         offset and call superclass's CloseScope(int) with it.
4414
4415 2005-02-23  Marek Safar  <marek.safar@seznam.cz>
4416
4417         * anonymous.cs (AnonymousMethod.Compatible): Fixed to report
4418         CS1677 for out and ref as well.
4419
4420         * class.cs (Method.Define): Add error CS1599 detection.
4421         
4422         * cs-parser.jay: Add CS1609, CS1670, CS1627 detection.
4423         
4424         * cs-tokenizer.cs (xtoken): Add error CS1646 detection.
4425         
4426         * delegate.cs (Delegate.Define): Add error CS1599 detection.
4427         
4428         * support.cs.cs (ModifierDesc): New helper method.
4429
4430 2005-02-23  Raja R Harinath  <rharinath@novell.com>
4431             Abin Thomas  <projectmonokochi@rediffmail.com>
4432             Anoob V E  <projectmonokochi@rediffmail.com>
4433             Harilal P R  <projectmonokochi@rediffmail.com>
4434
4435         Fix #57851, #72718.
4436         * class.cs (ConstructorBuilder.Resolve): Make sure that the second
4437         MemberLookup (used for error reporting) actually returns a result.
4438         Fix error report number (122, not 112).
4439
4440 2005-02-22  Abin Thomas  <projectmonokochi@rediffmail.com>
4441             Anoob V E  <projectmonokochi@rediffmail.com>
4442             Harilal P R  <projectmonokochi@rediffmail.com>
4443
4444         Fix #71134.
4445         * pending.cs (PendingImplementation.GetAbstractMethods):
4446         Find NonPublic members too.
4447
4448 2005-02-22  Marek Safar  <marek.safar@seznam.cz>
4449
4450         * expression.cs.cs (ConditionalLogicalOperator.DoResolve):
4451         Fixed error 217.
4452         
4453         * class.cs (MethodCore.CheckMethodAgainstBase):
4454         Add error 239 report.
4455
4456 2005-02-21  Marek Safar  <marek.safar@seznam.cz>
4457
4458         * ecore.cs (PropertyExpr.DoResolve): Add error 214 report.
4459         
4460         * class.cs (Operator.Define): Add error 217 report.
4461         
4462 2005-02-21  Raja R Harinath  <rharinath@novell.com>
4463
4464         Fix #68955.
4465         * expression.cs (Invocation.IsApplicable): Make public.
4466         (Invocation.IsParamsMethodApplicable): Likewise.
4467         * delegate.cs (Delegate.VerifyApplicability): Don't use
4468         Invocation.VerifyArgumentCompat for parameter applicability
4469         testing.  Use Invocation.IsApplicable and
4470         Invocation.IsParamsMethodApplicable.
4471
4472 2005-02-21  Marek Safar  <marek.safar@seznam.cz>
4473
4474         * ecore.cs (PropertyExpr.DoResolve): Add error 214 report.
4475         
4476         * class.cs (Operator.Define): Add error 217 report.
4477         
4478 2005-02-21  Raja R Harinath  <rharinath@novell.com>
4479
4480         * namespace.cs (UsingEntry.Resolve): Undo change below.
4481
4482 2005-02-21  Raja R Harinath  <rharinath@novell.com>
4483
4484         Fix #72756.
4485         * ecore.cs (Expression.MemberLookupFailed): Add argument to
4486         disable the error message when the extended MemberLookup also
4487         fails.
4488         (Expression.MemberLookupFinal): Update.
4489         (SimpleName.DoSimpleNameResolve): Update.
4490         * expression.cs (MemberAccess.ResolveNamespaceOrType):
4491         Don't use MemberLookupFinal.
4492         (New.DoResolve): Update.
4493         (BaseAccess.CommonResolve): Update.
4494
4495 2005-02-21  Raja R Harinath  <rharinath@novell.com>
4496
4497         Fix #72732.
4498         * attribute.cs (Attribute.ResolveType): If a 'resolve_error' had
4499         occured previously, don't resolve again.
4500
4501 2005-02-21  Marek Safar  <marek.safar@seznam.cz>
4502
4503         Fix #69949
4504         * attribute.cs (Attribute.GetAttributeUsage): Add EmitContext
4505         argument. Call ResolveAttributeUsage for unresolved.
4506         when types doesn't match ctor arguments.
4507         
4508         * class.cs (DoDefineMembers.TypeContainer): Removed safety check
4509         for nested attribute classes.
4510         (Class.attribute_usage): Removed.
4511         (Class.ResolveAttributeUsage): Resolves AttributeUsageAttribute
4512         for attribute class.
4513         
4514         * ecore.cs (IsAttribute): Removed.
4515         
4516         * namespace.cs (UsingEntry.Resolve): Don't destroy NamespaceEntry.
4517         
4518         * rootcontext.cs (RegisterAttribute): Removed, attributes are
4519         now normal types.
4520         (attribute_types): Removed.
4521         (EmitCode): Global attributes are emited as the latest.
4522
4523 2005-02-18  Marek Safar  <marek.safar@seznam.cz>
4524
4525         * class.cs (EmitFieldInitializers): Don't emit field initializer
4526         for default values when optimilization is on.
4527         
4528         * constant.cs (Constant.IsDefaultValue): New property.
4529         
4530         * driver.cs: Add /optimize handling.
4531         
4532         * constant.cs,
4533         * ecore.cs,
4534         * literal.cs: Implement new IsDefaultValue property.
4535         
4536         * rootcontext.cs (Optimize): New field, holds /optimize option.
4537
4538 2005-02-18  Raja R Harinath  <rharinath@novell.com>
4539
4540         Fix crasher in re-opened #72347.
4541         * namespace.cs (Namespace.Lookup): Return null if
4542         DeclSpace.DefineType returns null.
4543
4544         Fix #72678.
4545         * expression.cs (Argument.Resolve): Handle a case of CS0120 here.
4546
4547 2005-02-18  Raja R Harinath  <rharinath@novell.com>
4548
4549         Fix remainder of #63202.  Change semantics of DoResolveLValue: it
4550         now returns null if it cannot resolve to an lvalue.
4551         * ecore.cs (Expression.DoResolveLValue): Return 'null' by default.
4552         (Expression.ResolveLValue): Emit CS0131 error if DoResolveLValue
4553         returned null.  Remove check for SimpleName.
4554         (EventExpr.DoResolveLValue): New.
4555         * iterators.cs (Iterator.FieldExpression.DoResolveLValue): New.
4556         * expression.cs (Argument.Error_LValueRequired): New.  Move CS1510
4557         error from ...
4558         (Argument.Resolve): ... here.  Use it.  Use DoResolveLValue to
4559         avoid CS0131 error.
4560         (Unary.ResolveOperator): Move CS0211 check ...
4561         (Unary.DoResolve): ... here.  Use DoResolveLValue to avoid
4562         CS0131 error.
4563         (Unary.DoResolveLValue): Simplify.
4564         (AddressOf.DoResolveLValue): New.
4565         (ArrayAccess.DoResolveLValue): New.
4566
4567 2005-02-16  Marek Safar  <marek.safar@seznam.cz>
4568
4569         * attribute.cs (Attribute.Resolve): Add arguments casting for
4570         when types doesn't match ctor arguments.
4571
4572 2005-02-16  Raja R Harinath  <rharinath@novell.com>
4573
4574         Fix parts of #63202.
4575         * expression.cs (UnaryMutator.ResolveOperator): Remove redundant
4576         lookup of operator in base type.  Ensure that all checks happen
4577         when the operator resolves to an "op_..." method.
4578
4579 2005-02-15  Raja R Harinath  <rharinath@novell.com>
4580
4581         Fix #71992.
4582         * namespace.cs (NamespaceEntry.LookupNamespaceOrType): Add
4583         'ignore_cs0104' parameter.  Pass it to ...
4584         (NamespaceEntry.Lookup): ... this.
4585         * decl.cs (DeclSpace.LookupType): Add 'ignore_cs0104' parameter.
4586         * ecore.cs (SimpleName.ResolveAsTypeStep): Update.
4587         (TypeLookupExpression.DoResolveAsTypeStep): Update.
4588         * expression.cs (MemberAccess.IdenticalNameAndTypeName):
4589         Update.  Request that cs0104 errors be ignored.
4590         (ComposedCast.ResolveAsTypeStep): Update.
4591
4592 2005-02-14  Raja R Harinath  <rharinath@novell.com>
4593
4594         Fix #59209.
4595         * expression.cs (Invocation.BetterFunction): Remove support for
4596         comparing virtual functions and their overrides.
4597         (Invocation.IsOverride): New.
4598         (Invocation.OverloadResolve): Don't consider 'override' functions
4599         during candidate selection.  Store them in a lookaside list.
4600         If the selected method is a 'virtual' function, use the list to
4601         find any overrides that are closer to the LHS type.
4602
4603 2005-02-14  Marek Safar  <marek.safar@seznam.cz>
4604
4605         * expression.cs (New.DoResolve): Add complex core type reduction.
4606         (New.Constantify): Converts complex core type syntax like 'new int ()'
4607         to simple constant.
4608         
4609 2005-02-14  Raja R Harinath  <rharinath@novell.com>
4610
4611         * decl.cs (EntryType.EntryType): New constructor to create an
4612         updated copy of a cache entry.
4613         (MemberCache.AddMethods): Use it.
4614         (MemberCache.ClearDeclaredOnly): Remove.
4615         (MemberCache.MemberCache): Update.
4616
4617 2005-02-11  Miguel de Icaza  <miguel@novell.com>
4618
4619         * codegen.cs (EmitContext): Introduce the `MethodIsStatic'
4620         variable.  This one is represents the actual low-level declaration
4621         of the method, as opposed to the semantic level `IsStatic'.   
4622
4623         An anonymous method which is hosted into a static method might be
4624         actually an instance method.  IsStatic would reflect the
4625         container, while MethodIsStatic represents the actual code
4626         generated.
4627
4628         * expression.cs (ParameterReference): Use the new MethodIsStatic
4629         instead of IsStatic.
4630
4631         * anonymous.cs (AnonymousMethod.Compatible): Pass the
4632         Modifiers.STATIC to the Anonymous' Method EmitContext if static is
4633         set on the current EmitContext. 
4634
4635         * expression.cs (Cast): Overload DoResolveLValue so we can pass
4636         resolve our casted expression as an LValue.  This triggers the
4637         proper LValue processing that is later required by Assign.
4638
4639         This fixes 72347.
4640
4641         * cs-tokenizer.cs (pp_and): recurse on pp_and, fixes #61903.
4642
4643 2005-02-11  Marek Safar  <marek.safar@seznam.cz>
4644
4645         C# 2.0 Fixed buffer implementation
4646
4647         * anonymous.cs: Update after RegisterHelperClass renaming.
4648
4649         * attribute.cs (AttributeTester.fixed_buffer_cache):
4650         Cache of external fixed buffers.
4651         (AttributeTester.GetFixedBuffer): Returns IFixedBuffer
4652         implementation if field is fixed buffer else null.
4653
4654         * class.cs
4655         (TypeContainer.AddField): Accept FieldMember instead of Field.
4656         (FieldBase.IsFieldClsCompliant): Extracted code from
4657         VerifyClsCompliance descendant customization.
4658         (FixedField): New class handles fixed buffer fields.
4659         (FixedFieldExternal): Keeps information about imported fixed
4660         buffer.
4661         (IFixedField): Make access to internal or external fixed buffer
4662         same.
4663
4664         * cs-parser.jay: Add fixed buffer parsing.
4665
4666         * ecore.cs (FieldExpr.Emit): Add special emit case for fixed
4667         buffer.
4668
4669         * expression.cs (Indirection): Extended implementation to accept
4670         fixed buffer field.
4671         (PointerArithmetic.Emit): Get element from fixed buffer as well.
4672         (ElementAccess.MakePointerAccess): Get type as parameter.
4673         (DoResolve): Add fixed buffer field expression conversion.
4674         (DoResolveLValue): Ditto.
4675         (FixedBufferPtr): New class. Moved most of original ArrayPtr.
4676         (ArrayPtr): Derives from FixedBufferPtr.
4677         (ArrayPtr.Emit): Add extra emit for array elements.
4678
4679         * flowanalysis.cs.cs (StructInfo): Use FieldMember.
4680
4681         * rootcontext.cs (CloseTypes): Emit CompilerGenerated attribute
4682         for compiler generated types.
4683         (RegisterCompilerGeneratedType): Renamed from RegisterHelperClass.
4684
4685         * statement.cs (Fixed): Refactored to be easier add fixed buffer
4686         and consume less memory.
4687         (Fixed.Resolve): Add fixed buffer case.
4688
4689         * typemanager.cs (compiler_generated_attr_ctor,
4690         fixed_buffer_attr_ctor): Add new 2.0 compiler attributes.
4691         (HasElementType): Add our own implementation to work on every
4692         runtime.
4693
4694 2005-02-11  Miguel de Icaza  <miguel@novell.com>
4695
4696         * anonymous.cs (CaptureContext): Track whether `this' has been
4697         referenced.   
4698
4699         * expression.cs (This.ResolveBase): Call CaptureThis.  Before we
4700         only captured `this' if it was implicitly done (instance
4701         methods/variables were used). 
4702
4703         * codegen.cs (EmitContext.CaptureThis): New method to flag that
4704         `this' must be captured.
4705
4706 2005-01-30  Miguel de Icaza  <miguel@novell.com>
4707  
4708         * anonymous.cs (CreateMethodHost): If there Scope.ScopeTypeBuilder
4709         is null it means that there has been no need to capture anything,
4710         so we just create a sibling.
4711
4712         Renamed `EmitHelperClasses' to `EmitAnonymousHelperClasses'
4713
4714         Just a partial fix.  The other half is fairly elusive.
4715         
4716 2005-02-10  Raja R Harinath  <rharinath@novell.com>
4717
4718         Fix #52586, cs0121-4.cs.
4719         * decl.cs (MemberCache.DeepCopy): Rename from SetupCache.  Take
4720         and return a hashtable.
4721         (MemberCache.ClearDeclaredOnly): New.
4722         (MemberCache.MemberCache): Update to change.  Make a deep copy of
4723         the method_hash of a base type too.
4724         (MemberCache.AddMethods): Adapt to having a deep copy of the base
4725         type methods.  Overwrite entries with the same MethodHandle so
4726         that the ReflectedType is correct.  The process leaves in base
4727         virtual functions and their overrides as distinct entries.
4728         (CacheEntry): Now a class instead of a struct.  It shouldn't alter
4729         matters since it was boxed in a ArrayList before.
4730         (CacheEntry.Member, CacheEntry.EntryType): Remove 'readonly'
4731         modifier.
4732         * expression.cs (Invocation.BetterFunction): Simplify.  Handle the
4733         case of a virtual function and its override (choose the overload
4734         as better).
4735         (Invocation.OverloadResolve): Avoid 'override' members during
4736         'applicable_type' calculation.
4737
4738 2005-03-28  Raja R Harinath  <rharinath@novell.com>
4739
4740         * typemanager.cs (TypeHandle.BaseType): Make into an IMemberContainer.
4741         (TypeHandle.TypeHandle): Use LookupMemberCache rather than
4742         GetTypeHandle.  It is possible for a reflected type to derive from
4743         a TypeBuilder (e.g., int[] derives from the TypeBuilder
4744         System.Array during mscorlib compilation).
4745         * decl.cs (MemberCache.MemberCache): If the base cache doesn't
4746         contain a method_hash, don't create one either.  Don't create a
4747         deep copy of the base cache's method_hash.
4748         (MemberCache.SetupCache): Rename back from DeepCopy.
4749         (MemberCache.AddMethods): Rewrite, now that method_hash isn't
4750         already initialized.  If we see an override function, add its
4751         underlying base virtual function to the member_hash too.
4752
4753 2005-02-09  Raja R Harinath  <rharinath@novell.com>
4754
4755         Combine two near-redundant caches.
4756         * typemanager.cs (method_params): Rename from method_internal_params.
4757         (TypeManager.GetParameterData): New.  Replace
4758         Invocation.GetParameterData.
4759         (TypeManager.LookupParametersByBuilder): Remove.
4760         * expression.cs (Invocation.method_parameter_cache): Remove.
4761         (Invocation.GetParameterData): Remove.
4762         Update to changes.
4763         * anonymous.cs, attribute.cs, convert.cs, delegate.cs:
4764         Update to changes.
4765
4766 2005-02-08  Raja R Harinath  <rharinath@novell.com>
4767
4768         Fix #72015.
4769         * delegate.cs (Delegate.DefineType): When bootstrapping corlib, if
4770         TypeManager.multicast_delegate_type is null, resolve it by looking
4771         up "System.MulticastDelegate".
4772         * rootcontext.cs (RootContext.ResolveCore): Simplify.
4773
4774 2005-02-07  Abin Thomas (NOSIP)  <projectmonokochi@rediffmail.com>
4775             Anoob V.E (NOSIP)  <projectmonokochi@rediffmail.com>
4776             Harilal P.R (NOSIP)  <projectmonokochi@rediffmail.com>
4777
4778         Fix cs0164.cs.
4779         * statement.cs (LabeledStatement.Resolve): Don't set 'referenced'.
4780         (LabeledStatement.AddReference): New.  Set 'referenced'.
4781         (Goto.Resolve): Use it.
4782
4783 2005-02-05  John Luke  <john.luke@gmail.com>
4784
4785         * driver.cs: remove duplicate -doc line in Usage ()
4786
4787 2005-02-04  Raja R Harinath  <rharinath@novell.com>
4788
4789         * location.cs (Location.AddFile): Fix CS2002 error report.
4790
4791 2005-02-02  Martin Baulig  <martin@ximian.com>
4792
4793         * delegate.cs (Delegate.DefineType): Report an internal error if
4794         TypeManager.multicast_delegate_type is null.  See bug #72015 for
4795         details.        
4796
4797 2005-02-02  Raja R Harinath  <rharinath@novell.com>
4798
4799         Fix a crasher in a variant of #31984.
4800         * const.cs (Constant.CheckBase): New override that defers the
4801         new-or-override check in case the base type hasn't been populated
4802         yet.
4803         (Constant.Define): Ensure the new-or-override check is performed.
4804
4805 2005-02-01  Duncan Mak  <duncan@ximian.com>
4806
4807         * const.cs (LookupConstantValue): Check that `ce' is not null
4808         before calling GetValue ().
4809
4810 2005-02-01  Raja R Harinath  <rharinath@novell.com>
4811
4812         Fix test-334.cs (#69519).
4813         * cs-parser.jay (using_alias_directive): Pass in an expression to
4814         NamespaceEntry.UsingAlias.
4815         (using_namespace_directive): Pass in an expression to
4816         NamespaceEntry.Using.
4817         (namespace_name): Don't flatten to a string.
4818         * namespace.cs (NamespaceEntry.AliasEntry): Store an expression.
4819         (NamespaceEntry.AliasEntry.Resolve): Lookup using
4820         ResolveAsTypeStep.
4821         (NamespaceEntry.UsingEntry): Likewise.
4822         (NamespaceEntry.Using,NamespaceEntry.UsingAlias): Update to
4823         changes.
4824         (NamespaceEntry.LookupForUsing): Remove.
4825         (NamespaceEntry.LookupNamespaceOrType): Add support for dotted
4826         names.
4827         (NamespaceEntry.Lookup): Remove support for dotted names.
4828
4829 2005-02-01  Raja R Harinath  <rharinath@novell.com>
4830
4831         * namespace.cs (NamespaceEntry.NamespaceEntry): Simplify, and
4832         split into two.
4833         (NamespaceEntry.ImplicitParent): Compute on demand.
4834         (NamespaceEntry.Doppelganger): New implicit namespace-entry that
4835         parallels the current.
4836         (NamespaceEntry.LookupForUsing): Use it.
4837         (NamespaceEntry.Lookup): If the current namespace-entry is
4838         implicit, don't search aliases and using tables.
4839
4840 2005-02-01  Raja R Harinath  <rharinath@novell.com>
4841
4842         Fix #31984.
4843         * class.cs (TypeContainer.DoDefineMembers): Don't initialize
4844         BaseCache here.
4845         (TypeContainer.BaseCache): Compute on demand.
4846         (TypeContainer.FindMembers): Define constants and types if they're
4847         not already created.
4848         (FieldMember.Define): Move resetting of ec.InUnsafe before error
4849         check.
4850         * const.cs (Constant.Define): Make idempotent.
4851
4852 2005-01-29  Miguel de Icaza  <miguel@novell.com>
4853
4854         * pending.cs: Produce better code (no nops produced by using Ldarg
4855         + value).
4856         
4857         * pending.cs (PendingImplementation.DefineProxy): It was not `arg
4858         i - 1' it should be arg + 1.
4859
4860         Fixes bug #71819.
4861
4862 2005-01-28  Raja R Harinath  <rharinath@novell.com>
4863
4864         * attribute.cs (Attribute.CheckAttributeType): Make private
4865         non-virtual.
4866         (Attribute.ResolveType): Make virtual.
4867         (GlobalAttribute.ResolveType,GlobalAttribute.Resolve): Simplify
4868         handling of RootContext.Tree.Types.
4869
4870 2005-01-27  Raja R Harinath  <rharinath@novell.com>
4871
4872         Update attribute-handling to use the SimpleName/MemberAccess
4873         mechanisms.
4874         * cs-parser.jay (attribute): Pass in an expression to the
4875         constructors of Attribute and GlobalAttribute.
4876         * attribute.cs (Attribute): Take an expression for the name.
4877         (Attribute.ResolvePossibleAttributeTypes): New.  Resolves the
4878         passed in attribute name expression.
4879         (Attribute.CheckAttributeType): Use it.
4880         * ecore.cs (FullNamedExpression.ResolveAsTypeStep): New.
4881         * expression.cs (MemberAccess.ResolveAsTypeStep): Move body to ...
4882         (MemberAccess.ResolveNamespaceOrType): ... here.  Add 'silent'
4883         argument to prevent error messages if the lookup fails.
4884
4885 2005-01-27  Marek Safar  <marek.safar@seznam.cz>
4886
4887         * expression.cs (Indirection): Implemented IVariable interface
4888         to support indirection in AddressOf operator.
4889         (PointerArithmetic.Emit): Add optimalization for case where
4890         result can be precomputed.
4891
4892 2005-01-26  Martin Baulig  <martin@ximian.com>
4893
4894         * class.cs (TypeContainer.AttributeTargets): Return the correct
4895         AttributeTargets depending on our `Kind' instead of throwing an
4896         exception; fixes #71632.
4897
4898 2005-01-26  Marek Safar  <marek.safar@seznam.cz>
4899
4900         Fix #71257
4901         * expression.cs (MemberAccess.ResolveMemberAccess): Add CS0176 test for
4902         constant members.
4903
4904 2005-03-17  Martin Baulig  <martin@ximian.com>
4905
4906         * anonymous.cs (AnonymousMethod.method_modifiers): Change default
4907         from `Modifiers.INTERNAL' to `Modifiers.PRIVATE'.  Fixes #73260.
4908
4909 2005-03-17  Martin Baulig  <martin@ximian.com>
4910
4911         * anonymous.cs (AnonymousMethod.EmitMethod): Changed return type
4912         to bool so we can return an error condition.
4913         (AnonymousDelegate.Emit): Check whether AnonymousMethod.EmitMethod()
4914         returned an error.
4915
4916 2005-03-17  Martin Baulig  <martin@ximian.com>
4917
4918         * generic.cs (TypeMananager.IsIEnumerable): New public method.
4919
4920         * convert.cs (Convert.ImplicitReferenceConversion(Exists)): Allow
4921         converting from an array-type of T to `IEnumerable<T>'.
4922
4923 2005-03-16  Martin Baulig  <martin@ximian.com>
4924
4925         * generic.cs (Nullable.Unwrap): Implement IAssignMethod.
4926         (Nullable.LiftedUnaryMutator): New public class.
4927
4928         * expression.cs (UnaryMutator.DoResolve): Added support for
4929         Nullable Types.
4930
4931 2005-03-14  Martin Baulig  <martin@ximian.com>
4932
4933         * generic.cs (Nullable.NullCoalescingOperator): Implemented.
4934
4935 2005-03-14  Martin Baulig  <martin@ximian.com>
4936
4937         * generic.cs (Nullable.LiftedBinaryOperator): Added support for
4938         the comparision operators `<', `>', `<=' and `>='.
4939
4940 2005-03-13  Martin Baulig  <martin@ximian.com>
4941
4942         * generic.cs
4943         (Nullable.NullLiteral): Renamed to `Nullable.NullableLiteral' to
4944         avoid confusion with the `NullLiteral'.
4945         (Nullable.LiftedBinaryOperator): Correctly implement `==' and '!='.
4946
4947 2005-03-13  Martin Baulig  <martin@ximian.com>
4948
4949         * expression.cs (Binary.ResolveOperator): For `==' and `!=', allow
4950         comparing arbitrary types with the null literal.
4951
4952 2005-03-13  Martin Baulig  <martin@ximian.com>
4953
4954         * generic.cs (Nullable.LiftedBinaryOperator): Add support for the
4955         boolean operators '&&', '||', '&' and '|'.
4956         (Nullable.OperatorTrueOrFalse): New public class.
4957
4958         * ecore.cs (Expression.GetOperatorTrue/False): Return an `Expression'
4959         instead of a `StaticCallExpr'; added support for nullables.
4960
4961 2005-03-10  Martin Baulig  <martin@ximian.com>
4962
4963         * expression.cs
4964         (ArrayAccess.EmitDynamicInitializers): Use `etype.IsValueType'
4965         rather than `etype.IsSubclassOf (TypeManager.value_type)'.      
4966
4967 2005-03-07  Martin Baulig  <martin@ximian.com>
4968
4969         * generic.cs (Nullable.Unwrap): Implement IMemoryLocation and make
4970         it work if `expr' is not an IMemoryLocation.
4971         (Nullable.Lifted): Implement IMemoryLocation.
4972         (Nullable.LiftedConversion.ResolveUnderlying): Use the correct
4973         target type.
4974
4975 2005-03-05  Martin Baulig  <martin@ximian.com>
4976
4977         * generic.cs (Nullable.Unwrap, Wrap): New protected classes.
4978         (Nullable.Lifted): New abstract class; rewrote the lifted conversions.
4979         (Nullable): Added support for lifted unary and binary operators.
4980
4981         * expression.cs (Unary.DoResolve): Added support for nullable types.
4982         (Binary.DoResolve): Likewise.
4983         (Conditional.DoResolve): Likewise.
4984
4985 2005-03-02  Martin Baulig  <martin@ximian.com>
4986
4987         * decl.cs (DeclSpace.SetParameterInfo): Make this virtual.
4988
4989         * class.cs (ClassPart.SetParameterInfo): Override this.
4990         (PartialContainer.SetParameterInfo): Override this.
4991         (TypeContainer.CheckConstraints): New protected method.
4992         (PartialContainer.CheckConstraints): Override this and check
4993         whether the same contraints were specified in all parts of a
4994         partial generic type definition.
4995         (PartialContainer.UpdateConstraints): New public method.
4996
4997         * generic.cs (TypeParameter.UpdateConstraints): New public method.
4998
4999 2005-03-02  Martin Baulig  <martin@ximian.com>
5000
5001         Committing a patch from Carlos Alberto Cortez to fix #72887.
5002
5003         * convert.cs (Convert.ExplicitReferenceConversionExists): Allow
5004         casts from `T []' to `int []'.
5005
5006 2005-03-02  Martin Baulig  <martin@ximian.com>
5007
5008         * generic.cs (TypeManager.IsEqual): Make this symmetric.
5009
5010         * expression.cs (Binary.ResolveOperator): When resolving a
5011         BinaryDelegate, use `TypeManager.IsEqual (l, r)' rather than just
5012         `=='.  Fixes #71866.  See gen-127.cs.
5013
5014 2005-03-02  Martin Baulig  <martin@ximian.com>
5015
5016         * class.cs (TypeContainer.DoDefineMembers): We also need a default
5017         static constructor in static classes.
5018
5019 2005-03-02  Martin Baulig  <martin@ximian.com>
5020
5021         * generic.cs
5022         (NullableType.Name, NullableType.FullName): Add a "?" to the name.
5023         (Nullable.LiftedConversion): Added support for user-defined
5024         conversions.
5025
5026         * cs-tokenizer.cs (Tokenizer.PutbackCloseParens): New public method.
5027
5028         * cs-parser.jay: Use ComposedCast everywhere instead of
5029         NullableType, so we don't need to check for NullableType
5030         everywhere.
5031         (conditional_expression): Added `INTERR CLOSE_PARENS' rule for the
5032         case where we'll be resolved into a `parenthesized_expression_0'
5033         afterwards.
5034
5035         * convert.cs
5036         (Convert.UserDefinedConversion): Added nullable conversions.
5037
5038 2005-02-28  Martin Baulig  <martin@ximian.com>
5039
5040         * generic.cs (TypeManager.IsNullableType): New static method.
5041         (Nullable): New abstract class.
5042         (Nullable.NullLiteral): New public class.
5043         (Nullable.LiftedConversion): New public class.
5044
5045         * cs-parser.jay (non_expression_type): Changed `builtin_types' to
5046         `builtin_types opt_nullable'.
5047
5048         * convert.cs
5049         (Convert.ImplicitConversionStandard): Added nullable conversions.
5050         (Convert.ExplicitConversionStandard): Likewise.
5051         (Convert.ExplicitConversion): Likewise.
5052
5053 2005-02-26  Martin Baulig  <martin@ximian.com>
5054
5055         * expression.cs (ComposedCast.DoResolveAsTypeStep): Allow `dim' to
5056         begin with a "?", for instance "?[]".  Don't do a type lookup if
5057         `dim' is empty.
5058
5059 2005-02-25  Martin Baulig  <martin@ximian.com>
5060
5061         The first part of Nullable Types :-)
5062
5063         * generic.cs (NullableType): New public class.
5064         (NullCoalescingOperator): New public class.
5065         (TypeArguments.Resolve): Add a CS0306 check.
5066
5067         * cs-parser.jay (opt_error_modifier): Removed, this was unused.
5068         (opt_nullable): New rule.
5069         (type): Added `opt_nullable' to `namespace_or_type_name',
5070         `builtin_types' and `pointer_type'.
5071         (array_type): Added `opt_nullable'.
5072         (opt_rank_specifier_or_nullable): New rule; this is the
5073         combination of `opt_rank_specifier' and `opt_nullable'.
5074         (opt_error): New rule; catch errors here.
5075         (nullable_type_or_conditional): New rule; we use this to check for
5076         nullable and still detect the conditional operator.
5077         (local_variable_type): Use `opt_rank_specifier_or_nullable'
5078         instead `opt_rank_specifier'.
5079
5080         * expression.cs (ComposedCast.DoResolveAsTypeStep): Added support
5081         for nullables.
5082
5083 2005-02-24  Martin Baulig  <martin@ximian.com>
5084
5085         * README, README.Changes: Removed; they're old and obsolete.
5086
5087 2005-02-22  Martin Baulig  <martin@ximian.com>
5088
5089         * generic.cs (TypeParameter.Resolve): If resolving the constraints
5090         returned an error, set `constraints' to null to avoid a crash
5091         later on.
5092         (TypeParameter.ResolveType): Likewise.
5093
5094 2005-02-22  Martin Baulig  <martin@ximian.com>
5095
5096         * generic.cs
5097         (Constraints.ResolveTypes): Protect against being called twice.
5098         (Constraints.CheckInterfaceMethod): Don't call ResolveTypes().
5099         (TypeParameter.ResolveType): New public method; calls
5100         constraints.ResolveTypes().
5101         (TypeParameter.DefineType): Moved constraints.ResolveType() out
5102         into the new ResolveType().
5103         (GenericMethod.Define): Call ResolveType() on all our
5104         TypeParameter's.        
5105
5106 2005-02-21  Martin Baulig  <martin@ximian.com>
5107
5108         * generic.cs
5109         (TypeManager.generic_nullable_type): New static public field.
5110         (TypeManager.InitGenericCoreType): Lookup "System.Nullable`1".
5111
5112         * rootcontext.cs
5113         (RootContext.ResolveCore): Resolve "System.Nullable`1".
5114
5115 2005-02-15  Martin Baulig  <martin@ximian.com>
5116
5117         * generic.cs (ConstructedType.Constraints): Correctly check
5118         constraints if the argument type is a type parameter; fixes
5119         #72326. 
5120
5121 2005-02-02  Martin Baulig  <martin@ximian.com>
5122
5123         * delegate.cs (Delegate.DefineType): Report an internal error if
5124         TypeManager.multicast_delegate_type is null.  See bug #72015 for
5125         details.        
5126
5127 2005-01-29  Miguel de Icaza  <miguel@novell.com>
5128
5129         * pending.cs: Produce better code (no nops produced by using Ldarg
5130         + value).
5131         
5132         * pending.cs (PendingImplementation.DefineProxy): It was not `arg
5133         i - 1' it should be arg + 1.
5134
5135         Fixes bug #71819.
5136         
5137 2005-01-26  Martin Baulig  <martin@ximian.com>
5138
5139         * cs-parser.jay (indexer_declarator): Don't report an error if we
5140         have type parameters since we can be an explicit interface
5141         implementation; fixes #71449.
5142
5143 2005-01-26  Martin Baulig  <martin@ximian.com>
5144
5145         * class.cs (TypeContainer.AttributeTargets): Return the correct
5146         AttributeTargets depending on our `Kind' instead of throwing an
5147         exception; fixes #71632.
5148
5149 2005-01-26  Martin Baulig  <martin@ximian.com>
5150
5151         * delegate.cs (Delegate.DefineType): Correctly define our type
5152         parameters.  Fixes #71483.
5153
5154 2005-01-25  Raja R Harinath  <rharinath@novell.com>
5155
5156         Fix #71602.
5157         * expression.cs (MemberAccess.DoResolve): Don't complain with
5158         cs0572 when the LHS of a member access has identical name and type
5159         name.
5160
5161 2005-01-25  Marek Safar  <marek.safar@seznam.cz>
5162
5163         Fix #71651, #71675
5164         * attribute.cs (ExtractSecurityPermissionSet): Catch exceptions from
5165         CreatePermission.
5166         Create custom PermissionSet only for PermissionSetAttribute.
5167
5168 2005-01-24  Marek Safar  <marek.safar@seznam.cz>
5169
5170         Fix #71649
5171         * class.cs (StaticClass.DefineContainerMembers): Enable enums and
5172         delegates in static class.
5173
5174 2005-01-24  Martin Baulig  <martin@ximian.com>
5175
5176         * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
5177         merging an implicit block, just use its reachability.
5178
5179         * statement.cs (Block.Resolve): Make the unreachable code check
5180         work wrt. implicit blocks; see test-337 from #63842.
5181
5182 2005-01-21  Alp Toker  <alp@atoker.com>
5183  
5184         * cs-parser.jay: destructor_declaration's container is PartialContainer
5185         not Class when partial types are used, so use Kind prop instead of
5186         'is'.
5187         
5188 2005-01-22  Miguel de Icaza  <miguel@ximian.com>
5189
5190         * cs-parser.jay: Improve error reporting when an interface
5191         declares new types.
5192
5193 2005-01-20  Dick Porter  <dick@ximian.com>
5194
5195         * support.cs: SeekableStreamReader fix from Sandor Dobos
5196         (dobos_s@ibcnet.hu) to cope with Position setting when multibyte
5197         chars are read.  Fixes bug 70369.
5198
5199 2005-01-20  Raja R Harinath  <rharinath@novell.com>
5200
5201         * cs-parser.jay (catch_clause): Simplify current_block handling
5202         somewhat.
5203
5204 2005-01-17  Miguel de Icaza  <miguel@ximian.com>
5205
5206         * convert.cs (ImplicitStandardConversionExists): Synchronize the
5207         code with ImplicitStandardConversion to handle the implicit
5208         conversion of method groups into valid delegate invocations. 
5209
5210         The problem is that in parameter handling we were using this code
5211         path.  Fixes bug #64698
5212
5213 2005-01-19  Raja R Harinath  <rharinath@novell.com>
5214
5215         * cs-parser.jay: Fix several infelicities.
5216         - Avoid assigning to the parser value stack.  Code like 
5217           '$3 = null' is unclean.  Synthesize a value for the code block
5218           instead. 
5219         - Avoid using oob_stack for storing location information.  Use ...
5220         (_mark_): ... this.  New (empty) rule.  Saves the current location
5221         in $$.
5222         (foreach_statement): Avoid using oob_stack for current_block
5223         handling.  Use technique used in for_statement and
5224         using_statement.  Synthesize a value for the code block to store
5225         additional intermediate information.
5226
5227 2005-01-13  Miguel de Icaza  <miguel@ximian.com>
5228
5229         * ecore.cs (IsAccessorAccessible): Accessibility to private fields
5230         of a different type is only allowed to private fields of a
5231         containing type, not on fields of a base class.
5232
5233         See test-174.cs and error cs0122-9.cs
5234
5235 2005-01-13  Raja R Harinath  <rharinath@novell.com>
5236
5237         Fix test-335.cs (bug #58126).
5238         * cs-parser.jay (argument): Split out non-expression parts of the
5239         rule into 'non_simple_argument'.
5240         (invocation_expression): Support parenthesized invocations with
5241         multiple arguments, and with single non-simple arguments.
5242
5243 2005-01-13  Raja R Harinath  <rharinath@novell.com>
5244
5245         * cs-tokenizer.cs (xtoken): Reset 'comments_seen' in a couple more
5246         places.
5247
5248 2005-01-12  Raja R Harinath  <rharinath@novell.com>
5249
5250         Fix cs0038-1.cs, cs1640-6.cs.
5251         * ecore.cs (Expression.Resolve): Remove special-case for
5252         SimpleName in error-handling.
5253         (Expression.almostMatchedMembers): Relax access permission to
5254         protected.
5255         (Expression.MemberLookupFailed): Handle duplicates in
5256         almostMatchedMembers list.
5257         (SimpleName.DoSimpleNameResolve): Catch CS0038 errors earlier.
5258         * expression.cs (New.DoResolve): Report CS1540 for more cases.
5259         * typemanager.cs (GetFullNameSignature): Use the MethodBase
5260         overload if the passed in MemberInfo is a MethodBase.
5261
5262 2005-01-25  Martin Baulig  <martin@ximian.com>
5263
5264         * doc.cs
5265         (DocUtil.emptyParamList): Removed; use `Type.EmptyTypes' instead.
5266
5267 2005-01-12  Marek Safar  <marek.safar@seznam.cz>
5268
5269         Fix #70749
5270         * attribute.cs (ExtractSecurityPermissionSet): Don't report error
5271         for non-CAS & merge permission sets properly.
5272
5273 2005-01-11  Raja R Harinath  <rharinath@novell.com>
5274
5275         Improve standard-compliance of simple name and member access 
5276         resolution.  Fixes bugs #52697, #57200, #67520, #69519.
5277         * ecore.cs (FullNamedExpression): New abstract base class 
5278         for Namespaces and TypeExpressions.
5279         (ResolveFlags.SimpleName): Remove.
5280         (SimpleName): Remove support for dotted names.
5281         (SimpleName.ResolveAsTypeStep): Simplify.  Now just a wrapper to 
5282         DeclSpace.FindType and DeclSpace.LookupType.
5283         (SimpleName.DoSimpleNameResolve): Remove support for dotted names.
5284         (Expression.ExprClassName): Make member function.
5285         * expression.cs (MemberAccess.ResolveAsTypeStep): Support LHS being
5286         a namespace.  Remove creation of dotted "SimpleName"s.
5287         (MemberAccess.DoResolve): Likewise.
5288         * decl.cs (DeclSpace.Cache): Make private.
5289         (DeclSpace.LookupInterfaceOrClass): Return a FullNamedExpression.
5290         (DeclSpace.FindType): Update.
5291         (DeclSpace.LookupType): Move here from RootContext.  Return a 
5292         FullNamedExpression.
5293         * namespace.cs (Namespace): Derive from FullNamedExpression
5294         so that it can be part of expression resolution.
5295         (Namespace.Lookup): Return an FullNamedExpression.
5296         (NamespaceEntry.LookupAlias): Lookup aliases only in current
5297         namespace.
5298         * rootcontext.cs (NamespaceLookup): Remove.
5299         (LookupType): Move to DeclSpace.
5300         * attribute.cs (CheckAttributeType): Update.
5301         * doc.cs (FindDocumentedType): Remove allowAlias argument.
5302         (FindDocumentedTypeNonArray): Likewise.
5303
5304 2005-01-11  Raja R Harinath  <rharinath@novell.com>
5305
5306         Fix cs0509.cs, cs1632.cs.
5307         * class.cs (TypeContainer.GetNormalBases): Don't assume !IsClass
5308         is the same as IsInterface.
5309         (TypeContainer.GetClassBases): Likewise.
5310         * statement.cs (LabeledStatement.ig): New field.
5311         (LabeledStatement.LabelTarget): Save ILGenerator which created the
5312         label.
5313         (LabeledStatement.DoEmit): Check that the label was created with
5314         the same ILGenerator.
5315
5316 2005-01-10  Marek Safar  <marek.safar@seznam.cz>
5317
5318         Fix #71058
5319         * attribute.cs (GetMethodObsoleteAttribute): Need to transform
5320         accessors to its properties.
5321
5322         * ecore.cs (PropertyExpr): Add AccessorTable to help track back
5323         from accessors to property.
5324         
5325 2005-01-10  Marek Safar  <marek.safar@seznam.cz>
5326
5327         Fix #70722
5328         * class.cs (MethodCore.CheckBase): Test base method obsoleteness
5329         only for overrides.
5330         
5331 2005-01-08  Miguel de Icaza  <miguel@ximian.com>
5332
5333         * attribute.cs: Check for null and empty strings.  
5334
5335         I have lost another battle to Paolo.
5336
5337 2005-01-07  Marek Safar  <marek.safar@seznam.cz>
5338
5339         Fix #70942
5340         * class.cs (PropertyMethod): Set Parent field in ctors.
5341         (SetMethod.InternalParameters): Add unsafe switch hack.
5342         Override MarkForDuplicationCheck where it is appropriate.
5343
5344         * decl.cs (MemberCore.MarkForDuplicationCheck): New method.
5345         It says whether container allows members with the same name.
5346         Base default is no.
5347         (DeclSpace.AddToContainer): Use MarkForDuplicationCheck.
5348         Removed is_method parameter.
5349
5350 2005-01-06  Duncan Mak  <duncan@ximian.com>
5351
5352         * cs-tokenizer.cs (xtoken): Redo the work for signaling CS1040
5353         because the previous change led to incorrect reporting of CS1032
5354         ("Cannot define/undefine preprocessor symbols after first token in
5355         file"). Instead of using `tokens_seen' as the only flag that
5356         triggers CS1040, introduce `comments_seen'. This new flag is used
5357         to signify having seen comments on the current line, so it is
5358         unset after a newline.
5359
5360 2005-01-06  Atsushi Enomoto  <atsushi@ximian.com>
5361
5362         * doc.cs : When searching for a type, find nested type too.
5363           This fixes bug #71040.
5364
5365 2005-01-06  Atsushi Enomoto  <atsushi@ximian.com>
5366
5367         * doc.cs :
5368           - Warn missing member comment on those classes which also does not
5369             have doc comments. Fixed bug #71041.
5370           - Don't warn missing doc comment on default constructor.
5371             Fixed bug #71042.
5372
5373 2005-01-06  Duncan Mak  <duncan@ximian.com>
5374
5375         * cs-tokenizer.cs (xtoken): After handling traditional C-style
5376         comments, set `tokens_seen' to true. This allows us to detect
5377         misplaced preprocessor directives (i.e. not at the beginning of
5378         the a line, nor after whitespaces). In that case, report error
5379         CS1040. This fixes bug #56460.
5380
5381         * cs-parser.jay (interface_member_declaration): Add checks for
5382         IsExplicitImpl, and report CS0541 error if an interface member is
5383         defined as an explicit interface declaration.
5384
5385 2005-01-06  Marek Safar  <marek.safar@seznam.cz>
5386
5387         Fix #70817
5388         * class.cs (PropertyMethod): Set Parent field in ctors.
5389         (SetMethod.InternalParameters): Add unsafe switch hack.
5390         
5391         * decl.cs (MemberCore.Parent): Cannot be readonly.
5392
5393 2005-01-06  Raja R Harinath  <rharinath@novell.com>
5394
5395         * decl.cs (DeclSpace.ResolveType): Remove.
5396         (DeclSpace.ResolveBaseTypeExpr): Rename from ResolveTypeExpr.
5397         Merge in code from ...
5398         (DeclSpace.GetTypeResolvingEmitContext): ... here.  Remove.
5399         * class.cs, enum.cs: Update to changes.
5400
5401 2005-01-06  Miguel de Icaza  <miguel@ximian.com>
5402
5403         * anonymous.cs: Ensure that we init the scope of our parent if it
5404         has not been initialized yet.
5405
5406 2004-12-30  Duncan Mak  <duncan@ximian.com>
5407
5408         * typemanager.cs (TypeManager.CheckStructCycles): Don't crash here
5409         if field.FieldBuilder is null. Fixes #70758.
5410
5411         * convert.cs: Fixed some typos and updated some of the comments.
5412         (ImplicitStandardConversionExists):
5413         (TryImplicitIntConversion): If `target_type' is an interface and
5414         the type of `ic' implements this interface, return true or a new
5415         BoxedCast instead of null. This fixes #70468.
5416
5417 2004-12-29  Duncan Mak  <duncan@ximian.com>
5418
5419         * expression.cs (Argument.Emit): Check that Expr is
5420         IMemoryLocation before casting to it, and report CS1510 otherwise.
5421
5422         This fixes #70402.
5423
5424 2004-12-21  Ben Maurer  <bmaurer@ximian.com>
5425
5426         * statement.cs (Block.ThisVariable): remove the recursion here, to
5427         make the --profile more sane.
5428
5429 2004-12-17  Carlos Cortez <calberto.cortez@gmail.com>
5430
5431         * driver.cs: Patch to handle a xsp bug that prevents to reference an .exe
5432         assembly, by JB Evain.
5433
5434 2004-12-17  Raja R Harinath  <rharinath@novell.com>
5435
5436         * class.cs, decl.cs, ecore.cs, iterators.cs, pending.cs, 
5437           rootcontext.cs, typemanager.cs: Make nomenclature consistent.
5438         "parent" refers to enclosing type/class.  "base" refers to superclass.
5439
5440 2004-12-17  Raja R Harinath  <rharinath@novell.com>
5441
5442         * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
5443         Ensure that we only have GlobalAttributes.
5444         * attribute.cs (Attribute.Emit): Make non-virtual.
5445         (GlobalAttribute.Emit): Remove.
5446         (Attribute.Resolve): Make virtual.
5447         (GlobalAttribute.Resolve): New.  Set Rootcontext.Tree.Types.NamespaceEntry.
5448         (Attribute.GetConditionalAttributeValue): Take an EmitContext as
5449         the argument. Don't create one.
5450         (Attribute.GetObsoleteAttribute): Likewise.
5451         (Attribute.GetClsCompliantAttributeValue): Likewise.
5452         * class.cs, decl.cs: Update to changes.
5453
5454 2004-12-17  Marek Safar  <marek.safar@seznam.cz>
5455
5456         * delegate.cs (NewDelegate.DoResolve): Add error 149 report.
5457         
5458         * ecore.cs (Expression.MemberLookupFailed): Fixed error 143.
5459         
5460         * statement.cs (Foreach.Resolve): Add error 186 report.
5461
5462 2004-12-16  Marek Safar  <marek.safar@seznam.cz>
5463
5464         * expression.cs (Conditional.DoResolve): Add warning 429.
5465         
5466         * statement.cs (If.Resolve): Add warning 665.
5467
5468 2004-12-16  Raja R Harinath  <rharinath@novell.com>
5469
5470         New invariant: RootContext.Tree.Types.NamespaceEntry == null
5471         except when in the parser, and in GlobalAttribute.
5472         * driver.cs (MainDriver): Reset RootContext.Tree.Types.NamespaceEntry.
5473         * attribute.cs (GlobalAttribute.CheckAttributeType): Reset
5474         RootContext.Tree.Types.NamespaceEntry once work is done.
5475         (GlobalAttribute.Emit): New.  Wrapper for Attribute.Emit, but sets
5476         and resets RootContext.Tree.Types.NamespaceEntry.
5477
5478 2004-12-15  Marek Safar  <marek.safar@seznam.cz>
5479
5480         * cs-parser.jay: Don't create a block for every variable.
5481
5482 2004-12-14  Miguel de Icaza  <miguel@ximian.com>
5483
5484         * location.cs: Provide extra information.
5485
5486         * statement.cs: The instance is not `ldarg_0.THIS' when accessing
5487         variables from the captured environment, it is the ldarg_0.
5488
5489 2004-12-14  Marek Safar  <marek.safar@seznam.cz>
5490
5491         * cs-parser.jay: Changed warning level for 642 to 4 until Miguel
5492         find a conclusion.
5493         
5494         * class.cs: Changed warning level for 169 to avoid developer
5495         displeasure from warning flooding. It will be changed back when they
5496         fix most of current BCL warnings.
5497         
5498         * RootContext.cs: Pushed default WarningLevel to 3.
5499         
5500         * statement.cs: Removed unused variable.
5501
5502 2004-12-14  Marek Safar  <marek.safar@seznam.cz>
5503
5504         * class.cs (TypeContainer.GetClassBases): Add error 1521 report.
5505         (TypeContainer.MethodModifiersValid): Refactored to use MemberCore.
5506         Add error 502 report.
5507         (StaticClass.DefineType): Add error 441 report.
5508         (Class.AllowedModifiersProp): New virtual property as temporary
5509         extension to AllowedModifiers.
5510         (Class.DefineType): Add error 418 report. Moved ModFlags check here
5511         to share implementation with StaticClass and don't call virtual
5512         methods from ctor.
5513         
5514         * driver.cs (MainDriver): Add error 1558 test.
5515
5516         * parameter.cs (Parameter.ApplyAttributeBuilder): Add error 662
5517         report. Moved error 36 test here.
5518
5519         * statement.cs (Throw.Resolve): Add error 724 report.
5520
5521         * typemanager.cs: Add out_attribute_type core type.
5522         
5523 2004-12-13  Marek Safar  <marek.safar@seznam.cz>
5524
5525         * class.cs (TypeContainer.VerifyClsCompliance): Add error
5526         3018 report.
5527         (PropertyBase.VerifyClsCompliance): Add errror 3025 report.
5528
5529         * codegen.cs (ModuleClass.ApplyAttributeBuilder): Add error
5530         3017 report.
5531         
5532         * decl.cs (MemberCore.VerifyClsCompliance): Add warning 3021.
5533
5534         * parameter.cs (ReturnParameter.ApplyAttributeBuilder): 
5535         Add error 3023 report.
5536         (Parameter.ApplyAttributeBuilder): Add error 3022 report.
5537
5538         * tree.cs (RootTypes.IsClsCompliaceRequired): Add fake
5539         implementation.
5540
5541 2004-12-12  John Luke  <john.luke@gmail.com>
5542
5543         * driver.cs (AddArgs): take -- into account when
5544         adding arguments, fixes bug 65710 
5545
5546 2004-12-12  Martin Baulig  <martin@ximian.com>
5547
5548         * expression.cs (Unary.TryReduceNegative): Added support for
5549         SByteConstant and ByteConstant.
5550         (Unary.Reduce): Check error values from TryReduceNegative().
5551
5552 2004-12-10  Marek Safar  <marek.safar@seznam.cz>
5553
5554         * attributes.cs (Attribute.Resolve): Avoid multiple error report
5555         and report exception as error 182.
5556
5557 2004-12-10  Raja R Harinath  <rharinath@novell.com>
5558
5559         * driver.cs (Main): Fix message when there are warnings.
5560
5561 2004-12-09  Miguel de Icaza  <miguel@ximian.com>
5562
5563         * delegate.cs: Fixed my fix from yesterday, sorry about that.
5564
5565 2004-12-09  Marek Safar  <marek.safar@seznam.cz>
5566
5567         * anonymous.cs, class.cs, convert.cs, doc.cs, support.cs: 
5568         Reduced number of warnings.
5569         
5570         * class.cs (TypeContainer.VerifyClsCompliance): One if is enough.
5571
5572 2004-12-08  Miguel de Icaza  <miguel@ximian.com>
5573
5574         * driver.cs: Removed message.
5575
5576         * delegate.cs: Fix bug introduced in 1.1.x: 70219.
5577
5578 2004-12-08    <vargaz@freemail.hu>
5579
5580         * cs-tokenizer.cs: Add workaround for NET 2.0 beta 1 csc bug.
5581
5582 2004-12-08  Martin Baulig  <martin@ximian.com>
5583
5584         * class.cs (TypeContainer.VerifyClsCompliance): Report a CS3003
5585         instead of a CS3002 for properties and indexer.
5586
5587 2004-12-08  Martin Baulig  <martin@ximian.com>
5588
5589         * decl.cs (MemberName.ToString): Make this work again.
5590
5591 2004-12-08  Marek Safar  <marek.safar@seznam.cz>
5592
5593         * attribute.cs (Resolve): Add error 591 detection.
5594
5595         * class.cs (FieldMember.Define): Add error 1547 detection.
5596         (Indexer.Define): Add error 620 detection.
5597         (Operator.Define): Add error 590 detection.
5598
5599         * ecore.cs: Missing argument for error 79.
5600
5601         * expression.cs (ComposedCast.DoResolveAsTypeStep): Add error 611
5602         detection.
5603
5604 2004-12-07  Marek Safar  <marek.safar@seznam.cz>
5605
5606         Fix #70106
5607         * assign.cs.cs (Assign.DoResolve): Reports error 1648 for value types
5608         only.
5609
5610 2004-12-07  Atsushi Enomoto  <atsushi@ximian.com>
5611
5612         * cs-parser.jay : handle doc comments on implicit/explicit operators.
5613           Some operator comments were suppressed.
5614         * doc.cs : Implicit/explicit operator name in doc comments are like
5615           "op_Explicit(type)~returnType", so added suffix handling.
5616
5617 2005-01-21  Alp Toker  <alp@atoker.com>
5618
5619         * cs-parser.jay: destructor_declaration's container is PartialContainer
5620         not Class when partial types are used, so use Kind prop instead of 'is'.
5621
5622 2004-12-12  Martin Baulig  <martin@ximian.com>
5623
5624         * expression.cs (Unary.TryReduceNegative): Added support for
5625         SByteConstant and ByteConstant.
5626         (Unary.Reduce): Check error values from TryReduceNegative().
5627
5628 2004-12-11  Martin Baulig  <martin@ximian.com>
5629
5630         * support.cs (ReflectionParameters.ParameterName): If we have a
5631         `gpd', call `ParameterName' on it.
5632
5633         * parameter.cs (Parameter.GetParameterAttributes): New static method.
5634
5635         * pending.cs (PendingImplementation.DefineProxy): Call
5636         DefineParameter() for all of the MethodBuilder's arguments.
5637
5638 2004-12-09  Martin Baulig  <martin@ximian.com>
5639
5640         * doc.cs (DocUtil): Make this a static class.
5641
5642 2004-12-09  Martin Baulig  <martin@ximian.com>
5643
5644         * expression.cs (Invocation.InferType): Moved the type inference
5645         implementation into TypeManager.
5646
5647         * generics.cs (TypeManager): Moved the type inference
5648         implementation here.
5649
5650 2004-12-09  Martin Baulig  <martin@ximian.com>
5651
5652         * typemanager.cs (TypeManager): Make this a partial class.
5653
5654         * generics.cs
5655         (TypeManager): Move the generics part of `TypeManager' here.
5656
5657 2004-12-08  Martin Baulig  <martin@ximian.com>
5658
5659         * class.cs (TypeContainer.VerifyClsCompliance): Report a CS3003
5660         instead of a CS3002 for properties and indexer.  Added CS3024
5661         check for generic interfaces.
5662
5663         * attributes.cs (AttributeTester.AnalyzeTypeCompliance): Generic
5664         instances are not CLS-compliant.
5665
5666 2004-12-08  Martin Baulig  <martin@ximian.com>
5667
5668         * cs-parser.jay
5669         (void_pointer_expression): New rule for `void*', `void**' etc.
5670         (typeof_expression): Add `void_pointer_expression'; fixes #66846.       
5671
5672 2004-12-08  Martin Baulig  <martin@ximian.com>
5673
5674         * expression.cs (Invocation.InferType): Removed the hack for
5675         MethodCore.MayUnify().  
5676
5677         * typemanager.cs (TypeManager.MayBecomeEqualGenericTypes): Make
5678         this actually work.
5679
5680         * class.cs (MethodCore.MayUnify): Use
5681         TypeManager.MayBecomeEqualGenericTypes().       
5682
5683 2004-12-08  Martin Baulig  <martin@ximian.com>
5684
5685         * expression.cs (Is.DoResolve, As.DoResolve): If we're a type
5686         parameter, box it.  Fixes #69233.
5687
5688 2004-12-08  Martin Baulig  <martin@ximian.com>
5689
5690         * generic.cs (ConstructedType.CheckConstraints): Valuetypes always
5691         have the ctor constraint.  Fixes #68326.
5692
5693 2004-12-07  Atsushi Enomoto  <atsushi@ximian.com>
5694
5695         * cs-parser.jay : interface comment was not consumed because of
5696           extra opt_semicolon before doc handling.
5697
5698 2004-12-03  Raja R Harinath  <rharinath@novell.com>
5699
5700         Fix test-327.cs, test-328.cs, and put in early infrastructure
5701         for eventually fixing #52697.
5702         * namespace.cs (NamespaceEntry.LookupForUsing): New method.
5703         (NamespaceEntry.LookupNamespaceOrType): New method, refactored
5704         from other methods.
5705         (NamespaceEntry.Lookup): Remove 'ignore_using' flag.
5706         (AliasEntry.Resolve, UsingEntry.Resolve): Use 'LookupForUsing'.
5707         (VerifyUsing, error246): Update.
5708         * rootcontext.cs (RootContext.NamespaceLookup): Just use
5709         'NamespaceEntry.LookupNamespaceOrType'.
5710
5711 2004-12-07  Martin Baulig  <martin@ximian.com>
5712
5713         * driver.cs: Call it "BETA SOFTWARE" :-)
5714
5715 2004-12-06  Raja R Harinath  <rharinath@novell.com>
5716
5717         Fix crash on cs0657-17.cs.
5718         * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
5719         Use RootContext.Tree.Types, not 'new RootTypes ()'.
5720         * attribute.cs (GlobalAttribute.CheckAttributeType): Narrow down
5721         the case where the NamespaceEntry gets overwritten.
5722
5723 2004-12-06  Marek Safar  <marek.safar@seznam.cz>
5724
5725         Fixed #69195, #56821
5726         * ecore.cs (ResolveBoolean): Tiny refactoring.
5727
5728         * expression.cs (Binary.DoResolve): Add warning 429 and skipping
5729         of right expression resolving when left is false constant and
5730         operator is LogicalAnd OR true constant and operator is LogicalOr.
5731
5732         * statement.cs (ResolveUnreachable): Always reports warning.
5733
5734 2004-12-05  Miguel de Icaza  <miguel@ximian.com>
5735
5736         * class.cs: Distinguish between 1721 and 1722 (just a little help
5737         for the programmer).
5738
5739 2004-12-03  Miguel de Icaza  <miguel@ximian.com>
5740
5741         * delegate.cs: Only allow this on new versions of the language. 
5742
5743 2004-12-02  Duncan Mak  <duncan@ximian.com>
5744
5745         * ecore.cs (PropertyExpr.IsAccessorAccessible): Moved to
5746         Expression class.
5747         (Expression.IsAccessorAccessible): Moved from the PropertyExpr to
5748         here as a static method. Take an additional bool out parameter
5749         `must_do_cs1540_check' for signaling to InstanceResolve.
5750         (PropertyExpr.InstanceResolve): Removed the `must_do_cs1540_check'
5751         member field from PropertyExpr class and made it an argument of
5752         the method instead.
5753         (EventExpr.InstanceResolve): Copied from PropertyExpr, removed the
5754         check for MarshalByRefObject, and report CS0122 instead of CS1540.
5755         (EventExpr.DoResolve): Call IsAccessorAccessible on `add_accessor'
5756         and `remove_accessor' as well as InstanceResolve: report CS0122
5757         where applicable.
5758
5759         Fixes #70129.
5760
5761 2004-12-07  Martin Baulig  <martin@ximian.com>
5762
5763         * decl.cs (DeclSpace.AddToContainer): Report correct errors CS0694
5764         and CS0692 where appropriate.
5765
5766 2004-12-06  Martin Baulig  <martin@ximian.com>
5767
5768         * class.cs (MethodCore.MayUnify): Moved the CS0408 check here from
5769         IsDuplicateImplementation() and improved it.
5770
5771         * expression.cs (Invocation.InferTypeArguments): Added
5772         `Type[] inferred_class_types' argument (for MethodCore.MayUnify)
5773         and removed the "ref" modifier from `infered_types'.
5774
5775         * decl.cs (MemberName.ToString): Removed the exception.
5776
5777 2004-12-03  Atsushi Enomoto  <atsushi@ximian.com>
5778
5779         * cs-tokenizer.cs : Only '////' is rejected. Other non-whitespace
5780           comments are allowed.
5781
5782 2004-12-03  Carlos Alberto Cortez <calberto.cortez@gmail.com>
5783
5784         * delegate.cs: Add checks for subtypes in paramaters and return values
5785         in VerifyMethod () to add support for Covariance/Contravariance
5786         in delegates.
5787         
5788 2004-12-02  Miguel de Icaza  <miguel@ximian.com>
5789
5790         * report.cs: Remove extra closing parenthesis.
5791
5792         * convert.cs (Error_CannotImplicitConversion): If the name of the
5793         types are the same, provide some extra information.
5794
5795 2004-12-02  Marek Safar  <marek.safar@seznam.cz>
5796
5797         Fix bug #70102
5798         * attribute.cs (Resolve): Improved implementation of params
5799         attribute arguments.
5800
5801         * support.cs (ParameterData): Add HasParams to be faster.
5802
5803 2004-12-02  Atsushi Enomoto  <atsushi@ximian.com>
5804
5805         all things are for /doc support:
5806
5807         * doc.cs: new file that supports XML documentation generation.
5808         * mcs.exe.sources: added doc.cs.
5809         * driver.cs:
5810           Handle /doc command line option.
5811           Report error 2006 instead of 5 for missing file name for /doc.
5812           Generate XML documentation when required, after type resolution.
5813         * cs-tokenizer.cs:
5814           Added support for picking up documentation (/// and /** ... */),
5815           including a new XmlCommentState enumeration.
5816         * cs-parser.jay:
5817           Added lines to fill Documentation element for field, constant,
5818           property, indexer, method, constructor, destructor, operator, event
5819           and class, struct, interface, delegate, enum.
5820           Added lines to warn incorrect comment.
5821         * rootcontext.cs :
5822           Added Documentation field (passed only when /doc was specified).
5823         * decl.cs:
5824           Added DocComment, DocCommentHeader, GenerateDocComment() and
5825           OnGenerateDocComment() and some supporting private members for
5826           /doc feature to MemberCore.
5827         * class.cs:
5828           Added GenerateDocComment() on TypeContainer, MethodCore and Operator.
5829         * delegate.cs:
5830           Added overriden DocCommentHeader.
5831         * enum.cs:
5832           Added overriden DocCommentHeader and GenerateDocComment().
5833
5834 2004-12-01  Miguel de Icaza  <miguel@ximian.com>
5835
5836         * cfold.cs (ConstantFold.DoConstantNumericPromotions): After
5837         unwrapping the enumeration values, chain to
5838         DoConstantNumericPromotions again, so we can promote things to the
5839         fundamental types (takes care of enums that are bytes, sbytes).
5840
5841         Fixes bug #62054.
5842
5843 2004-12-01  Raja R Harinath  <rharinath@novell.com>
5844
5845         * attribute.cs (Attribute.CheckAttributeType): Remove complain flag.
5846         Fix long-standing bug in type-lookup.  Use FindType instead of
5847         LookupType when ec.ResolvingTypeTree.
5848         (Attribute.ResolveType, Attribute.Resolve)
5849         (Attribute.DefinePInvokeMethod,GlobalAttribute.CheckAttributeType):
5850         Update to changes.
5851         (Attributes.Search): Remove internal version.  Update.
5852         (Attributes.SearchMulti): Update.
5853         (Attributes.GetClsCompliantAttribute): Remove.
5854         (Attributes.GetIndexerNameAttribute): Remove.
5855         * decl.cs (MemberCore.GetClsCompliantAttributeValue): Update to changes.
5856         (DeclSpace.GetClsCompliantAttributeValue): Likewise.
5857         * class.cs (Indexer.Define): Likewise.
5858
5859 2004-12-01  Marek Safar  <marek.safar@seznam.cz>
5860
5861         Fix bug #68790
5862         * ecore.cs: CheckMarshallByRefAccess new virtual method for testing
5863         MarshallByReference members access.
5864
5865         * expression.cs: Use CheckMarshallByRefAccess;
5866         Better error CS0197 message.
5867
5868         * report.cs: Print whole related error message.
5869
5870 2004-11-29  Marek Safar  <marek.safar@seznam.cz>
5871
5872         * class (GetClassBases): Better error 60 report.
5873         (EventProperty): Disabled warning 67 detection.
5874
5875 2004-11-29  Marek Safar  <marek.safar@seznam.cz>
5876
5877         Fix bug #60324
5878         * cfold.cs (Assign.DoResolve): Add subtraction for DecimalConstant.
5879
5880         * constant.cs (DecimalConstant.Emit): Don't use int ctor for
5881         precise values.
5882
5883 2004-11-29  Marek Safar  <marek.safar@seznam.cz>
5884
5885         Fix bug #49488
5886         * assign.cs (Assign.DoResolve): Add error 1648, 1650 report.
5887
5888         * decl.cs (MemberCore.MemberName): Error 1648 in compiler.
5889
5890 2004-11-26  Miguel de Icaza  <miguel@ximian.com>
5891
5892         * attribute.cs (Attribute.Resolve): Refine error reporting and
5893         report a cs0117 if the identifier does not exist, to distinguish
5894         from 0617 which is a miss-use of the actual identifier.
5895
5896         * ecore.cs (EventExpr.Emit): Refine error report and distinguish
5897         between cs0070 and cs0079.
5898
5899         * class.cs (MemberBase.DoDefine): When reporting a wrong
5900         accessibility level, we use MethodCore to compare instead of
5901         Method (this was a regression in some refactoring effort).
5902
5903         So now we correctly report cs0056 again.
5904
5905         * convert.cs (ImplicitReferenceConversion): Corrected typo, I was
5906         testing the target_type (which was known to be object_type) and
5907         not the source type (which is anonymous_method).
5908
5909         Fixed reporting of error cs1660.
5910
5911         * expression.cs (UserCast.Source): Expose the underlying cast.
5912
5913         * statement.cs (Switch.SwitchGoverningType): Sort the list of
5914         allowed types to find a match to int32 first (most common).
5915
5916         In addition, it ignores any ImplicitUserConversions that did an
5917         internal implicit conversion (as the switch statement allows only
5918         one integral conversion to exist).
5919
5920         * class.cs (PartialContainer.Create): rename `name' to
5921         `member_name' for clarity.  Then replace the string calls with a
5922         call to MemberName.GetPartialName, as now using
5923         MemberName.ToString is an error (this is due to the side effects
5924         it had, that were fixed in the past).
5925
5926         This will restore the error reporting on a number of partial class
5927         errors that were missusing this (and getting an exception as a
5928         results, which is now just a plain textual warning, because
5929         yyparse debug output would crash otherwise).
5930
5931 2004-11-26  Raja R Harinath  <rharinath@novell.com>
5932
5933         * Makefile (PROGRAM_INSTALL_DIR): Remove.
5934
5935 2004-11-25  Ben Maurer  <bmaurer@ximian.com>
5936
5937         * rootcontext.cs (LookupType): Make sure to cache lookups that
5938         don't give us a negative result. This saves about 5% of corlib
5939         compilation time.
5940
5941 2004-11-25  Miguel de Icaza  <miguel@ximian.com>
5942
5943         * report.cs (AbstractMessage.Print): messages are sent to stderr
5944
5945         * class.cs (TypeContainer.GetClassBases): It is an error to have a
5946         non-interface in the list of interfaces (at this point, either
5947         parent was properly set, or a base class is being listed in the
5948         interfaces section).
5949
5950         This flags error 1722, and resolves the crash from bug 69259.
5951
5952 2004-11-25  Ben Maurer  <bmaurer@ximian.com>
5953
5954         * statement.cs (Using.EmitExpressionFinally): make this work right
5955         for valuetypes. Fixes 69926.
5956
5957 2004-11-25  Miguel de Icaza  <miguel@ximian.com>
5958
5959         * const.cs (Const.ChangeType): Cope with the "0 literal can be
5960         converted to an enum" here, before we try to change the underlying
5961         type.  This code exists, but it is a different code path than the
5962         one used while encoding constants.
5963
5964         (ImplicitReferenceConversionExists): In addition, resynchronized
5965         the code here, so it matches the same code in
5966         ImplicitReferenceConversionExists for the `from any class-type S
5967         to any interface-type T'.       
5968
5969 2004-11-25  Marek Safar  <marek.safar@seznam.cz>
5970
5971         * cfold.cs (BinaryFold): Add addition for DecimalConstant.
5972
5973 2004-11-24  Miguel de Icaza  <miguel@ximian.com>
5974
5975         * cs-parser.jay: Use verbosity accordingly. 
5976
5977 2004-11-24  Marek Safar  <marek.safar@seznam.cz>
5978
5979         * expression.cs (Unary.ResolveOperator): Do not report warning;
5980         AddressOf reads from variable.
5981         
5982         (LocalVariableReferences.DoResolveBase): Improved my previous fix.
5983
5984 2004-11-24  Marek Safar  <marek.safar@seznam.cz>
5985
5986         Fix bug #69462
5987
5988         * attribute.cs (Attributable): Removed CheckTargets.
5989         (Attributes.Emit): Explicit attribute targets are tested here.
5990
5991         * class.cs (EventField.ValidAttributeTargets): Explicit target "field" is
5992         not enabled for interfaces.
5993
5994         * codegen.cs (CommonAssemblyModulClass.AddAttributes): Removed CheckTargets.
5995         (GetAssemblyName): Ouch next bug there.
5996
5997 2004-11-23  Carlos Alberto Cortez <calberto.cortez@gmail.com>
5998
5999         * expression.cs: Error 275 added.
6000         
6001 2004-11-23  Marek Safar  <marek.safar@seznam.cz>
6002
6003         Fix bug #69177 (Implemented decimal constant support)
6004
6005         * cfold.cs (DoConstantNumericPromotions: Add DecimalConstant.
6006         (BinaryFold): Add DecimalConstant.
6007
6008         * const.cs (Define): Decimal constant 
6009         (is not constant.
6010         (ChangeType): Add decimal type handling.
6011         (LookupConstantValue): Don't set value for decimal type but
6012         emit DecimalConstantAttribute. Needed for constant optimization.
6013
6014         * constant.cs (ToDecimal): New method.
6015         (ConvertToDecimal): New method.
6016         (IntConstant): Implemented ConvertToDecimal.
6017         (DecimalConstant.Emit): Emit optimized version for decimals in
6018         int range.
6019
6020         * expression.cs (ResolveOperator): Changed order of constant
6021         reduction to work correctly with native types which have
6022         overloaded operators.
6023         (ResolveMemberAccess): Extract constant value from attribute
6024         for decimal type.
6025
6026         * rootcontext.cs (ResolveCore): Add DecimalConstantAttribute.
6027
6028         * typemanager.cs (TypeManager): Add decimal_constant_attribute_type,
6029         void_decimal_ctor_int_arg, decimal_constant_attribute_ctor.
6030         (ChangeType): Decimal is special.
6031         (TypeToCoreType): Add decimal type.
6032
6033 2004-11-22  Marek Safar  <marek.safar@seznam.cz>
6034
6035         * convert.cs (ImplicitConversionRequired): Add error cs0642 for
6036         decimal types.
6037
6038 2004-11-22  Marek Safar  <marek.safar@seznam.cz>
6039
6040         * class.cs (EventField.ApplyAttributeBuilder): Fix error
6041         test cs1667-5.cs.
6042
6043 2004-11-19  Marek Safar  <marek.safar@seznam.cz>
6044
6045         * class.cs (MemberBase.DoDefine): Fix error cs0508 report.
6046
6047         * pending.cs (PendingImplementation): Grab only interfaces.
6048
6049 2004-11-19  Marek Safar  <marek.safar@seznam.cz>
6050
6051         * statement.cs (ForeachHelperMethods): Add location member and
6052         error 202 detection.
6053
6054 2004-11-18  Marek Safar  <marek.safar@seznam.cz>
6055
6056         * expression.cs (DoResolveBase): Fixed wrong warning for out
6057         variables.
6058
6059 2004-12-04  Martin Baulig  <martin@ximian.com>
6060
6061         * convert.cs (Convert.TypeParameter_to_Null): Use the constraints
6062         to check whether the conversion is ok.
6063
6064         * typemanager.cs (TypeManager.GetTypeArguments): Just return
6065         `Type.EmptyTypes' if we're not a generic TypeContainer.
6066
6067 2004-11-25  Miguel de Icaza  <miguel@ximian.com>
6068
6069         * convert.cs (ImplicitReferenceConversionExists): A surprisingly
6070         old bug: when converting from the null literal to a pointer,
6071         return an EmptyCast, not the NullLiteral.
6072
6073         This fixes #69921, the recent null_type changes probably made this
6074         bug more prominent.
6075
6076 2004-12-03  Martin Baulig  <martin@ximian.com>
6077
6078         * delegate.cs (NewDelegate.DoResolve): If we have an anonymous
6079         method as our child, call AnonymousMethod.Compatible() on it.
6080
6081 2004-12-02  Miguel de Icaza  <miguel@ximian.com>
6082
6083         * class.cs (FieldBase): Use an unused bit field from the field to
6084         encode the `has_offset' property from the FieldMember.  This saves
6085         a couple of Ks on bootstrap compilation.
6086
6087         * delegate.cs (NewDelegate.DoResolve): If we have an anonymous
6088         method as our child, return the AnonymousMethod resolved
6089         expression.
6090
6091         * expression.cs (New.DoResolve): Allow return values from
6092         NewDelegate to also include AnonymousMethods.
6093
6094         Fixes #70150.
6095
6096 2004-11-29  Raja R Harinath  <rharinath@novell.com>
6097
6098         * decl.cs (MemberCore.MemberName): Remove readonly to fix an error
6099         cs1648 report.
6100         * rootcontext.cs (ResolveCore::interfaces_first_stage): Add
6101         System.Runtime.InteropServices._Exception, since it's a base
6102         interface of the core type System.Exception in the net_2_0 profile.
6103
6104 2004-11-27  Martin Baulig  <martin@ximian.com>
6105
6106         * ecore.cs (Expression.StoreFromPtr): Use `stobj' for generic parameters.
6107
6108 2004-11-26  Raja R Harinath  <rharinath@novell.com>
6109
6110         * Makefile: Convert to use executable.make.
6111         * gmcs.exe.sources: New.
6112
6113 2004-11-25  Martin Baulig  <martin@ximian.com>
6114
6115         * expression.cs (Invocation.InferType): Added support for byref types.
6116
6117 2004-11-25  Martin Baulig  <martin@ximian.com>
6118
6119         * statement.cs (Foreach.FetchMethodMoveNext): Wrap `mi.ReturnType'
6120         in TypeManager.TypeToCoreType().
6121
6122 2004-11-25  Martin Baulig  <martin@ximian.com>
6123
6124         * iterators.cs (Iterator.DoDefineMembers): Override and lookup the
6125         "Dispose" method from the `current_type'.
6126         (Iterator.EmitMoveNext): Use the `dispose_method' we looked up in
6127         DoDefineMembers() instead of using the MethodBuilder; this is
6128         required for generic iterators.
6129
6130         * class.cs (TypeContainer.DoDefineMembers): Make this virtual.
6131
6132 2004-11-24  Martin Baulig  <martin@ximian.com>
6133
6134         * ecore.cs (Expression.LoadFromPtr): Use `ldobj' for generic parameters.
6135
6136 2004-11-20  Martin Baulig  <martin@ximian.com>
6137
6138         * expression.cs (Invocation.InferType): Correctly infer generic
6139         instances; see gen-103.cs.
6140         (Invocation.InferTypeArguments): If a generic method doesn't have
6141         any unbound type parameters, we don't need to infer anything.
6142
6143 2004-11-19  Raja R Harinath  <rharinath@novell.com>
6144
6145         * Makefile (gmcs.exe): Update to new location of bootstrap mcs.exe.
6146
6147 2004-11-17  Raja R Harinath  <rharinath@novell.com>
6148
6149         * typemanager.cs (TypeHandle.GetTypeHandle): Make private.
6150         (TypeHandle.GetMemberCache): New.
6151         (TypeHandle.TypeHandle): Update.
6152         (TypeManager.LookupMemberCache): Rewritten from LookupMemberContainer.
6153         (TypeManager.LookupParentInterfacesCache):
6154         Rename from LookupInterfaceCache.  Optimize slightly.
6155         (TypeManager.MemberLookup_FindMembers): Update.
6156         * decl.cs (MemberCache.MemberCache): Set Container to null in the
6157         multi-type variant.
6158         (AddCacheContents): Rename from AddHashtable.
6159         * class.cs (TypeContainer.parent_container): Remove.
6160         (TypeContainer.VerifyClsCompliance): Don't use parent_container.
6161         (TypeContainer.DoDefineMembers): Don't initialize it.
6162         Update to name changes.
6163         
6164 2004-11-17  Miguel de Icaza  <miguel@ximian.com>
6165
6166         * class.cs (MethodCore.CheckAccessModifiers): New helper routine
6167         that factors the code to check access modifiers on override.  
6168
6169         (PropertyBase): Use the code here.
6170
6171         Patch from Lluis S'anchez, fixes bug #69361.
6172
6173 2004-11-15  Miguel de Icaza  <miguel@ximian.com>
6174
6175         * anonymous.cs (AnonymousMethod.Error_AddressOfCapturedVar): New
6176         routine that is used to report the use of a captured variable
6177         whose address has been taken.
6178
6179         There are two checks: one when variables are being captured and
6180         the other check is when the address of a variable is taken. 
6181         
6182         (because an anonymous methods might be resolved before *or* after
6183         the address has been taken) and 
6184
6185         * expression.cs (Conditional.DoResolve): Remove the special
6186         casing that Martin added to trueExpr and falseExpr being both
6187         NullLiteral.  We get the right behavior now just by introducing
6188         the null_type into the compiler. 
6189
6190         * convert.cs (ExplicitConversion): Change the code to use
6191         null_type instead of testing `expr is NullLiteral'.
6192         (ImplicitConversionStandard): use null_type too.
6193         (ImplicitReferenceConversionExists): use null_type too.
6194         (ImplicitReferenceConversion): use null_type too.
6195
6196         * literal.cs: The type of `NullLiteral' is now null_type instead
6197         of object_type. 
6198         (Resolve): Set the type here.
6199
6200         * typemanager.cs: Introduce null_type.
6201
6202 2004-11-18  Martin Baulig  <martin@ximian.com>
6203
6204         * rootcontext.cs
6205         (RootContext.LookupType): Return a `Type', not a `TypeExpr'.
6206
6207 2004-11-18  Martin Baulig  <martin@ximian.com>
6208
6209         * ecore.cs (TypeExpr.DoResolveAsTypeStep): Make this protected.
6210
6211 2004-11-18  Martin Baulig  <martin@ximian.com>
6212
6213         * generic.cs (Constraints.Resolve): Take an `EmitContext' instead
6214         of a `DeclSpace'.  If one of our constraints is a `ConstructedType',
6215         call ResolveConstructedType() on it to resolve it without checking
6216         constraints.
6217         (Constraints.ResolveTypes): Check them here.
6218         (ConstructedType.DoResolveAsTypeStep): Fully resolve ourselves,
6219         but don't check constraints.
6220         (ConstructedType.ResolveAsTypeTerminal): Override this and also
6221         check constraints here.
6222         (ConstructedType.ResolveConstructedType): New public method.  This
6223         is called from DoResolveAsTypeStep() and Constraints.Resolve() to
6224         resolve ourselves without checking constraints.
6225
6226         * ecore.cs (Expression.ResolveAsTypeTerminal): Make this virtual.
6227
6228 2004-11-18  Martin Baulig  <martin@ximian.com>
6229
6230         * decl.cs
6231         (DeclSpace.CurrentType): Changed type from `TypeExpr' to `Type'.
6232
6233         * delegate.cs (Delegate.DefineType): Always create the EmitContext.
6234
6235 2004-11-18  Martin Baulig  <martin@ximian.com>
6236
6237         * ecore.cs (TypeExpr.ResolveType): Removed.
6238         (Expression.ResolveAsTypeTerminal): We always return a fully
6239         resolved `TypeExpr', so we can just access its `Type'.
6240
6241         * class.cs (TypeContainer.DefineType): Resolve `CurrentType' here.
6242
6243 2004-11-17  Martin Baulig  <martin@ximian.com>
6244
6245         * ecore.cs (IAlias.Type): Replaced with ResolveAsType() to make
6246         sure we don't return any unresolved TypeExpr's.
6247         (TypeAliasExpression): The .ctor now takes an `IAlias' instead of
6248         a `TypeExpr'.
6249         (Expression.ResolveAsTypeTerminal): Make sure `te.Type != null'.
6250
6251         * expression.cs (MemberAccess.ResolveAsTypeStep): Don't return any
6252         unresolved `ConstructedType's.
6253
6254 2004-11-17  Martin Baulig  <martin@ximian.com>
6255
6256         * ecore.cs (TypeExpr.ResolveType): Don't make this virtual.
6257
6258 2004-11-17  Martin Baulig  <martin@ximian.com>
6259
6260         * ecore.cs
6261         (Expression.ResolveAsTypeTerminal): Removed the `bool silent' argument.
6262
6263         * decl.cs (DeclSpace.ResolveType): Removed.
6264         (DeclSpace.ResolveTypeExpr): Removed the `bool silent' argument.
6265
6266 2004-11-17  Martin Baulig  <martin@ximian.com>
6267
6268         * decl.cs (MemberCache.AddHashtable): Add entries in the opposite
6269         direction, like FindMembers() does.  Fixes #69546, testcase is in
6270         test-315.cs.    
6271
6272 2004-11-16  Martin Baulig  <martin@ximian.com>
6273
6274         This is based on a patch from Marek Safar, see bug #69082.
6275         Fixes bugs #63705 and #67130.
6276
6277         * typemanager.cs (TypeManager.LookupInterfaceCache): New public
6278         method; create a MemberCache for an interface type and cache the
6279         result.
6280
6281         * decl.cs (IMemberContainer.ParentContainer): Removed.
6282         (IMemberContainer.ParentCache): New property.
6283         (MemberCache.SetupCacheForInterface): Removed.
6284         (MemberCache..ctor): Added .ctor which takes a `Type[]'; use this
6285         to create a cache for an interface's "parent".
6286
6287         * class.cs (TypeContainer.DoDefineMembers): Setup cache for
6288         interfaces too.
6289
6290 2004-11-14  Ben Maurer  <bmaurer@ximian.com>
6291
6292         * statement.cs: Avoid adding bools to a hashtable.
6293
6294 2004-11-15  Martin Baulig  <martin@ximian.com>
6295
6296         * decl.cs (MemberName.GetPartialName): Removed, use GetTypeName() instead.
6297
6298 2004-11-11  Martin Baulig  <martin@ximian.com>
6299
6300         * typemanager.cs (TypeManager.GetMethodName): New method.
6301
6302         * class.cs (MethodData.Define): Include the generic arity in the
6303         name of an explicit interface; also add it to the method name.
6304
6305         * pending.cs (PendingImplementation.InterfaceMethod): The method
6306         name now includes the generic arity.
6307
6308 2004-11-07  Miguel de Icaza  <miguel@ximian.com>
6309
6310         * expression.cs (Invocation.OverloadResolve): Flag error if we are
6311         calling an unsafe method from a safe location.
6312
6313 2004-11-06  Marek Safar  <marek.safar@seznam.cz>
6314
6315         Fix #69167
6316         * codegen.cs (ApplyAttributeBuilder): Do not return; it is only warning.
6317
6318 2004-11-06  Miguel de Icaza  <miguel@ximian.com>
6319
6320         * namespace.cs (VerifyUsing): use GetPartialName instead of
6321         ToString. 
6322
6323 2004-11-05  Miguel de Icaza  <miguel@ximian.com>
6324
6325         * statement.cs (Return.Resolve): Fix regression in typo: if
6326         `in_exc', we have to request a NeedReturnLabel, this was a typo
6327         introduced in the anonymous method check-in.  Fixes #69131.
6328
6329         * Indexers were using the ShortName when defining themselves,
6330         causing a regression in the compiler bootstrap when applying the
6331         patch from 2004-11-02 (first part), now they use their full name
6332         and the bug is gone.
6333
6334 2004-11-04  Zoltan Varga  <vargaz@freemail.hu>
6335
6336         * driver.cs: Strip the path from the names of embedded resources. Fixes
6337         #68519.
6338
6339 2004-11-04  Raja R Harinath  <rharinath@novell.com>
6340
6341         Fix error message regression: cs0104-2.cs.
6342         * namespace.cs (NamespaceEntry.Lookup): Remove 'silent' flag.
6343         (AliasEntry.Resolve): Update.
6344         * rootcontext.cs (RootContext.NamespaceLookup): Update.  Remove
6345         'silent' flag.
6346         (RootContext.LookupType): Update.
6347
6348 2004-11-03  Carlos Alberto Cortez <carlos@unixmexico.org>
6349
6350         * cs-parser.jay: Add support for handling accessor modifiers
6351         * class: Add support port accessor modifiers and error checking,
6352         define PropertyMethod.Define as virtual (not abstract anymore)
6353         * ecore.cs: Add checking for proeprties access with access modifiers
6354         * iterators.cs: Modify Accessor constructor call based in the modified
6355         constructor
6356 2004-11-02  Ben Maurer  <bmaurer@ximian.com>
6357
6358         * expression.cs (StringConcat): Handle being called twice,
6359         as when we have a concat in a field init with more than two
6360         ctors in the class
6361
6362 2004-11-02  Miguel de Icaza  <miguel@ximian.com>
6363
6364         * class.cs (Event.Define, Indexer.Define, Property.Define): Do not
6365         special case explicit implementations, we should always produce
6366         the .property or .event declaration.
6367         
6368         * decl.cs (MemberName): Renamed GetFullName to GetPartialName
6369         since it will not return correct data if people use this
6370         unresolved in the presence of using statements (see test-313).
6371
6372         * class.cs (MethodData.Define): If we are an explicit interface
6373         implementation, set the method name to the full name of the
6374         interface plus the name of the method.  
6375
6376         Notice that using the method.MethodName.GetFullName() does not
6377         work, as it will only contain the name as declared on the source
6378         file (it can be a shorthand in the presence of using statements)
6379         and not the fully qualifed type name, for example:
6380
6381         using System;
6382
6383         class D : ICloneable {
6384                 object ICloneable.Clone ()  {
6385                 }
6386         }
6387
6388         Would produce a method called `ICloneable.Clone' instead of
6389         `System.ICloneable.Clone'.
6390
6391         * namespace.cs (Alias.Resolve): Use GetPartialName.
6392         
6393 2004-11-01  Marek Safar  <marek.safar@seznam.cz>
6394
6395         * cs-parser.jay: Add error 1055 report.
6396
6397 2004-11-01  Miguel de Icaza  <miguel@ximian.com>
6398
6399         * assign.cs (Assign.DoResolve): Only do the transform of
6400         assignment into a New if the types are compatible, if not, fall
6401         through and let the implicit code deal with the errors and with
6402         the necessary conversions. 
6403
6404 2004-11-01  Marek Safar  <marek.safar@seznam.cz>
6405
6406         * cs-parser.jay: Add error 1031 report.
6407
6408         * cs-tokenizer.cs: Add location for error 1038.
6409
6410 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
6411
6412         * cs-parser.jay: Add error 1016 report.
6413
6414 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
6415
6416         * cs-parser.jay: Add errors 1575,1611 report.
6417
6418 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
6419
6420         * cs-parser.jay: Add error 1001 report.
6421
6422 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
6423
6424         Fix #68850
6425         * attribute.cs (GetMarshal): Add method argument for
6426         caller identification.
6427
6428         * class.cs, codegen.cs, enum.cs, parameter.cs: Added
6429         agument for GetMarshal and RuntimeMissingSupport.
6430
6431 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
6432
6433         * attribute.cs (ExtractSecurityPermissionSet): Removed
6434         TypeManager.code_access_permission_type.
6435
6436         * typemanager.cs: Removed TypeManager.code_access_permission_type.
6437
6438 2004-10-27  Miguel de Icaza  <miguel@ximian.com>
6439
6440         * expression.cs (LocalVariableReference.DoResolveLValue): Check
6441         for obsolete use of a variable here.   Fixes regression on errors
6442         cs0619-25 and cs0619-26.
6443
6444 2004-10-27  Marek Safar  <marek.safar@seznam.cz>
6445
6446         Fix #62358, implemented security attribute encoding.
6447
6448         * attribute.cs (Attribute.CheckSecurityActionValididy): New method.
6449         Tests permitted SecurityAction for assembly or other types.
6450         (Assembly.ExtractSecurityPermissionSet): New method. Transforms
6451         data from SecurityPermissionAttribute to PermisionSet class.
6452
6453         * class.cs (ApplyAttributeBuilder): Added special handling
6454         for System.Security.Permissions.SecurityAttribute based types.
6455
6456         * codegen.cs (AssemblyClass.ApplyAttributeBuilder): Added
6457         special handling for System.Security.Permissions.SecurityAttribute
6458         based types.
6459
6460         * enum.cs (ApplyAttributeBuilder): Added special handling
6461         for System.Security.Permissions.SecurityAttribute based types.
6462
6463         * parameter.cs (ApplyAttributeBuilder): Added special handling
6464         for System.Security.Permissions.SecurityAttribute based types.
6465
6466         * rootcontext.cs: Next 2 core types.
6467
6468         * typemanager.cs (TypeManager.security_permission_attr_type):
6469         Built in type for the SecurityPermission Attribute.
6470         (code_access_permission_type): Build in type.
6471
6472 2004-10-17  Miguel de Icaza  <miguel@ximian.com>
6473
6474         * expression.cs (LocalVariableReference.DoResolveBase, Emit):
6475         Remove the tests for `ec.RemapToProxy' from here, and encapsulate
6476         all of this information into
6477         EmitContext.EmitCapturedVariableInstance.
6478         
6479         * codegen.cs (EmitCapturedVariableInstance): move here the
6480         funcionality of emitting an ldarg.0 in the presence of a
6481         remapping.   This centralizes the instance emit code.
6482
6483         (EmitContext.EmitThis): If the ScopeInfo contains a THIS field,
6484         then emit a load of this: it means that we have reached the
6485         topmost ScopeInfo: the one that contains the pointer to the
6486         instance of the class hosting the anonymous method.
6487
6488         * anonymous.cs (AddField, HaveCapturedFields): Propagate field
6489         captures to the topmost CaptureContext.
6490
6491 2004-10-12  Miguel de Icaza  <miguel@ximian.com>
6492
6493         * expression.cs (LocalVariableReference): Move the knowledge about
6494         the iterators into codegen's EmitCapturedVariableInstance.
6495
6496 2004-10-11  Miguel de Icaza  <miguel@ximian.com>
6497
6498         * codegen.cs (EmitContext.ResolveTopBlock): Emit a 1643 when not
6499         all code paths return a value from an anonymous method (it is the
6500         same as the 161 error, but for anonymous methods).
6501
6502 2004-10-08  Miguel de Icaza  <miguel@ximian.com>
6503
6504         The introduction of anonymous methods in the compiler changed
6505         various ways of doing things in the compiler.  The most
6506         significant one is the hard split between the resolution phase
6507         and the emission phases of the compiler.
6508
6509         For instance, routines that referenced local variables no
6510         longer can safely create temporary variables during the
6511         resolution phase: they must do so from the emission phase,
6512         since the variable might have been "captured", hence access to
6513         it can not be done with the local-variable operations from the runtime.
6514         
6515         * statement.cs 
6516
6517         (Block.Flags): New flag `IsTopLevel' to indicate that this block
6518         is a toplevel block.
6519
6520         (ToplevelBlock): A new kind of Block, these are the blocks that
6521         are created by the parser for all toplevel method bodies.  These
6522         include methods, accessors and anonymous methods.
6523
6524         These contain some extra information not found in regular blocks:
6525         A pointer to an optional CaptureContext (for tracking captured
6526         local variables and parameters).  A pointer to the parent
6527         ToplevelBlock.
6528         
6529         (Return.Resolve): Catch missmatches when returning a value from an
6530         anonymous method (error 1662).
6531         Invoke NeedReturnLabel from the Resolve phase instead of the emit
6532         phase.
6533
6534         (Break.Resolve): ditto.
6535
6536         (SwitchLabel): instead of defining the labels during the
6537         resolution phase, we now turned the public ILLabel and ILLabelCode
6538         labels into methods called GetILLabelCode() and GetILLabel() that
6539         only define the label during the Emit phase.
6540
6541         (GotoCase): Track the SwitchLabel instead of the computed label
6542         (its contained therein).  Emit the code by using
6543         SwitchLabel.GetILLabelCode ().
6544
6545         (LocalInfo.Flags.Captured): A new flag has been introduce to track
6546         whether the Local has been captured or not.
6547
6548         (LocalInfo.IsCaptured): New property, used to tell whether the
6549         local has been captured.
6550         
6551         * anonymous.cs: Vastly updated to contain the anonymous method
6552         support.
6553
6554         The main classes here are: CaptureContext which tracks any
6555         captured information for a toplevel block and ScopeInfo used to
6556         track the activation frames for various local variables.   
6557
6558         Each toplevel block has an optional capture context associated
6559         with it.  When a method contains an anonymous method both the
6560         toplevel method and the anonymous method will create a capture
6561         context.   When variables or parameters are captured, they are
6562         recorded on the CaptureContext that owns them, for example:
6563
6564         void Demo () {
6565              int a;
6566              MyDelegate d = delegate {
6567                  a = 1;
6568              }
6569         }
6570
6571         Here `a' will be recorded as captured on the toplevel
6572         CapturedContext, the inner captured context will not have anything
6573         (it will only have data if local variables or parameters from it
6574         are captured in a nested anonymous method.
6575
6576         The ScopeInfo is used to track the activation frames for local
6577         variables, for example:
6578
6579         for (int i = 0; i < 10; i++)
6580                 for (int j = 0; j < 10; j++){
6581                    MyDelegate d = delegate {
6582                         call (i, j);
6583                    }
6584                 }
6585
6586         At runtime this captures a single captured variable `i', but it
6587         captures 10 different versions of the variable `j'.  The variable
6588         `i' will be recorded on the toplevel ScopeInfo, while `j' will be
6589         recorded on a child.  
6590
6591         The toplevel ScopeInfo will also track information like the `this'
6592         pointer if instance variables were referenced (this is necessary
6593         as the anonymous method lives inside a nested class in the host
6594         type of the method). 
6595
6596         (AnonymousMethod): Expanded to track the Toplevel, implement
6597         `AnonymousMethod.Compatible' to tell whether an anonymous method
6598         can be converted to a target delegate type. 
6599
6600         The routine now also produces the anonymous method content
6601
6602         (AnonymousDelegate): A helper class that derives from
6603         DelegateCreation, this is used to generate the code necessary to
6604         produce the delegate for the anonymous method that was created. 
6605
6606         * assign.cs: API adjustments for new changes in
6607         Convert.ImplicitStandardConversionExists.
6608
6609         * class.cs: Adjustments to cope with the fact that now toplevel
6610         blocks are of type `ToplevelBlock'. 
6611
6612         * cs-parser.jay: Now we produce ToplevelBlocks for toplevel blocks
6613         insteda of standard blocks.
6614
6615         Flag errors if params arguments are passed to anonymous methods.
6616
6617         * codegen.cs (EmitContext): Replace `InAnonymousMethod' with
6618         `CurrentAnonymousMethod' which points to the current Anonymous
6619         Method.  The variable points to the AnonymousMethod class that
6620         holds the code being compiled.  It is set in the new EmitContext
6621         created for the anonymous method.
6622
6623         (EmitContext.Phase): Introduce a variable and an enumeration to
6624         assist in enforcing some rules about when and where we are allowed
6625         to invoke certain methods (EmitContext.NeedsReturnLabel is the
6626         only one that enfonces this right now).
6627
6628         (EmitContext.HaveCaptureInfo): new helper method that returns
6629         whether we have a CapturedContext initialized.
6630
6631         (EmitContext.CaptureVariable): New method used to register that a
6632         LocalInfo must be flagged for capturing. 
6633
6634         (EmitContext.CapturedParameter): New method used to register that a
6635         parameters must be flagged for capturing. 
6636         
6637         (EmitContext.CapturedField): New method used to register that a
6638         field must be flagged for capturing. 
6639
6640         (EmitContext.HaveCapturedVariables,
6641         EmitContext.HaveCapturedFields): Return whether there are captured
6642         variables or fields. 
6643
6644         (EmitContext.EmitMethodHostInstance): This is used to emit the
6645         instance for the anonymous method.  The instance might be null
6646         (static methods), this (for anonymous methods that capture nothing
6647         and happen to live side-by-side with the current method body) or a
6648         more complicated expression if the method has a CaptureContext.
6649
6650         (EmitContext.EmitTopBlock): Routine that drives the emission of
6651         code: it will first resolve the top block, then emit any metadata
6652         and then emit the code.  The split is done so that we can extract
6653         any anonymous methods and flag any captured variables/parameters.
6654         
6655         (EmitContext.ResolveTopBlock): Triggers the resolution phase,
6656         during this phase, the ILGenerator should not be used as labels
6657         and local variables declared here might not be accessible to any
6658         code that is part of an anonymous method.  
6659
6660         Exceptions to this include the temporary variables that are
6661         created by some statements internally for holding temporary
6662         variables. 
6663         
6664         (EmitContext.EmitMeta): New routine, in charge of emitting all the
6665         metadata for a cb
6666
6667         (EmitContext.TemporaryReturn): This method is typically called
6668         from the Emit phase, and its the only place where we allow the
6669         ReturnLabel to be defined other than the EmitMeta.  The reason is
6670         that otherwise we would have to duplicate a lot of logic in the
6671         Resolve phases of various methods that today is on the Emit
6672         phase. 
6673
6674         (EmitContext.NeedReturnLabel): This no longer creates the label,
6675         as the ILGenerator is not valid during the resolve phase.
6676
6677         (EmitContext.EmitThis): Extended the knowledge in this class to
6678         work in anonymous methods in addition to iterators. 
6679
6680         (EmitContext.EmitCapturedVariableInstance): This emits whatever
6681         code is necessary on the stack to access the instance to a local
6682         variable (the variable will be accessed as a field).
6683
6684         (EmitContext.EmitParameter, EmitContext.EmitAssignParameter,
6685         EmitContext.EmitAddressOfParameter): Routines to support
6686         parameters (not completed at this point). 
6687         
6688         Removals: Removed RemapLocal and RemapLocalLValue.  We probably
6689         will also remove the parameters.
6690
6691         * convert.cs (Convert): Define a `ConstantEC' which points to a
6692         null.  This is just to prefity some code that uses
6693         ImplicitStandardConversion code and do not have an EmitContext
6694         handy.
6695
6696         The idea is to flag explicitly that at that point in time, it is
6697         known that the conversion will not trigger the delegate checking
6698         code in implicit conversions (which requires a valid
6699         EmitContext). 
6700
6701         Everywhere: pass new EmitContext parameter since
6702         ImplicitStandardConversionExists now requires it to check for
6703         anonymous method conversions. 
6704
6705         (Convert.ImplicitStandardConversionExists): If the type of an
6706         expression is the anonymous_method_type, and the type is a
6707         delegate, we invoke the AnonymousMethod.Compatible method to check
6708         whether an implicit conversion is possible. 
6709
6710         (Convert.ImplicitConversionStandard): Only do implicit method
6711         group conversions if the language level is not ISO_1.
6712
6713         * delegate.cs (Delegate.GetInvokeMethod): Common method to get the
6714         MethodInfo for the Invoke method.  used by Delegate and
6715         AnonymousDelegate.
6716
6717         * expression.cs (Binary.DoNumericPromotions): only allow anonymous
6718         method conversions if the target type is a delegate.
6719
6720         Removed extra debugging nops.
6721
6722         (LocalVariableReference): Turn the `local_info' into a public
6723         field. 
6724
6725         Add `prepared' field, the same hack used for FieldExprs to cope
6726         with composed assignments, as Local variables do not necessarily
6727         operate purely on the stack as they used to: they can be captured
6728         fields. 
6729
6730         Add `temp' for a temporary result, like fields.
6731
6732         Refactor DoResolve and DoResolveLValue into DoResolveBase.
6733
6734         It now copes with Local variables that are captured and emits the
6735         proper instance variable to load it from a field in the captured
6736         case. 
6737
6738         (ParameterReference.DoResolveBase): During the resolve phase,
6739         capture parameters if we are in an anonymous method.
6740
6741         (ParameterReference.Emit, ParameterReference.AddressOf): If in an
6742         anonymous method, use the EmitContext helper routines to emit the
6743         parameter reference.
6744
6745         * iterators.cs: Set RemapToProxy to true/false during the
6746         EmitDispose class.
6747
6748         * parameters.cs (GetParameterByName): New helper method. 
6749
6750         * typemanager.cs (anonymous_method_type) a new type that
6751         represents an anonyous method.  This is always an internal type,
6752         used as a fencepost to test against the anonymous-methodness of an
6753         expression. 
6754         
6755 2004-10-20  Marek Safar  <marek.safar@seznam.cz>
6756
6757         * class.cs (MethodCore.CheckBase): Add errors 505, 533, 544,
6758         561 report.
6759         (PropertyBase.FindOutParentMethod): Add errors 545, 546 report.
6760
6761 2004-11-10  Martin Baulig  <martin@ximian.com>
6762
6763         * expression.cs (Invocation.BetterFunction): If two methods have
6764         equal parameter types, but only one of them is generic, the
6765         non-generic one wins.
6766         (New.DoResolve): Don't set `is_struct' to false if we're a generic
6767         instance; just use `Type.IsValueType' to determine whether
6768         something is a struct or not.
6769         (MemberAccess.DoResolveAsTypeStep): Don't modify the `args' field,
6770         so we can be called multiple times.
6771
6772 2004-11-10  Martin Baulig  <martin@ximian.com>
6773
6774         * generic.cs (TypeParameter.DefineConstraints): New public method.
6775         (TypeParameter.CheckAccessLevel): Override this and return true.
6776         (ConstructedType.ResolveType): Renamed to DoResolveType(), don't
6777         override ResolveType() anymore.
6778         (ConstructedType.DoResolveAsTypeStep): Call DoResolveType() here.
6779
6780 2004-11-10  Martin Baulig  <martin@ximian.com>
6781
6782         * rootcontext.cs (RootContext.LookupType): If we're a nested type,
6783         call DeclSpace.ResolveNestedType() on it.
6784
6785 2004-11-10  Martin Baulig  <martin@ximian.com>
6786
6787         * support.cs (ReflectionParameters.ParameterModifier): If `gpd' is
6788         non-null, call ParameterModifier() on it.
6789
6790 2004-11-10  Martin Baulig  <martin@ximian.com>
6791
6792         * iterators.cs
6793         (Iterators): Added `current_type' and `this_type' fields.
6794         (Iterators.DefineIterator): Create a new EmitContext and store it
6795         in `ec'; compute `this_type'.
6796
6797 2004-11-10  Martin Baulig  <martin@ximian.com>
6798
6799         * typemanager.cs
6800         (TypeManager.IsPrivateAccessible): New public method.
6801         (Closure.Filter): Use IsPrivateAccessible() instead of IsEqual().
6802
6803 2004-11-10  Martin Baulig  <martin@ximian.com>
6804
6805         * class.cs (TypeContainer.DefineType): Call
6806         TypeBuilder.DefineGenericParameters() before resolving the type
6807         parameters.
6808         (MethodData.parent_method): New protected field.
6809         (MethodData..ctor): Added `MethodInfo parent_method' argument.
6810         (MethodData.Define): Compute `parent_method'.
6811
6812         * decl.cs
6813         (MemberCore.GetObsoleteAttribute): Don't create a new EmitContext.
6814         (MemberCore.GetClsCompliantAttributeValue): Likewise.
6815         (DeclSpace.ec): New protected field; store the EmitContext here.
6816         (DeclSpace.EmitContext): New public property.
6817         (DeclSpace.ResolveType): Un-comment from the [Obsolte] attribute.
6818         (DeclSpace.ResolveNestedType): New public method.
6819         (DeclSpace.ResolveTypeExpr): Just call ResolveAsTypeTerminal() here.
6820         (DeclSpace.NestedAccessible): Added `Type tb' argument.
6821         (DeclSpace.FamilyAccessible): Likewise.
6822         (DeclSpace.FindType): Call ResolveNestedType() for nested types.
6823         (DeclSpace.GetClsCompliantAttributeValue): Don't create a new
6824         EmitContext.
6825
6826         * delegate.cs (Delegate.Define): Store the EmitContext in the `ec'
6827         field.
6828
6829         * enum.cs (Enum.Define): Store the EmitContext in the `ec' field.
6830         (Enum.Emit): Don't create a new EmitContext.
6831
6832 2004-10-18  Martin Baulig  <martin@ximian.com>
6833
6834         * statement.cs (Fixed.Resolve): Don't access the TypeExpr's
6835         `Type' directly, but call ResolveType() on it.
6836         (Catch.Resolve): Likewise.
6837         (Foreach.Resolve): Likewise.
6838
6839 2004-10-18  Martin Baulig  <martin@ximian.com>
6840
6841         * expression.cs (Cast.DoResolve): Don't access the TypeExpr's
6842         `Type' directly, but call ResolveType() on it.
6843         (Probe.DoResolve): Likewise.
6844         (ArrayCreation.LookupType): Likewise.
6845         (TypeOf.DoResolve): Likewise.
6846         (SizeOf.DoResolve): Likewise.
6847
6848 2004-10-18  Raja R Harinath  <rharinath@novell.com>
6849
6850         * class.cs (FieldMember.DoDefine): Reset ec.InUnsafe after doing
6851         the ResolveType.
6852
6853 2004-10-17  John Luke  <john.luke@gmail.com>
6854
6855         * class.cs (Operator.GetSignatureForError): use CSharpName
6856
6857         * parameter.cs (Parameter.GetSignatureForError): Returns
6858         correct name even if was not defined.
6859
6860 2004-10-13  Raja R Harinath  <rharinath@novell.com>
6861
6862         Fix #65816.
6863         * class.cs (TypeContainer.EmitContext): New property.
6864         (DefineNestedTypes): Create an emitcontext for each part.
6865         (MethodCore.DoDefineParameters): Use container's emitcontext.
6866         Pass type array to InternalParameters.
6867         (MemberBase.DoDefine): Use container's emitcontext.
6868         (FieldMember.Define): Likewise.
6869         (Event.Define): Likewise.
6870         (SetMethod.GetParameterInfo): Change argument to EmitContext.
6871         Pass type array to InternalParameters.
6872         (SetIndexerMethod.GetParameterInfo): Likewise.
6873         (SetMethod.Define): Pass emitcontext to GetParameterInfo.
6874         * delegate.cs (Define): Pass emitcontext to
6875         ComputeAndDefineParameterTypes and GetParameterInfo.  Pass type
6876         array to InternalParameters.
6877         * expression.cs (ParameterReference.DoResolveBase): Pass
6878         emitcontext to GetParameterInfo.
6879         (ComposedCast.DoResolveAsTypeStep): Remove check on
6880         ec.ResolvingTypeTree.
6881         * parameter.cs (Parameter.Resolve): Change argument to
6882         EmitContext.  Use ResolveAsTypeTerminal.
6883         (Parameter.GetSignature): Change argument to EmitContext.
6884         (Parameters.ComputeSignature): Likewise.
6885         (Parameters.ComputeParameterTypes): Likewise.
6886         (Parameters.GetParameterInfo): Likewise.
6887         (Parameters.ComputeAndDefineParameterTypes): Likewise.
6888         Re-use ComputeParameterTypes.  Set ec.ResolvingTypeTree.
6889         * support.cs (InternalParameters..ctor): Remove variant that takes
6890         a DeclSpace.
6891         * typemanager.cs (system_intptr_expr): New.
6892         (InitExpressionTypes): Initialize it.
6893
6894 2004-10-12  Chris Toshok  <toshok@ximian.com>
6895
6896         * cs-parser.jay: fix location for try_statement and catch_clause.
6897
6898 2004-10-18  Martin Baulig  <martin@ximian.com>
6899
6900         * class.cs (FieldMember.Define): Don't access the TypeExpr's
6901         `Type' directly, but call ResolveType() on it.
6902         (MemberBase.DoDefine): Likewise.
6903
6904         * expression.cs (New.DoResolve): Don't access the TypeExpr's
6905         `Type' directly, but call ResolveType() on it.
6906         (ComposedCast.DoResolveAsTypeStep): Likewise.
6907
6908         * statement.cs (LocalInfo.Resolve): Don't access the TypeExpr's
6909         `Type' directly, but call ResolveType() on it.
6910
6911 2004-10-17  John Luke  <john.luke@gmail.com>
6912
6913         * class.cs (Operator.GetSignatureForError): use CSharpName
6914
6915         * parameter.cs (Parameter.GetSignatureForError): Returns
6916         correct name even if was not defined.
6917
6918 2004-10-13  Raja R Harinath  <rharinath@novell.com>
6919
6920         Fix #65816.
6921         * class.cs (TypeContainer.EmitContext): New property.
6922         (DefineNestedTypes): Create an emitcontext for each part.
6923         (MethodCore.DoDefineParameters): Use container's emitcontext.
6924         Pass type array to InternalParameters.
6925         (MemberBase.DoDefine): Use container's emitcontext.
6926         (FieldMember.Define): Likewise.
6927         (Event.Define): Likewise.
6928         (SetMethod.GetParameterInfo): Change argument to EmitContext.
6929         Pass type array to InternalParameters.
6930         (SetIndexerMethod.GetParameterInfo): Likewise.
6931         (SetMethod.Define): Pass emitcontext to GetParameterInfo.
6932         * delegate.cs (Define): Pass emitcontext to
6933         ComputeAndDefineParameterTypes and GetParameterInfo.  Pass type
6934         array to InternalParameters.
6935         * expression.cs (ParameterReference.DoResolveBase): Pass
6936         emitcontext to GetParameterInfo.
6937         (ComposedCast.DoResolveAsTypeStep): Remove check on
6938         ec.ResolvingTypeTree.
6939         * parameter.cs (Parameter.Resolve): Change argument to
6940         EmitContext.  Use ResolveAsTypeTerminal.
6941         (Parameter.GetSignature): Change argument to EmitContext.
6942         (Parameters.ComputeSignature): Likewise.
6943         (Parameters.ComputeParameterTypes): Likewise.
6944         (Parameters.GetParameterInfo): Likewise.
6945         (Parameters.ComputeAndDefineParameterTypes): Likewise.
6946         Re-use ComputeParameterTypes.  Set ec.ResolvingTypeTree.
6947         * support.cs (InternalParameters..ctor): Remove variant that takes
6948         a DeclSpace.
6949         * typemanager.cs (system_intptr_expr): New.
6950         (InitExpressionTypes): Initialize it.
6951
6952 2004-10-12  Chris Toshok  <toshok@ximian.com>
6953
6954         * cs-parser.jay: fix location for try_statement and catch_clause.
6955
6956 2004-10-07  Raja R Harinath  <rharinath@novell.com>
6957
6958         More DeclSpace.ResolveType avoidance.
6959         * decl.cs (MemberCore.InUnsafe): New property.
6960         * class.cs (MemberBase.DoDefine): Use ResolveAsTypeTerminal 
6961         with newly created EmitContext.
6962         (FieldMember.Define): Likewise.
6963         * delegate.cs (Delegate.Define): Likewise.
6964         * ecore.cs (SimpleName.ResolveAsTypeStep): Lookup with alias
6965         only if normal name-lookup fails.
6966         (TypeExpr.DoResolve): Enable error-checking.
6967         * expression.cs (ArrayCreation.DoResolve): Use ResolveAsTypeTerminal.
6968         (SizeOf.DoResolve): Likewise.
6969         (ComposedCast.DoResolveAsTypeStep): Likewise.
6970         (StackAlloc.DoResolve): Likewise.
6971         * statement.cs (Block.Flags): Add new flag 'Unsafe'.
6972         (Block.Unsafe): New property.
6973         (Block.EmitMeta): Set ec.InUnsafe as appropriate.
6974         (Unsafe): Set 'unsafe' flag of contained block.
6975         (LocalInfo.Resolve): Use ResolveAsTypeTerminal.
6976         (Fixed.Resolve): Likewise.
6977         (Catch.Resolve): Likewise.
6978         (Using.ResolveLocalVariableDecls): Likewise.
6979         (Foreach.Resolve): Likewise.
6980
6981 2004-10-05  John Luke <john.luke@gmail.com>
6982
6983         * cs-parser.jay: add location to error CS0175
6984
6985 2004-10-04  Miguel de Icaza  <miguel@ximian.com>
6986
6987         * ecore.cs (Expression.Constantity): Add support for turning null
6988         into a constant.
6989
6990         * const.cs (Const.Define): Allow constants to be reference types
6991         as long as the value is Null.
6992
6993 2004-10-04  Juraj Skripsky  <js@hotfeet.ch>
6994
6995         * namespace.cs (NamespaceEntry.Using): No matter which warning
6996         level is set, check if this namespace name has already been added.
6997
6998 2004-10-03 Ben Maurer  <bmaurer@ximian.com>
6999
7000         * expression.cs: reftype [!=]= null should always use br[true,false].
7001         # 67410
7002
7003 2004-10-03  Marek Safar  <marek.safar@seznam.cz>
7004
7005         Fix #67108
7006         * attribute.cs: Enum conversion moved to 
7007         GetAttributeArgumentExpression to be applied to the all
7008         expressions.
7009
7010 2004-10-01  Raja R Harinath  <rharinath@novell.com>
7011
7012         Fix #65833, test-300.cs, cs0122-5.cs, cs0122-6.cs.
7013         * class.c (TypeContainer.DefineType): Flag error if
7014         base types aren't accessible due to access permissions.
7015         * decl.cs (DeclSpace.ResolveType): Move logic to
7016         Expression.ResolveAsTypeTerminal.
7017         (DeclSpace.ResolveTypeExpr): Thin layer over
7018         Expression.ResolveAsTypeTerminal.
7019         (DeclSpace.CheckAccessLevel, DeclSpace.FamilyAccess):
7020         Refactor code into NestedAccess.  Use it.
7021         (DeclSpace.NestedAccess): New.
7022         * ecore.cs (Expression.ResolveAsTypeTerminal): Add new
7023         argument to silence errors.  Check access permissions.
7024         (TypeExpr.DoResolve, TypeExpr.ResolveType): Update.
7025         * expression.cs (ProbeExpr.DoResolve): Use ResolveAsTypeTerminal.
7026         (Cast.DoResolve): Likewise.
7027         (New.DoResolve): Likewise.
7028         (InvocationOrCast.DoResolve,ResolveStatement): Likewise.
7029         (TypeOf.DoResolve): Likewise.
7030
7031         * expression.cs (Invocation.BetterConversion): Return the Type of
7032         the better conversion.  Implement section 14.4.2.3 more faithfully.
7033         (Invocation.BetterFunction): Make boolean.  Make correspondence to
7034         section 14.4.2.2 explicit.
7035         (Invocation.OverloadResolve): Update.
7036         (Invocation): Remove is_base field.
7037         (Invocation.DoResolve): Don't use is_base.  Use mg.IsBase.
7038         (Invocation.Emit): Likewise.
7039
7040 2004-09-24  Marek Safar  <marek.safar@seznam.cz>
7041
7042         * cs-parser.jay: Reverted 642 warning fix.
7043
7044 2004-09-23  Marek Safar  <marek.safar@seznam.cz>
7045
7046         Fix bug #66615
7047         * decl.cs (FindMemberWithSameName): Indexer can have more than
7048         1 argument.
7049
7050 2004-09-23  Marek Safar  <marek.safar@seznam.cz>
7051
7052         * expression.cs (LocalVariableReference.DoResolveLValue):
7053         Do not report warning 219 for out values.
7054         (EmptyExpression.Null): New member to avoid extra allocations.
7055
7056 2004-09-23  Marek Safar  <marek.safar@seznam.cz>
7057
7058         * cs-parser.jay: Fix wrong warning 642 report.
7059
7060         * cs-tokenizer.cs (CheckNextToken): New helper;
7061         Inspect next character if is same as expected.
7062
7063 2004-09-23  Martin Baulig  <martin@ximian.com>
7064
7065         * convert.cs (Convert.ImplicitReferenceConversion): Some code cleanup.
7066         (Convert.ImplicitReferenceConversionExists): Likewise.
7067
7068 2004-11-09  Raja R Harinath  <rharinath@novell.com>
7069
7070         * Makefile (DISTFILES): Comment out a few missing files.
7071
7072 2004-10-29  Raja R Harinath  <rharinath@novell.com>
7073
7074         * Makefile (bootstrap_libs,bootstrap_libfiles): New.
7075         (bootstrap-libs): New target.  Invokes the net_2_0_bootstrap profile.
7076         (gmcs.exe): Invoke bootstrap-libs.
7077         (clean-local): Clean the net_2_0_bootstrap profile too.
7078         (PROGRAM_INSTALL_DIR): New.
7079         (install-local): Use it.
7080
7081 2004-10-13  Martin Baulig  <martin@ximian.com>
7082
7083         * generic.cs (TypeManager.InflatedConstraints): New nested class.
7084         (TypeParameter.DefineType): If we're a method type parameter and
7085         that method is overriding something, "inflate" its constraints.
7086
7087 2004-10-12  Martin Baulig  <martin@ximian.com>
7088
7089         * expression.cs (MemberAccess.DoResolve): If we're a SimpleName
7090         and have type arguments, create and resolve a ConstructedType.
7091
7092 2004-10-12  Martin Baulig  <martin@ximian.com>
7093
7094         * decl.cs (MemberCache.FindMemberToOverride): Use
7095         TypeManager.IsEqual() to compare the parameters and Type.Equals()
7096         to compare the invocationType.
7097
7098         * typemanager.cs (TypeManager.IsEqual): Added support for arrays.
7099         When comparing two type parameters, only do the signature-only
7100         comparision for method type parameters.
7101
7102 2004-10-11  Martin Baulig  <martin@ximian.com>
7103
7104         * report.cs: Don't make --fatal abort on warnings, we have
7105         -warnaserror for that.
7106
7107 2004-10-11  Martin Baulig  <martin@ximian.com>
7108
7109         * typemanager.cs
7110         (TypeManager.IsEqualGenericType): Removed, use IsEqual() instead.
7111         (TypeManager.IsEqual): Call ourself recursively instead of using
7112         Type.IsEqual(). 
7113
7114 2004-10-11  Martin Baulig  <martin@ximian.com>
7115
7116         * class.cs (TypeContainer.DefineType): Only call TypeParameter.Define()
7117         on our own type parameters, not on the ones we inherit from a containing
7118         class.
7119
7120         * expression.cs (Invocation.InferType): Use `==', not `Equals()' for
7121         the comparision.
7122
7123         * generic.cs (TypeParameter.Define): We may only be called once.
7124
7125         * pending.cs (Pending.InterfaceMethod): Call TypeManager.Real_IsEqual()
7126         instead of TypeManager.IsEqual().
7127
7128 2004-09-28  Martin Baulig  <martin@ximian.com>
7129
7130         * generic.cs
7131         (GenericConstraints.EffectiveBaseClass): New public property.
7132         (TypeParameter.GenericConstraints): New public property.
7133         (ConstructedType.CheckConstraints): Improved.
7134
7135         * convert.cs (Convert.TypeParam_EffectiveBaseType): New private method.
7136         (Convert.TypeParameterConversion): New private method; use this in
7137         ImplicitReferenceConversion() and ImplicitReferenceConversionExists()
7138         for all conversions related to type parameters.
7139
7140 2004-09-24  Martin Baulig  <martin@ximian.com>
7141
7142         * convert.cs (Convert.ImplicitReferenceConversion): Added implicit
7143         type parameter conversions for type parameters which are known to
7144         be reference types.
7145
7146 2004-09-24  Martin Baulig  <martin@ximian.com>
7147
7148         * generic.cs (GenericConstraints): Added `IsReferenceType' and
7149         `IsValueType' properties.
7150
7151         * support.cs (ReflectionConstraints): Use
7152         Type.GetGenericParameterConstraints() instead of the old hack.
7153
7154 2004-09-24  Martin Baulig  <martin@ximian.com>
7155
7156         * generic.cs (GenericConstraints): Moved here and made it an
7157         abstract class.
7158
7159         * support.cs (GenericConstraints): Moved to generic.cs.
7160
7161 2004-09-24  Martin Baulig  <martin@ximian.com>
7162
7163         * support.cs
7164         (ReflectionConstraints): Un-nested this class and made it public.
7165
7166         * typemanager.cs
7167         (TypeManager.GetTypeParameterConstraints): New public method.
7168         (TypeManager.HasConstructorConstraint): Use the attributes.
7169
7170 2004-09-24  Martin Baulig  <martin@ximian.com>
7171
7172         * support.cs (GenericConstraints): Replaced `HasConstructor',
7173         `IsReferenceType' and `IsValueType' with `Attributes'.
7174         (ReflectionParameters.ReflectionConstraints): Removed the Create()
7175         method and made the .ctor public.
7176
7177         * generic.cs (Constraints.Attributes): New public property.
7178         (Constraints): Renamed `HasConstructor' -> `HasConstructorConstraint',
7179         `IsReferenceType' -> `HasReferenceTypeConstraint' and
7180         `IsValueType' -> `HasValueTypeConstraint'.
7181
7182 2004-09-23  Martin Baulig  <martin@ximian.com>
7183
7184         * generic.cs (Constraints): Reflect latest runtime changes.
7185
7186 2004-09-23  Martin Baulig  <martin@ximian.com>
7187
7188         * convert.cs (Convert.ImplicitReferenceConversion): Some code cleanup.
7189         (Convert.ImplicitReferenceConversionExists): Likewise.
7190
7191 2004-09-23  Marek Safar  <marek.safar@seznam.cz>
7192
7193         * class.cs (Operator.Define): Add error 448 and 559 report.
7194         
7195 2004-09-22  Marek Safar  <marek.safar@seznam.cz>
7196
7197         * class.cs (MemberBase.IsTypePermitted): New protected
7198         method for checking error CS0610.
7199
7200 2004-09-22  Marek Safar  <marek.safar@seznam.cz>
7201
7202         * class.cs (TypeContainer.HasExplicitLayout): New property
7203         Returns whether container has StructLayout attribute set Explicit.
7204         (FieldMember): New abstract class for consts and fields.
7205         (FieldMember.ApplyAttributeBuilder): Add error 636 and 637 report.
7206         (Field): Reuse FieldMember.
7207
7208         * const.cs (Const): Reuse FieldMember.
7209
7210         * rootcontext.cs: EmitConstants call moved to class.
7211
7212 2004-09-22  Martin Baulig  <martin@ximian.com>
7213
7214         Marek and me just fixed one of our oldest bugs: #28562 :-)
7215
7216         * ecore.cs (EnumConstant.GetValueAsEnumType): New public method.
7217
7218         * attribute.cs (Attribute.GetAttributeArgumentExpression): If
7219         we're an EnumConstant, just return that.
7220         (Attribute.Resolve): GetAttributeArgumentExpression() may give us
7221         an EnumConstant.  In this case, we need to use GetValueAsEnumType()
7222         to get the value which'll actually be written into the attribute.
7223         However, we have to use GetValue() to access the attribute's value
7224         in the compiler.        
7225
7226 2004-09-22  Marek Safar  <marek.safar@seznam.cz>
7227
7228         * constant.cs (Constant.IsNegative): New abstract property
7229         IsNegative.
7230
7231         * expression.cs (ArrayAccess.DoResolve): Add warning 251.
7232         (StackAlloc.DoResolve): Reused IsNegative.
7233
7234 2004-09-22  Martin Baulig  <martin@ximian.com>
7235
7236         * typemanager.cs (TypeManager.LookupGenericTypeContainer): New
7237         public method; like LookupTypeContainer, but also works for
7238         generic instances.
7239
7240         * report.cs (Report.SymbolRelatedToPreviousError): Use
7241         TypeManager.LookupGenericTypeContainer().       
7242
7243 2004-09-22  Martin Baulig  <martin@ximian.com>
7244
7245         Thanks to Peter Sestoft for this bug report.
7246
7247         * expression.cs (Conditional): If both the `trueExpr' and the
7248         `falseExpr' is a NullLiteral, return a NullLiteral.
7249
7250 2004-09-22  Martin Baulig  <martin@ximian.com>
7251
7252         * statement.cs (Foreach.EmitCollectionForeach): If we're in an
7253         iterator, use `enumerator.EmitThis()' instead of `ec.EmitThis()'
7254         for the "get_Current" call.
7255
7256 2004-09-21  Martin Baulig  <martin@ximian.com>
7257
7258         * convert.cs (Convert.ImplicitReferenceConversion): When
7259         converting to an interface type, first check whether we're
7260         converting from a reference type.
7261
7262 2004-09-14  Martin Baulig  <martin@ximian.com>
7263
7264         * decl.cs (MemberCore.Emit): Always call VerifyObsoleteAttribute().
7265
7266 2004-09-14  Marek Safar  <marek.safar@seznam.cz>
7267
7268         Fixed bug #61902
7269         * codegen.cs (TestObsoleteMethodUsage): Trace when method is
7270         called and is obsolete then this member suppress message
7271         when call is inside next [Obsolete] method or type.
7272
7273         * expression.cs: Use TestObsoleteMethodUsage member.
7274
7275 2004-09-14  Martin Baulig  <martin@ximian.com>
7276
7277         * genericparser.cs: Removed.
7278
7279 2004-09-13  Marek Safar  <marek.safar@seznam.cz>
7280
7281         * class.cs (MethodCore.CheckBase): Fix bug #65757.
7282
7283 2004-09-12  Marek Safar  <marek.safar@seznam.cz>
7284
7285         * attribute.cs (Attribute.Resolve): Add error 653 report.
7286
7287         * class.cs (Class.ApplyAttributeBuilder): Add error 641
7288         report.
7289         (Method.ApplyAttributeBuilder): Add error 685 report.
7290         (Operator.Define): Add error 564 report.
7291
7292         * cs-tokenizer.cs (handle_hex): Add error 1013 report.
7293
7294         * expression.cs (Invocation.DoResolve): Add error
7295         245 and 250 report.
7296
7297         * parameter.cs (Parameter.ApplyAttributeBuilder): Add
7298         error 674 report.
7299
7300 2004-09-11  Marek Safar  <marek.safar@seznam.cz>
7301
7302         * class.cs (ConstructorInitializer.Resolve):
7303         Wrong error number (515->516).
7304
7305 2004-09-11  Marek Safar  <marek.safar@seznam.cz>
7306
7307         * class.cs (Indexer.Define): Add error 631 report.
7308
7309 2004-09-11  Marek Safar  <marek.safar@seznam.cz>
7310
7311         * ecore.cs (Error_NegativeArrayIndex): Fix 248 error.
7312
7313 2004-09-11  Marek Safar  <marek.safar@seznam.cz>
7314
7315         * expression.cs (Probe.DoResolve): Add error CS0241 report.
7316
7317 2004-09-10  Marek Safar  <marek.safar@seznam.cz>
7318
7319         * cs-parser.jay: Added error CS0241 report.
7320
7321 2004-09-10  Raja R Harinath  <rharinath@novell.com>
7322
7323         * cs-parser.jay (fixed_statement): Introduce a scope for the
7324         declaration in the 'fixed' statement.
7325
7326 2004-09-09  Marek Safar  <marek.safar@seznam.cz>
7327
7328         * cs-parser.jay: Added CS0230 error report.
7329
7330 2004-09-09  Marek Safar  <marek.safar@seznam.cz>
7331
7332         * cs-parser.jay: Added errors CS0231 and CS0257 report.
7333
7334 2004-09-09  Marek Safar  <marek.safar@seznam.cz>
7335
7336         * expression.cs (Argument.Resolve): Added error CS0192 and
7337         CS0199 report.
7338
7339 2004-09-09  Marek Safar  <marek.safar@seznam.cz>
7340
7341         C# 2.0 #pragma warning feature
7342
7343         * cs-tokenizer.cs (PreProcessPragma): New method; 
7344         Handles #pragma directive.
7345
7346         * report.cs (WarningRegions): New class; Support
7347         class for #pragma warning directive. It tests whether
7348         warning is enabled for a given line.
7349
7350 2004-09-08  Miguel de Icaza  <miguel@ximian.com>
7351
7352         * const.cs: Add more descriptive error report, tahnks to
7353         Sebastien. 
7354
7355 2004-09-08  Marek Safar  <marek.safar@seznam.cz>
7356
7357         * ecore.cs (FieldExpr.DoResolveLValue): Fixed CS0198 report.
7358
7359 2004-09-07  Miguel de Icaza  <miguel@ximian.com>
7360
7361         * expression.cs: Apply patch from Ben: Remove dead code from
7362         ArrayCreation, and remove the TurnintoConstant call in const.cs,
7363         as that code just threw an exception anwyays.
7364
7365         * const.cs: Remove the call to the turnintoconstant, for details
7366         see bug: #63144
7367         
7368         * literal.cs: The type of the null-literal is the null type;  So
7369         we use a placeholder type (literal.cs:System.Null, defined here)
7370         for it.
7371
7372         * expression.cs (Conditional.DoResolve): Remove some old code that
7373         is no longer needed, conversions have been fixed.
7374
7375         (ArrayCreationExpression.DoResolve): Return false if we fail to
7376         resolve the inner expression.
7377
7378 2004-09-07  Raja R Harinath  <rharinath@novell.com>
7379
7380         Fix test-290.cs.
7381         * cs-parser.jay (delegate_declaration): Record a delegate
7382         declaration as a type declaration.
7383         Reported by Jo Vermeulen <jo@lumumba.luc.ac.be>.
7384
7385 2004-09-06  Miguel de Icaza  <miguel@ximian.com>
7386
7387         * parameter.cs: Do not crash if the type can not be resolved. 
7388
7389         * expression.cs: Report errors with unsafe pointers, fixes #64896
7390
7391 2004-09-06 Ben Maurer  <bmaurer@users.sourceforge.net>
7392
7393         * expression.cs: Pointer arith always needs to do a conv.i
7394         if the operand is a long. fix 65320
7395
7396 2004-09-04  Marek Safar  <marek.safar@seznam.cz>
7397
7398         Fixed cs0619-37.cs, cs0619-38.cs
7399
7400         * enum.cs (GetObsoleteAttribute): Removed.
7401
7402         * expression.cs (MemberAccess.DoResolve): Test for [Obsolete]
7403         on Enum member is double staged. The first is tested member
7404         and then enum.
7405
7406 2004-09-04  Marek Safar  <marek.safar@seznam.cz>
7407
7408         Fixed #56986, #63631, #65231
7409
7410         * class.cs: (TypeContainer.AddToMemberContainer): New method,
7411         adds member to name container.
7412         (TypeContainer.AddToTypeContainer): New method, adds type to
7413         name container.
7414         (AddConstant, AddEnum, AddClassOrStruct, AddDelegate, AddMethod,
7415         AddConstructor, AddInterface, AddField, AddProperty, AddEvent,
7416         AddOperator): Simplified by reusing AddToMemberContainer.
7417         (TypeContainer.UserDefinedStaticConstructor): Changed to property
7418         instead of field.
7419         (Method.CheckForDuplications): Fixed implementation to test all
7420         possibilities.
7421         (MemberBase): Detection whether member is explicit interface
7422         implementation is now in constructor.
7423         (MemberBase.UpdateMemberName): Handles IndexerName.
7424         (Accessor): Changed to keep also location information.
7425         (AbstractPropertyEventMethod): Is derived from MemberCore.
7426         (AbstractPropertyEventMethod.IsDummy): Says whether accessor
7427         will be emited or not.
7428         (PropertyBase.AreAccessorsDuplicateImplementation):
7429         Tests whether accessors are not in collision with some method.
7430         (Operator): Is derived from MethodCore to simplify common
7431         operations.
7432
7433         * decl.cs (Flags.TestMethodDuplication): Test for duplication
7434         must be performed.
7435         (DeclSpace.AddToContainer): Adds the member to defined_names
7436         table. It tests for duplications and enclosing name conflicts.
7437
7438         * enum.cs (EnumMember): Clean up to reuse the base structures
7439
7440 2004-09-03  Martin Baulig  <martin@ximian.com>
7441
7442         Merged latest changes into gmcs.  Please keep this comment in
7443         here, it makes it easier for me to see what changed in MCS since
7444         the last time I merged.
7445
7446 2004-09-03  Martin Baulig  <martin@ximian.com>
7447
7448         * class.cs (TypeContainer.DefineDefaultConstructor): Put this back
7449         into TypeContainer, to make partial classes work again.
7450
7451 2004-09-03  Martin Baulig  <martin@ximian.com>
7452
7453         * rootcontext.cs (RootContext.V2): Removed.
7454
7455 2004-03-23  Martin Baulig  <martin@ximian.com>
7456
7457         * expression.cs (Invocation.OverloadResolve): Added `bool
7458         may_fail' argument and use it instead of the Location.IsNull() hack.
7459
7460 2004-09-09  Martin Baulig  <martin@ximian.com>
7461
7462         * cs-parser.jay (namespace_declaration): Fixed CS0134 reporting.
7463
7464 2004-09-09  Martin Baulig  <martin@ximian.com>
7465
7466         * generic.cs (TypeParameter.DefineType): Added support for
7467         explicit interface methods.
7468
7469 2004-09-09  Martin Baulig  <martin@ximian.com>
7470
7471         * README.Changes: New document.  Started to list important changes
7472         between MCS and GMCS here.
7473
7474 2004-09-08  Martin Baulig  <martin@ximian.com>
7475
7476         * class.cs
7477         (TypeContainer.CheckRecursiveDefinition): New protected method.
7478         (TypeContainer.DefineType): Move the CS0146 check into
7479         CheckRecursiveDefinition().     
7480
7481 2004-09-06  Martin Baulig  <martin@ximian.com>
7482
7483         * generic.cs (ConstructedType.CheckConstraints): Allow builtin
7484         types for the constructor constraint.
7485
7486 2004-09-03  Martin Baulig  <martin@ximian.com>
7487
7488         * class.cs (TypeContainer.DefineDefaultConstructor): Put this back
7489         into TypeContainer, to make partial classes work again.
7490
7491 2004-09-03  Martin Baulig  <martin@ximian.com>
7492
7493         * rootcontext.cs (RootContext.V2): Removed.
7494
7495 2004-03-23  Martin Baulig  <martin@ximian.com>
7496
7497         * expression.cs (Invocation.OverloadResolve): Added `bool
7498         may_fail' argument and use it instead of the Location.IsNull() hack.
7499
7500 2004-09-03  Martin Baulig  <martin@ximian.com>
7501
7502         Merged latest changes into gmcs.  Please keep this comment in
7503         here, it makes it easier for me to see what changed in MCS since
7504         the last time I merged.
7505
7506 2004-09-03  Raja R Harinath  <rharinath@novell.com>
7507
7508         Fix #61128.
7509         * expression.cs (BetterConversion): Don't allow either conversion 
7510         to be null.  Remove redundant implicit conversion test when 'q ==
7511         null' -- when this function is invoked, we already know that the
7512         implicit conversion exists.
7513         (BetterFunction): Assume that 'best' is non-null.  Remove
7514         redundant reimplementation of IsApplicable when 'best' is null.
7515         (IsParamsMethodApplicable, IsApplicable): Add new parameter for
7516         number of arguments.
7517         (IsAncestralType): Extract from OverloadResolve.
7518         (OverloadResolve): Make robust to the MethodGroupExpr being
7519         unsorted.  Implement all the logic of Section 14.5.5.1, and
7520         support overloading of methods from multiple applicable types.
7521         Clean up logic somewhat.  Don't pass null methods to BetterFunction.
7522
7523         * report.cs (SymbolRelatedToPreviousError): Cleanup output.
7524         (RealError, Warning): Append type of report to related symbol.
7525
7526 2004-09-03  Marek Safar  <marek.safar@seznam.cz>
7527
7528         * enum.cs: Fixed CLS-Compliance checks for enum members.
7529         Error tests cs3008-8.cs, cs3014-8.cs
7530
7531 2004-09-02  Marek Safar  <marek.safar@seznam.cz>
7532
7533         Fixed bug #62342, #63102
7534         * class.cs: ImplementIndexer uses member.IsExplicitImpl
7535         like ImplementMethod.
7536
7537 2004-09-02  Marek Safar  <marek.safar@seznam.cz>
7538
7539         * attribute.cs (Attribute.GetAttributeArgumentExpression):
7540         Fixed bug #65170.
7541
7542 2004-09-02  Martin Baulig  <martin@ximian.com>
7543
7544         * statement.cs (Using.EmitLocalVariableDeclFinally): Use
7545         TypeManager.GetArgumentTypes() rather than calling GetParameters()
7546         on the MethodBase.
7547
7548 2004-09-01  Marek Safar  <marek.safar@seznam.cz>
7549
7550         C# 2.0 Static classes implemented
7551
7552         * class.cs (TypeContainer): instance_constructors,
7553         initialized_fields, initialized_static_fields,
7554         default_constructor, base_inteface_types are protected to be
7555         accessible from StaticClass.
7556         (TypeContainer.DefineDefaultConstructor): New virtual method
7557         for custom default constructor generating
7558         (StaticClass): New class to handle "Static classes" feature.
7559
7560         * cs-parser.jay: Handle static keyword on class like instance
7561         of StaticClass.
7562
7563         * driver.cs: Added "/langversion" command line switch with two
7564         options (iso-1, default).
7565
7566 2004-08-31  Marek Safar  <marek.safar@seznam.cz>
7567
7568         * ecore.cs (FieldExpr.Resolve): Fixed bug #64689.
7569
7570 2004-08-31  Miguel de Icaza  <miguel@ximian.com>
7571
7572         * delegate.cs: Style.
7573
7574 2004-08-31 Ben Maurer  <bmaurer@users.sourceforge.net>
7575
7576         * delegate.cs: Add seperate instance expr field for miguel.
7577
7578 2004-08-29 Ben Maurer  <bmaurer@users.sourceforge.net>
7579
7580         * PointerArithmetic (Resolve): make sure we are not doing
7581         pointer arith on void*. Also, make sure we are resolved
7582         by not setting eclass until resolve.
7583
7584         All callers: Make sure that PointerArithmetic gets resolved.
7585
7586 2004-08-29 Ben Maurer  <bmaurer@users.sourceforge.net>
7587
7588         * ArrayCreation (LookupType): If the type does not resolve 
7589         to an array, give an error.
7590
7591 2004-08-27  Marek Safar  <marek.safar@seznam.cz>
7592
7593         * statement.cs (Try.Resolve): Fixed bug #64222
7594
7595 2004-08-27  Martin Baulig  <martin@ximian.com>
7596
7597         * class.cs
7598         (TC.OperatorArrayList.OperatorEntry.CheckPairedOperators): Don't
7599         crash here.     
7600
7601 2004-08-26  Marek Safar  <marek.safar@seznam.cz>
7602
7603         * ecore.cs (Constantify): Get underlying type via
7604         System.Enum.GetUnderlyingType to avoid StackOverflow on the
7605         Windows in special cases.
7606
7607 2004-08-26  Marek Safar  <marek.safar@seznam.cz>
7608
7609         * typemanager.cs (GetAddMethod): Used GetAddMethod (true)
7610         for obtaining also private methods.
7611         (GetRemoveMethod): Used GetRemoveMethod (true)
7612         for obtaining also private methods.
7613
7614 2004-09-02  Martin Baulig  <martin@ximian.com>
7615
7616         * statement.cs (Using.EmitLocalVariableDeclFinally): Use
7617         TypeManager.GetArgumentTypes() rather than calling GetParameters()
7618         on the MethodBase.
7619
7620 2004-08-27  Martin Baulig  <martin@ximian.com>
7621
7622         * class.cs
7623         (TC.OperatorArrayList.OperatorEntry.CheckPairedOperators): Don't
7624         crash here.     
7625
7626 2004-08-25  Martin Baulig  <martin@ximian.com>
7627
7628         * support.cs (ReflectionParameters..ctor): If this is a generic
7629         method, retrieve and store its type parameters.
7630         (InternalParameters..ctor): Added `TypeParameter[]' argument.
7631         (ReflectionParameters.GenericConstraints): The argument specifies
7632         the type parameter, not the method parameter.
7633         (InternalParameters.GenericConstraints): Likewise.
7634
7635         * generic.cs (TypeParameter.DefineType): Correctly handle
7636         constraints wrt. generic methods in interfaces and their
7637         implementations.        
7638
7639 2004-08-24  Martin Baulig  <martin@ximian.com>
7640
7641         * generic.cs (TypeParameter.IsSubclassOf): New public method.
7642         (Constraints.IsSubclassOf): New internal method.
7643
7644         * typemanager.cs (TypeManager.FindMembers): Added special support
7645         for GenericTypeParameterBuilder's.      
7646         (TypeManager.IsSubclassOf, IsFamilyAccessible): Added support for
7647         type parameters.
7648
7649 2004-08-24  Martin Baulig  <martin@ximian.com>
7650
7651         * typemanager.cs
7652         (TypeManager.IsSubclassOf): Renamed to IsFamilyAccessible; use
7653         this for accessibility checks.
7654         (TypeManager.IsSubclassOrNestedChildOf): Renamed to
7655         IsNestedFamilyAccessible.
7656         (TypeManager.IsSubclassOf): New method, do what the name actually
7657         says.   
7658
7659 2004-08-24  Martin Baulig  <martin@ximian.com>
7660
7661         * expression.cs (MemberAccess.DoResolve): When resolving ourselves
7662         as a SimpleName, include the generic arity.
7663
7664 2004-08-24  Martin Baulig  <martin@ximian.com>
7665
7666         * class.cs (Method.Define): Set MethodAttributes.SpecialName and
7667         MethodAttributes.HideBySig for operators.
7668
7669 2004-08-23  Martin Baulig  <martin@ximian.com>
7670
7671         Back to the old error reporting system :-)
7672
7673         * report.cs (Message): Removed.
7674         (Report.MessageData, ErrorData, WarningData): Removed.
7675         (Report.Error, Warning): Back to the old system.
7676
7677 2004-08-23  Martin Baulig  <martin@ximian.com>
7678
7679         * decl.cs (IMemberContainer.Parent): Renamed to ParentContainer.
7680
7681         * class.cs (TypeContainer.ParentContainer): New public virtual
7682         method; replaces the explicit interface implementation.
7683         (ClassPart.ParentContainer): Override.
7684
7685 2004-08-23  Martin Baulig  <martin@ximian.com>
7686
7687         * statement.cs (Switch): Added support for constant switches; see
7688         #59428 or test-285.cs.
7689
7690 2004-08-22  Marek Safar  <marek.safar@seznam.cz>
7691
7692         Fixed bug #62740.
7693         * statement.cs (GetEnumeratorFilter): Removed useless
7694         logic because C# specs is strict. GetEnumerator must be
7695         public.
7696
7697 2004-08-22  Martin Baulig  <martin@ximian.com>
7698
7699         * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
7700         a switch and may break, reset the barrier.  Fixes #59867.
7701
7702 2004-08-22  Marek Safar  <marek.safar@seznam.cz>
7703
7704         CLS-Compliance speed up (~5% for corlib)
7705
7706         * attribute.cs (AttributeTester.VerifyTopLevelNameClsCompliance):
7707         New method. Tests container for CLS-Compliant names
7708
7709         * class.cs (TypeContainer.VerifyClsName): New method.
7710         Checks whether container name is CLS Compliant.
7711         (Constructor): Implements IMethodData.
7712
7713         * decl.cs (MemberCache.GetPublicMembers ): New method. Builds
7714         low-case table for CLS Compliance test.
7715         (MemberCache.VerifyClsParameterConflict): New method.
7716         Checks method parameters for CS3006 error.
7717
7718         * enum.cs (EnumMember): Is derived from MemberCore.
7719         (Enum.VerifyClsName): Optimized for better performance.
7720
7721 2004-08-06  Marek Safar  <marek.safar@seznam.cz>
7722
7723         * report.cs: Renamed Error_T to Error and changed all
7724         references.
7725
7726 2004-08-06  Marek Safar  <marek.safar@seznam.cz>
7727
7728         * class.cs (TypeContainer.IndexerArrayList): New inner class
7729         container for indexers.
7730         (TypeContainer.DefaultIndexerName): New constant for default
7731         indexer name. Replaced all "Item" with this constant.
7732         (TypeContainer.DefineIndexers): Moved to IndexerArrayList class.
7733
7734         * typemanager.cs (TypeManager.default_member_ctor): Cache here
7735         DefaultMemberAttribute constructor.
7736
7737 2004-08-05  Martin Baulig  <martin@ximian.com>
7738
7739         * flowanalysis.cs (FlowBranching.UsageVector.MergeJumpOrigins):
7740         Fix bug #59429.
7741
7742 2004-08-05  Marek Safar  <marek.safar@seznam.cz>
7743
7744         * mcs.exe.sources: $(EXTRA_SOURCES) are now here to avoid
7745         multi platforms problem.
7746
7747         * compiler.csproj: Included shared files.
7748
7749 2004-08-04  Marek Safar  <marek.safar@seznam.cz>
7750
7751         Fix bug 60333, 55971 in the more general way
7752         * attribute.cs (Attribute.GetAttributeArgumentExpression):
7753         Added arg_type argument for constant conversion.
7754         (Attribute.Resolve): Reuse GetAttributeArgumentExpression.
7755
7756 2004-08-04  Marek Safar  <marek.safar@seznam.cz>
7757
7758         Fix bug #59760
7759         * class.cs (TypeContainer ): New inner classes MethodArrayList, 
7760         OperatorArrayList, MethodCoreArrayList for typecontainer
7761         containers. Changed class member types to these new types.
7762         (MethodArrayList.DefineMembers): Added test for CS0659.
7763
7764 2004-08-04  Miguel de Icaza  <miguel@ximian.com>
7765
7766         * cfold.cs: Synchronize the folding with the code in expression.cs
7767         Binary.DoNumericPromotions for uint operands.
7768
7769         * attribute.cs: Revert patch from Raja, it introduced a regression
7770         while building Blam-1.2.1 (hard to isolate a test case).
7771
7772 2004-08-04  Marek Safar  <marek.safar@seznam.cz>
7773
7774         Fix for #55382
7775         * class.cs:
7776         (TypeContainer.Define): Renamed to DefineContainerMembers because of
7777         name collision.
7778         (MethodCore.parent_method): New member. The method we're overriding
7779         if this is an override method.
7780         (MethodCore.CheckBase): Moved from Method class and made common.
7781         (MethodCore.CheckMethodAgainstBase): Moved from MemberBase and made
7782         private.
7783         (MethodCore.CheckForDuplications): New abstract method. For custom
7784         member duplication search in a container
7785         (MethodCore.FindOutParentMethod): New abstract method. Gets parent
7786         method and its return type.
7787         (Event.conflict_symbol): New member. Symbol with same name in the
7788         parent class.
7789
7790         * decl.cs:
7791         (MemberCache.FindMemberWithSameName): New method. The method
7792         is looking for conflict with inherited symbols.
7793
7794 2004-08-04  Martin Baulig  <martin@ximian.com>
7795
7796         * codegen.cs (VariableStorage.EmitLoadAddress): New public method.
7797
7798         * statement.cs (Foreach.EmitFinally): Make this work for valuetypes.
7799
7800 2004-08-03  Marek Safar  <marek.safar@seznam.cz>
7801
7802         * report.cs (Message): New enum for better error, warning reference in
7803         the code.
7804         (MessageData): New inner abstract class. It generally handles printing of
7805         error and warning messages.
7806         Removed unused Error, Warning, Message methods.
7807
7808 2004-08-03  Marek Safar  <marek.safar@seznam.cz>
7809
7810         Fix for cs0592-8.cs test
7811         * attribute.cs
7812         (Attributable.ValidAttributeTargets): Made public.
7813         (Attribute.ExplicitTarget): New member for explicit target value.
7814         (Attribute.CheckTargets): Now we translate explicit attribute
7815         target to Target here.
7816
7817 2004-08-03  Ben Maurer  <bmaurer@ximian.com>
7818
7819         * ecore.cs (MethodGroupExpr): new IsBase property.
7820
7821         * expression.cs (BaseAccess): Set IsBase on MethodGroupExpr.
7822
7823         * delegate.cs (DelegateCreation): store a MethodGroupExpr
7824         rather than an instance expr.
7825
7826         (DelegateCreation.Emit): Use the method group rather than
7827         the instance expression. Also, if you have base.Foo as the
7828         method for a delegate, make sure to emit ldftn, not ldftnvirt.
7829
7830         (ResolveMethodGroupExpr): Use the MethodGroupExpr. 
7831
7832         (NewDelegate.DoResolve): Only check for the existance of Invoke
7833         if the method is going to be needed. Use MethodGroupExpr.
7834
7835         (NewDelegate.Emit): Remove, DelegateCreation implements this.   
7836
7837         * expression.cs: For pointer arith., make sure to use
7838         the size of the type, not the size of the pointer to
7839         the type.
7840
7841 2004-08-03  Marek Safar  <marek.safar@seznam.cz>
7842
7843         Fix for #60722
7844         * class.cs (Class): Added error CS0502 test.
7845
7846 2004-08-03  John Luke  <jluke@cfl.rr.com>
7847             Raja R Harinath  <rharinath@novell.com>
7848
7849         Fix for #60997.
7850         * attribute.cs (Attribute.complained_before): New flag.
7851         (Attribute.ResolveType, Attribute.Resolve),
7852         (Attribute.DefinePInvokeMethod): Set it.
7853         (Attributes.Search): Pass 'complain' to Attribute.ResolveType.
7854         
7855 2004-08-03  Martin Baulig  <martin@ximian.com>
7856
7857         * expression.cs (Binary.ResolveOperator): Don't abort if we can't
7858         use a user-defined operator; we still need to do numeric
7859         promotions in case one argument is a builtin type and the other
7860         one has an implicit conversion to that type.  Fixes #62322.
7861
7862 2004-08-18  Martin Baulig  <martin@ximian.com>
7863
7864         * class.cs (Method.Define): Use the correct method name when
7865         creating the MethodBuilder for a generic method.
7866
7867 2004-08-17  Martin Baulig  <martin@ximian.com>
7868
7869         * generic.cs (Constraints): Support type parameter constraints.
7870
7871 2004-08-16  Martin Baulig  <martin@ximian.com>
7872
7873         * cs-tokenizer.cs (Tokenizer.TypeOfParsing): New public property.
7874         (Token.GENERIC_DIMENSION): New token; this is returned if we
7875         encounter an unbound generic type in a typeof() expression.
7876
7877         * cs-parser.jay (opt_type_argument_list): Added GENERIC_DIMENSION;
7878         this token is only generated while parsing a typeof() expression.
7879         (typeof_expression): Removed the old unbound_type hack.
7880
7881         * generic.cs (TypeArguments.IsUnbound): New public property.
7882
7883         * decl.cs (MemberName): Added support for unbound types.
7884
7885 2004-08-14  Martin Baulig  <martin@ximian.com>
7886
7887         * typemanager.cs
7888         (TypeManager.IsEqualGenericInstance): New static method.
7889         (TypeManager.IsSubclassOrNestedChildOf, IsSubclassOf): This is
7890         just used to check accessibility, so follow the rules of 26.1.6.        
7891
7892         * expression.cs (MemberAccess.ResolveAsTypeStep): Return a
7893         ConstructedType instead of a TypeExpression if we have type arguments.
7894
7895         * cs-parser.jay (typeof_expression): Support unbound generic types.
7896
7897         * ecore.cs (UnboundTypeExpression): New public class.
7898
7899 2004-08-12  Martin Baulig  <martin@ximian.com>
7900
7901         * typemanager.cs (TypeManager.IsNestedChildOf): Use
7902         TypeManager.IsEqual() rather than `=='.
7903
7904         * decl.cs (DeclSpace.CheckAccessLevel): Use `tb.FullName' for
7905         generic instances as well.
7906
7907 2004-08-12  Martin Baulig  <martin@ximian.com>
7908
7909         * expression.cs (Invocation.InferType): We can only infer method
7910         type parameters.  Fixes #62647.
7911
7912 2004-08-11  Martin Baulig  <martin@ximian.com>
7913
7914         * class.cs (TypeContainer.DefineType): Create the TypeBuilder
7915         before resolving the base classes.
7916
7917 2004-08-06 Gonzalo Paniagua Javier <gonzalo@ximian.com>
7918
7919         * Makefile: install .mdb file too.
7920
7921 2004-08-05  Martin Baulig  <martin@ximian.com>
7922
7923         * ecore.cs (FieldExpr.DoResolveLValue): If we're resolving a field
7924         initializer, the current type is just the TypeBuilder, not the
7925         instantiated generic type.
7926         (FieldExpr.IsFieldInitializer): New public property.
7927
7928 2004-08-04  Martin Baulig  <martin@ximian.com>
7929
7930         * codegen.cs (VariableStorage.EmitLoadAddress): New public method.
7931
7932         * statement.cs (Foreach.EmitFinally): Make this work for valuetypes.
7933
7934 2004-08-03  Martin Baulig  <martin@ximian.com>
7935
7936         * class.cs (MethodData.Define): If we're an explicit
7937         implementation, remove the generic arity from the type name.
7938
7939 2004-08-03  Martin Baulig  <martin@ximian.com>
7940
7941         * expression.cs (Binary.ResolveOperator): Don't abort if we can't
7942         use a user-defined operator; we still need to do numeric
7943         promotions in case one argument is a builtin type and the other
7944         one has an implicit conversion to that type.  Fixes #62322.
7945
7946 2004-08-02  Martin Baulig  <martin@ximian.com>
7947
7948         * class.cs (TypeContainer.ifaces): Make this a `Type[]', not a
7949         `TypeExpr[]' array.
7950         (TypeContainer.GetClassBases): Return the unexpanded list of
7951         interfaces; we expand them later.
7952         (TypeContainer.DefineType): After creating the TypeBuilder, call
7953         TypeManager.ExpandInterfaces() to get an expanded and resolved
7954         list of interfaces.
7955
7956         * ecore.cs (TypeExpr.GetInterfaces): Removed
7957
7958         * generics.cs (Constraints.InterfaceConstraints): Remove.
7959         (TypeParameter.DefineType): Call TypeManager.RegisterBuilder() to
7960         register the interface constraints.
7961
7962         * typemanager.cs
7963         (TypeManager.AddUserType): Removed the `ifaces' argument.
7964         (TypeManager.AddTypeParameter): Likewise.
7965         (TypeManager.AddUserInterface): Removed, was unused.
7966         (TypeManager.RegisterBuilder): Take a `Type[]' instead of a
7967         `TypeExpr[]' array for the interfaces.
7968         (TypeManager.ExpandInterfaces): Call this after the TypeBuilder
7969         has been defined, returns a list of the resolved interfaces types.
7970         (TypeManager.GetInterfaces): Return a `Type[]', not a `TypeExpr[]'.
7971         (TypeManager.GetExplicitInterfaces): Likewise.  
7972
7973 2004-08-02  Martin Baulig  <martin@ximian.com>
7974
7975         * expression.cs (Invocation.EmitCall): If we're invoking a method
7976         on a type parameter, use the new `Constrained' prefix opcode.
7977
7978 2004-08-02  Martin Baulig  <martin@ximian.com>
7979
7980         * statement.cs (LocalInfo.Flags): Added `IsThis'.
7981         (LocalInfo.IsThis): New public property.
7982         (Block.EmitMeta): Don't create a LocalBuilder for `this'.
7983
7984 2004-08-01  Martin Baulig  <martin@ximian.com>
7985
7986         * class.cs (TypeContainer.GetClassBases): Don't set the default
7987         here since we may get called from GetPartialBases().
7988         (TypeContainer.DefineType): If GetClassBases() didn't return a
7989         parent, use the default one.
7990
7991 2004-07-30  Martin Baulig  <martin@ximian.com>
7992
7993         * Makefile (EXTRA_SOURCES): List the symbol writer's sources here.
7994
7995         * class.cs (SourceMethod): New public class, derive from the
7996         symbol writer's ISourceMethod.
7997         (Method): Use the new symbol writer API.
7998
7999         * codegen.cs (CodeGen.InitializeSymbolWriter): Take the filename
8000         as argument and use the new symbol writer.
8001
8002         * location.cs
8003         (SourceFile): Implement the symbol writer's ISourceFile.
8004         (Location.SymbolDocument): Removed.
8005         (Location.SourceFile): New public property.
8006
8007         * symbolwriter.cs: Use the new symbol writer API.
8008
8009 2004-07-30  Raja R Harinath  <rharinath@novell.com>
8010
8011         * Makefile (install-local): Remove.  Functionality moved to
8012         executable.make.
8013
8014 2004-07-28  Lluis Sanchez Gual  <lluis@novell.com>
8015
8016         * Makefile: Install mcs.exe.config file together with mcs.exe.
8017         * mcs.exe.config: Added supportedRuntime entry to make sure it runs in the
8018         correct runtime version.
8019         
8020 2004-07-25  Martin Baulig  <martin@ximian.com>
8021
8022         * class.cs
8023         (TypeContainer.RegisterOrder): Removed, this was unused.
8024         (TypeContainer, interface_order): Removed.
8025         (TypeContainer.AddClass, AddStruct, AddInterface): Take a
8026         TypeContainer as argument since we can also be called with a
8027         `PartialContainer' for a partial class/struct/interface.
8028         (TypeContainer.IsInterface): Use `Kind == Kind.Interface' instead
8029         of checking whether we're an `Interface' - we could be a
8030         `PartialContainer'.
8031         (PartialContainer.Register): Override; call
8032         AddClass()/AddStruct()/AddInterface() on our parent.
8033
8034         * cs-parser.jay (interface_member_declaration): Add things to the
8035         `current_container', not the `current_class'.
8036
8037         * rootcontext.cs (RegisterOrder): The overloaded version which
8038         takes an `Interface' was unused, removed.
8039
8040         * typemanager.cs (TypeManager.LookupInterface): Return a
8041         `TypeContainer', not an `Interface'.
8042         (TypeManager.IsInterfaceType): The `builder_to_declspace' may
8043         contain a `PartialContainer' for an interface, so check it's
8044         `Kind' to figure out what it is.
8045
8046 2004-07-25  Martin Baulig  <martin@ximian.com>
8047
8048         * class.cs (Class.DefaultTypeAttributes): New public constant.
8049         (Struct.DefaultTypeAttributes): Likewise.
8050         (Interface.DefaultTypeAttributes): Likewise.
8051         (PartialContainer.TypeAttr): Override this and add the
8052         DefaultTypeAttributes.
8053
8054 2004-07-25  Martin Baulig  <martin@ximian.com>
8055
8056         * decl.cs (DeclSpace.Emit): Removed the `TypeContainer' argument,
8057         we can just use the `Parent' field instead.
8058
8059 2004-07-25  Martin Baulig  <martin@ximian.com>
8060
8061         * class.cs (TypeContainer.Emit): Renamed to EmitType().
8062
8063 2004-07-25  Martin Baulig  <martin@ximian.com>
8064
8065         * class.cs (TypeContainer.DefineMembers): Call DefineMembers() on
8066         our parts before defining any methods.
8067         (TypeContainer.VerifyImplements): Make this virtual.
8068         (ClassPart.VerifyImplements): Override and call VerifyImplements()
8069         on our PartialContainer.
8070
8071 2004-07-25  Martin Baulig  <martin@ximian.com>
8072
8073         * iterators.cs (Iterator.Define): Renamed to DefineIterator().
8074
8075         * decl.cs (DeclSpace.Define): Removed the `TypeContainer'
8076         argument, we can just use the `Parent' field instead.
8077
8078         * class.cs
8079         (MemberBase.CheckBase): Removed the `TypeContainer' argument.   
8080         (MemberBase.DoDefine): Likewise.
8081
8082 2004-07-24  Martin Baulig  <martin@ximian.com>
8083
8084         * decl.cs (MemberCore.Parent): New public field.
8085         (DeclSpace.Parent): Moved to MemberCore.
8086
8087         * class.cs (MethodCore.ds): Removed; use `Parent' instead.
8088         (MemberBase.ctor): Added TypeContainer argument, pass it to our
8089         parent's .ctor.
8090         (FieldBase, Field, Operator): Likewise.
8091         (EventProperty.ctor): Take a TypeContainer instead of a DeclSpace.
8092         (EventField, Event): Likewise.
8093
8094 2004-07-23  Martin Baulig  <martin@ximian.com>
8095
8096         * class.cs (PartialContainer): New public class.
8097         (ClassPart): New public class.
8098         (TypeContainer): Added support for partial classes.
8099         (TypeContainer.GetClassBases): Splitted some of the functionality
8100         out into GetNormalBases() and GetPartialBases().
8101
8102         * cs-tokenizer.cs (Token.PARTIAL): New token.
8103         (Tokenizer.consume_identifier): Added some hacks to recognize
8104         `partial', but only if it's immediately followed by `class',
8105         `struct' or `interface'.
8106
8107         * cs-parser.jay: Added support for partial clases.
8108
8109 2004-07-23  Martin Baulig  <martin@ximian.com>
8110
8111         * class.cs (MethodCore.ds): Made this a `TypeContainer' instead of
8112         a `DeclSpace' and also made it readonly.
8113         (MethodCore.ctor): Take a TypeContainer instead of a DeclSpace.
8114         (Method.ctor, Constructor.ctor, Destruktor.ctor): Likewise.
8115         (PropertyBase.ctor, Property.ctor, Indexer.ctor): Likewise.
8116
8117         * cs-parser.jay: Pass the `current_class', not the
8118         `current_container' (at the moment, this is still the same thing)
8119         to a new Method, Property, Event, Indexer or Constructor.
8120
8121 2004-07-23  Martin Baulig  <martin@ximian.com>
8122
8123         * cs-parser.jay (CSharpParser): Added a new `current_class' field
8124         and removed the `current_interface' one.
8125         (struct_declaration, class_declaration, interface_declaration):
8126         Set `current_class' to the newly created class/struct/interface;
8127         set their `Bases' and call Register() before parsing their body.
8128
8129 2004-07-23  Martin Baulig  <martin@ximian.com>
8130
8131         * class.cs (Kind): New public enum.
8132         (TypeContainer): Made this class abstract.
8133         (TypeContainer.Kind): New public readonly field.
8134         (TypeContainer.CheckDef): New public method; moved here from
8135         cs-parser.jay.
8136         (TypeContainer.Register): New public abstract method.
8137         (TypeContainer.GetPendingImplementations): New public abstract
8138         method.
8139         (TypeContainer.GetClassBases): Removed the `is_class' and
8140         `is_iface' parameters.
8141         (TypeContainer.DefineNestedTypes): Formerly known as
8142         DoDefineType().
8143         (ClassOrStruct): Made this class abstract.
8144
8145         * tree.cs (RootTypes): New public type. 
8146
8147 2004-07-20  Martin Baulig  <martin@ximian.com>
8148
8149         * tree.cs (Tree.RecordNamespace): Removed.
8150         (Tree.Namespaces): Removed.
8151
8152         * rootcontext.cs (RootContext.IsNamespace): Removed.
8153
8154         * cs-parser.jay (namespace_declaration): Just create a new
8155         NamespaceEntry here.
8156
8157 2004-07-21  Lluis Sanchez Gual  <lluis@novell.com>
8158
8159         * Makefile: Install gmcs.exe.config file together with gmcs.exe.
8160         * gmcs.exe.config: Renamed from mcs.exe.config. Added supportedRuntime
8161         entry to make sure it runs in the correct runtime version.
8162         
8163 2004-07-18  Martin Baulig  <martin@ximian.com>
8164
8165         * generic.cs (ConstructedType.CheckConstraints): Improved
8166         constraints checking.
8167
8168 2004-07-18  Martin Baulig  <martin@ximian.com>
8169
8170         * expression.cs (Invocation.BetterMethod): Call
8171         TypeManager.TypeToCoreType() on all types and removed my previous
8172         hack; we're already doig the right thing here.
8173
8174 2004-07-17  Martin Baulig  <martin@ximian.com>
8175
8176         * decl.cs (MemberName.MakeName): Create the "class`1" names here.
8177
8178 2004-07-16  Martin Baulig  <martin@ximian.com>
8179
8180         * iterators.cs: Added generics support.
8181
8182 2004-07-16  Martin Baulig  <martin@ximian.com>
8183
8184         * iterators.cs: Rewrote this.  We're now using one single Proxy
8185         class for both the IEnumerable and the IEnumerator interface and
8186         `Iterator' derives from Class so we can use the high-level API.
8187
8188         * class.cs (TypeContainer.AddIterator): New method.
8189         (TypeContainer.DoDefineType): New protected virtual method, which
8190         is called from DefineType().
8191         (TypeContainer.DoDefineMembers): Call DefineType() and
8192         DefineMembers() on all our iterators.
8193         (TypeContainer.Emit): Call Emit() on all our iterators.
8194         (TypeContainer.CloseType): Call CloseType() on all our iterators.
8195
8196         * codegen.cs (EmitContext.CurrentIterator): New public field.
8197
8198 2004-07-15  Martin Baulig  <martin@ximian.com>
8199
8200         * typemanager.cs
8201         (TypeManager.not_supported_exception_type): New type.   
8202
8203 2004-07-14  Martin Baulig  <martin@ximian.com>
8204
8205         * typemanager.cs
8206         (TypeManager.generic_ienumerable_type): New type.
8207         (TypeManager.generic_ienumerator_type): New type.
8208
8209         * rootcontext.cs
8210         (RootContext.interfaces_first_stage): Added
8211         "System.Collections.Generic.IEnumerator`1" and
8212         "System.Collections.Generic.IEnumerable`1".     
8213
8214 2004-07-14  Martin Baulig  <martin@ximian.com>
8215
8216         * iterators.cs: Use real error numbers.
8217
8218 2004-07-14  Martin Baulig  <martin@ximian.com>
8219
8220         * iterator.cs (IteratorHandle.IsIEnumerable): The spec explicitly
8221         requires this to be a System.Collection.IEnumerable and not a
8222         class implementing that interface.
8223         (IteratorHandle.IsIEnumerator): Likewise, for IEnumerator.      
8224
8225 2004-07-13  Marek Safar  <marek.safar@seznam.cz>
8226
8227         * class.cs: Fixed previous fix, it broke some error tests.
8228
8229 2004-07-12  Martin Baulig  <martin@ximian.com>
8230
8231         * enum.cs (Enum.Define): Call Emit() to emit the attributes.
8232         Fixes #61293.
8233
8234 2004-07-14  Martin Baulig  <martin@ximian.com>
8235
8236         * decl.cs, expression.cs, generic.cs: Use a backqoute (`) and not
8237         an exclamation mark (!) for the generic arity to reflect the
8238         latest spec changes; ie. use "System.Collections.Generic.IList`1".
8239
8240 2004-07-13  Martin Baulig  <martin@ximian.com>
8241
8242         * cs-tokenizer.cs (Tokenizer.parse_less_than): Allow array rank
8243         specifiers being part of a type argument.
8244
8245 2004-07-13  Martin Baulig  <martin@ximian.com>
8246
8247         * expression.cs (MemberAccess.ResolveAsTypeStep): Use the full `!'
8248         name for generic types.
8249
8250 2004-07-13  Martin Baulig  <martin@ximian.com>
8251
8252         * assign.cs (Assign.DoResolve): Moved the CS0131 check up a little
8253         bit to fix #60119.
8254
8255 2004-07-09  Miguel de Icaza  <miguel@ximian.com>
8256
8257         * assign.cs (LocalTemporary): Add new argument: is_address,If
8258         `is_address' is true, then the value that we store is the address
8259         to the real value, and not the value itself.
8260         
8261         * ecore.cs (PropertyExpr): use the new local temporary
8262         stuff to allow us to handle X.Y += z (where X is a struct)
8263
8264 2004-07-08  Martin Baulig  <martin@ximian.com>
8265
8266         * statement.cs (Lock.Resolve): Set ec.NeedReturnLabel() if we do
8267         not always return, just like we're doing in Using.Resolve().
8268
8269 2004-07-07  Miguel de Icaza  <miguel@ximian.com>
8270
8271         * cs-parser.jay (fixed_statement): flag this as Pinned.
8272
8273 2004-07-06  Miguel de Icaza  <miguel@ximian.com>
8274
8275         * typemanager.cs (TypeManager): Removed MakePinned method, this
8276         mechanism is replaced with the .NET 2.x compatible mechanism of
8277         calling `ILGenerator.DeclareLocal (Type t, bool pinned)'.
8278
8279         * statement.cs (LocalInfo): Remove MakePinned, add Pinned property 
8280         Rename `Fixed' to `Pinned' as a flag, to distinguish from the
8281         `IsFixed' property which has a different meaning.
8282
8283 2004-07-02  Raja R Harinath  <rharinath@novell.com>
8284
8285         * ecore.cs (DoSimpleNameResolve): Expand CS0038 check to all names
8286         visible from inside a nested class, not just the names of the
8287         immediately enclosing class.
8288         Fix for bug #60730.
8289
8290 2004-06-24  Raja R Harinath  <rharinath@novell.com>
8291
8292         * expression.cs (BetterConversion): Remove buggy special-case
8293         handling of "implicit constant expression conversions".  At this
8294         point, we already know that the conversion is possible -- we're
8295         only checking to see which is better.
8296
8297 2004-06-24  Marek Safar  <marek.safar@seznam.cz>
8298
8299         * cs-parser.jay: Added error CS0210 test.
8300
8301 2004-06-24  Marek Safar  <marek.safar@seznam.cz>
8302
8303         * cs-parser.jay: Added error CS0134 test.
8304
8305 2004-06-24  Marek Safar  <marek.safar@seznam.cz>
8306
8307         Fix bug #52507
8308         * cs-parser.jay: Added error CS0145 test.
8309
8310 2004-06-24  Marek Safar  <marek.safar@seznam.cz>
8311
8312         * class.cs (Operator.Define): Added test for errors CS0553, CS0554.
8313
8314 2004-06-23  Ben Maurer  <bmaurer@ximian.com>
8315         
8316         * expression.cs (StackAlloc.Resolve): The argument may not
8317         be a constant; deal with this case.
8318         
8319 2004-06-23  Marek Safar  <marek.safar@seznam.cz>
8320
8321         * attribute.cs (IndexerName_GetIndexerName): Renamed to
8322         GetIndexerAttributeValue.
8323         (ScanForIndexerName): Renamed to GetIndexerNameAttribute.
8324
8325         * class.cs (Indexer.Define): Added error tests for CS0415,
8326         CS0609.
8327
8328 2004-06-23  Miguel de Icaza  <miguel@ximian.com>
8329
8330         * attribute.cs (Attribute.Resolve): Keep field code in sync with
8331         property code.
8332
8333 2004-06-23  Martin Baulig  <martin@ximian.com>
8334
8335         * flowanalysis.cs (UsageVector.MergeChild): If we're a loop and we
8336         neither return nor throw, reset the barrier as well.  Fixes #60457.
8337
8338 2004-06-22  Atsushi Enomoto  <atsushi@ximian.com>
8339
8340         * class.cs : EventAttributes is now set to None by default.
8341           This fixes bug #60459.
8342
8343 2004-06-18  Marek Safar  <marek.safar@seznam.cz>
8344
8345         Fix bug #60219
8346         * class.cs (ConstructorInitializer.GetOverloadedConstructor):
8347         Don't throw exception but return null (it's sufficient now).
8348
8349 2004-06-18  Marek Safar  <marek.safar@seznam.cz>
8350
8351         * typemanager.cs (GetArgumentTypes): Faster implementation.
8352
8353 2004-06-18  Martin Baulig  <martin@ximian.com>
8354
8355         * attribute.cs (Attribute.Resolve): Check whether we're an
8356         EmptyCast which a Constant child.  Fixes #60333.
8357
8358 2004-06-17  Ben Maurer  <bmaurer@ximian.com>
8359
8360         * statement.cs (EmitCollectionForeach): Account for the fact that
8361         not all valuetypes are in areas which we can take the address of.
8362         For these variables, we store to a temporary variable. Also, make
8363         sure that we dont emit a `callvirt' on a valuetype method.
8364
8365 2004-06-15  Marek Safar  <marek.safar@seznam.cz>
8366
8367         * expression.cs (StackAlloc.DoReSolve): Added test for
8368         negative parameter (CS0247).
8369
8370 2004-06-15  Marek Safar  <marek.safar@seznam.cz>
8371
8372         Fix bug #59792
8373         * class.cs: (Event.DelegateMethod.Emit): Added synchronization flag.
8374
8375 2004-06-15  Marek Safar  <marek.safar@seznam.cz>
8376
8377         Fix bug #59781
8378         * expression.cs: (Binary.DoNumericPromotions): Added conversion for
8379         ulong.
8380
8381 2004-06-14  Marek Safar  <marek.safar@seznam.cz>
8382
8383         Fix bug #58254 & cs1555.cs, cs1556.cs
8384         * driver.cs (MainDriver): Added tests for errors CS1555, CS1556.
8385
8386 2004-06-14  Marek Safar  <marek.safar@seznam.cz>
8387
8388         * cs-parser.jay: Added error CS1669 test for indexers.
8389
8390 2004-06-18  Martin Baulig  <martin@ximian.com>
8391
8392         * generics.cs (GenericMethod.ctor): Don't take an Attributes
8393         argument.  Fixes #60441.
8394
8395 2004-06-16  Ben Maurer  <bmaurer@ximian.com>
8396         * ecore.cs (MethodGroupExpr.Name): Revert Martin's patch.
8397         The name needs to have the actual name of the method in order
8398         for other tests (such as the one in OverloadResolve for Invoke
8399         on a delegate) to work. As well, it does not really help
8400         error reporting because the method group had multiple methods.
8401         * Makefile: Remove MCS_DEBUG, you can enable with the DEBUG_FLAGS.
8402         Make profiling work.
8403         
8404 2004-06-13  Martin Baulig  <martin@ximian.com>
8405
8406         * cs-parser.jay: Don't allow generic attributes.
8407
8408 2004-06-13  Martin Baulig  <martin@ximian.com>
8409
8410         * class.cs (MemberBase.DoDefineBase): New protected method.
8411         (MemberBase.DoDefine): Compute the `flags' in the new
8412         DoDefineBase() which must be called first.
8413         (Method.Define): Call DoDefineBase() first so we have the flags
8414         when defining the generic method.
8415
8416         * cs-parser.jay (interface_method_declaration): Support generic methods.
8417
8418 2004-06-13  Martin Baulig  <martin@ximian.com>
8419
8420         * decl.cs (TypeName): Removed.
8421         (MemberName): Removed TypeName and MemberNow; now we just have
8422         MemberName.
8423
8424         * cs-parser.jay: Don't distinguish between type arguments and type
8425         parameters in the grammar and simplified the rules a bit.  The
8426         reduce/reduce conflicts are now gone (except the one we inherited
8427         from mcs).
8428
8429 2004-06-11  Martin Baulig  <martin@ximian.com>
8430
8431         * expression.cs (Invocation.IsParamsMethodApplicable): We need to
8432         call this twice: for params and varargs methods.
8433
8434 2004-06-11  Marek Safar  <marek.safar@seznam.cz>
8435
8436         * class.cs:
8437         (FieldBase.DoDefine, PropertyBase.DoDefine): Added error test CS0610.
8438
8439 2004-06-11  Marek Safar  <marek.safar@seznam.cz>
8440
8441         * attribute.cs (Attribute.GetValidTargets): Made public.
8442
8443         * class.cs: 
8444         (AbstractPropertyEventMethod): New class for better code sharing.
8445         (AbstractPropertyEventMethod.ApplyAttributeBuilder): Add error
8446         CS1667 report.
8447         (PropertyMethod, DelegateMethod): Derived from AbstractPropertyEventMethod
8448
8449 2004-06-09  Martin Baulig  <martin@ximian.com>
8450
8451         * cs-parser.jay: Removed a reduce/reduce conflict.
8452
8453 2004-06-03  Martin Baulig  <martin@ximian.com>
8454
8455         * generic.cs (ConstructedType.GetMemberAccess): Renamed to
8456         GetSimpleName() and return a SimpleName.
8457
8458         * ecore.cs (SimpleName.Arguments): New public field.
8459         (SimpleName): Added overloaded ctor which takes an additional
8460         TypeArguments argument.
8461         (SimpleName.SimpleNameResolve): Added support for generic methods.
8462         (MethodGroupExpr.ResolveGeneric): New public method.  The code was
8463         formerly in MemberAccess.DoResolve(), but we also need it in
8464         SimpleNameResolve().
8465
8466         * expression.cs (MemberAccess.DoResolve): Use the new
8467         MethodGroupExpr.ResolveGeneric().       
8468
8469 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
8470
8471         * decl.cs: If possible, use lookuptypedirect here. We can only do
8472         this if there is no `.' after the namespace. Avoids using
8473         LookupType, which does lots of slow processing.
8474         (FindNestedType) New method, does what it says :-).
8475         * namespace.cs: use LookupTypeDirect.
8476         * rootcontext.cs: use membercache, if possible.
8477         * typemanager.cs (LookupTypeDirect): Cache negative hits too.
8478
8479 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
8480
8481         * expression.cs:
8482         According to the spec, 
8483
8484         In a member access of the form E.I, if E is a single identifier,
8485         and if the meaning of E as a simple-name (§7.5.2) is a constant,
8486         field, property, localvariable, or parameter with the same type as
8487         the meaning of E as a type-name (§3.8), then both possible
8488         meanings of E are permitted.
8489
8490         We did not check that E as a simple-name had the same type as E as
8491         a type name.
8492
8493         This trivial check gives us 5-7% on bootstrap time.
8494
8495 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
8496
8497         * expression.cs (Invocation.OverloadResolve): Avoid the
8498         use of hashtables and boxing here by allocating on demand.
8499
8500 2004-05-30  Martin Baulig  <martin@ximian.com>
8501
8502         * rootcontext.cs (RootContext.LookupType): Don't cache things if
8503         we're doing a silent lookup.  Don't try to lookup nested types in
8504         TypeManager.object_type (thanks to Ben Maurer).
8505
8506 2004-05-30  Martin Baulig  <martin@ximian.com>
8507
8508         Committing a patch from Ben Maurer.
8509
8510         * rootcontext.cs (RootContext.LookupType): Cache negative results.
8511
8512 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
8513
8514         * convert.cs: add a trivial cache for overload operator resolution.
8515
8516 2004-05-31  Marek Safar  <marek.safar@seznam.cz>
8517
8518         * attribute.cs
8519         (AttributeTester.GetObsoleteAttribute): Returns instance of
8520         ObsoleteAttribute when type is obsolete.
8521
8522         * class.cs
8523         (TypeContainer.VerifyObsoleteAttribute): Override.
8524         (Method.GetSignatureForError): New method for usage when MethodBuilder is null.
8525         (MethodCode.VerifyObsoleteAttribute): Override.
8526         (MemberBase.VerifyObsoleteAttribute): Override.
8527
8528         * decl.cs
8529         (MemberCore.CheckUsageOfObsoleteAttribute): Tests presence of ObsoleteAttribute
8530         and report proper error.
8531
8532         *delegate.cs
8533         (Delegate.VerifyObsoleteAttribute): Override.
8534
8535         * ecore.cs
8536         (Expression.CheckObsoleteAttribute): Tests presence of ObsoleteAttribute
8537         and report proper error.
8538         (FieldExpr.DoResolve): Added tests for ObsoleteAttribute.
8539
8540         * enum.cs
8541         (Enum.GetObsoleteAttribute): Returns ObsoleteAttribute for both enum type
8542         and enum member.
8543
8544         * expression.cs
8545         (Probe.DoResolve, Cast.DoResolve, LocalVariableReference.DoResolve,
8546         New.DoResolve, SizeOf.DoResolve, TypeOf.DoResolce, MemberAccess.DoResolve):
8547         Added test for ObsoleteAttribute.
8548
8549         * statement.cs
8550         (Catch): Derived from Statement.
8551
8552 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
8553
8554         * decl.cs: If possible, use lookuptypedirect here. We can only do
8555         this if there is no `.' after the namespace. Avoids using
8556         LookupType, which does lots of slow processing.
8557         (FindNestedType) New method, does what it says :-).
8558         * namespace.cs: use LookupTypeDirect.
8559         * rootcontext.cs: use membercache, if possible.
8560         * typemanager.cs (LookupTypeDirect): Cache negative hits too.
8561
8562 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
8563
8564         * expression.cs:
8565         According to the spec, 
8566
8567         In a member access of the form E.I, if E is a single identifier,
8568         and if the meaning of E as a simple-name (§7.5.2) is a constant,
8569         field, property, localvariable, or parameter with the same type as
8570         the meaning of E as a type-name (§3.8), then both possible
8571         meanings of E are permitted.
8572
8573         We did not check that E as a simple-name had the same type as E as
8574         a type name.
8575
8576         This trivial check gives us 5-7% on bootstrap time.
8577
8578 2004-05-30  Marek Safar  <marek.safar@seznam.cz>
8579
8580         Fixed bug #59071 & cs0160.cs
8581         * statement.cs (Try.Resolve): Check here whether order of catch
8582         clauses matches their dependencies.
8583
8584 2004-05-30  Marek Safar  <marek.safar@seznam.cz>
8585
8586         Fixed bug #58624
8587         * ecore.cs (SimpleName.SimpleNameResolve): Added test for
8588         unsafe type.
8589
8590 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
8591
8592         * expression.cs (Invocation.OverloadResolve): Avoid the
8593         use of hashtables and boxing here by allocating on demand.
8594
8595 2004-05-30  Martin Baulig  <martin@ximian.com>
8596
8597         * rootcontext.cs (RootContext.LookupType): Don't cache things if
8598         we're doing a silent lookup.  Don't try to lookup nested types in
8599         TypeManager.object_type (thanks to Ben Maurer).
8600
8601 2004-05-30  Martin Baulig  <martin@ximian.com>
8602
8603         Committing a patch from Ben Maurer.
8604
8605         * rootcontext.cs (RootContext.LookupType): Cache negative results.      
8606
8607 2004-05-29  Martin Baulig  <martin@ximian.com>
8608
8609         * class.cs (IMethodData.ShouldIgnore): New method.
8610
8611         * typemanager.cs (TypeManager.MethodFlags): Don't take a
8612         `Location' argument, we don't need it anywhere.  Use
8613         `IMethodData.ShouldIgnore ()' instead of
8614         `MethodData.GetMethodFlags ()'.
8615         (TypeManager.AddMethod): Removed.
8616         (TypeManager.AddMethod2): Renamed to AddMethod.
8617
8618 2004-05-29  Martin Baulig  <martin@ximian.com>
8619
8620         Committing a patch from Benjamin Jemlich <pcgod@gmx.net>.
8621
8622         * convert.cs (Convert.ImplicitReferenceConversion): If we're
8623         converting from a class type S to an interface type and we already
8624         have an object on the stack, don't box it again.  Fixes #52578.
8625
8626 2004-05-29  Martin Baulig  <martin@ximian.com>
8627
8628         * class.cs (ConstructorInitializer.GetOverloadedConstructor):
8629         Added support for `params' parameters.  Fixes #59267.
8630
8631 2004-05-29  Martin Baulig  <martin@ximian.com>
8632
8633         * literal.cs (NullPointer): Provide a private .ctor which sets
8634         `type' to TypeManager.object_type.  Fixes #59048.
8635
8636 2004-05-29  Martin Baulig  <martin@ximian.com>
8637
8638         * expression.cs (MemberAccess.ResolveMemberAccess): If we're an
8639         EventExpr, set `ee.InstanceExpression = left'.  Fixes #59188.
8640
8641         * ecore.cs (EventExpr.instance_expr): Make the field private.
8642
8643 2004-05-26  Marek Safar  <marek.safar@seznam.cz>
8644
8645         Fixed bug #50080 & cs0214-2.cs
8646         * expression.cs (Cast.DoResolve): Check unsafe context here.
8647         
8648         * statement.cs (Resolve.DoResolve): Likewise.
8649
8650 2004-05-26  Martin Baulig  <martin@ximian.com>
8651
8652         * namespace.cs (NamespaceEntry.Lookup): Added `bool silent'.
8653
8654         * rootcontext.cs (RootContext.NamespaceLookup): Added `bool silent'.
8655         (RootContext.LookupType): Pass down the `silent' flag.
8656
8657 2004-05-25  Martin Baulig  <martin@ximian.com>
8658
8659         * expression.cs
8660         (MethodGroupExpr.IdenticalTypeName): New public property.
8661         (Invocation.DoResolve): Don't report a CS0176 if the "instance"
8662         expression actually refers to a type.
8663
8664 2004-05-25  Martin Baulig  <martin@ximian.com>
8665
8666         * expression.cs (Invocation.DoResolve): Applied Ben Maurer's patch
8667         for #56176 and made it actually work.
8668
8669 2004-05-25  Martin Baulig  <martin@ximian.com>
8670
8671         * ecore.cs (Expression.CacheTemporaries): Make this virtual.
8672         (FieldExpr, PropertyExpr): Override and implement
8673         CacheTemporaries.  Fixes #52279.
8674
8675 2004-05-25  Miguel de Icaza  <miguel@ximian.com>
8676
8677         * location.cs: In the new compiler listing a file twice is a
8678         warning, not an error.
8679
8680 2004-05-24  Martin Baulig  <martin@ximian.com>
8681
8682         * enum.cs (Enum.DefineType): For the `BaseType' to be a
8683         TypeLookupExpression; otherwise, report a CS1008.  Fixes #58571.
8684
8685 2004-05-24  Martin Baulig  <martin@ximian.com>
8686
8687         * decl.cs (DeclSpace.FindType): Try doing an alias lookup before
8688         walking the `using' list.  Fixes #53921.
8689
8690 2004-05-24  Martin Baulig  <martin@ximian.com>
8691
8692         * const.cs (Const.LookupConstantValue): Added support for
8693         EmptyCast's; fixes #55251.
8694
8695 2004-05-24  Martin Baulig  <martin@ximian.com>
8696
8697         * ecore.cs (SimpleName.SimpleNameResolve): Renamed to
8698         DoSimpleNameResolve() and provide a SimpleNameResolve() wrapper
8699         which does the CS0135 check.  The reason is that we first need to
8700         check whether the variable actually exists.
8701
8702 2004-05-24  Martin Baulig  <martin@ximian.com>
8703
8704         * class.cs (MemberBase.DoDefine): Use DeclSpace.FindType() rather
8705         than RootContext.LookupType() to find the explicit interface
8706         type.  Fixes #58584.
8707
8708 2004-05-24  Raja R Harinath  <rharinath@novell.com>
8709
8710         * Makefile: Simplify.  Use executable.make.
8711         * mcs.exe.sources: New file.  List of sources of mcs.exe.
8712
8713 2004-05-24  Anders Carlsson  <andersca@gnome.org>
8714
8715         * decl.cs:
8716         * enum.cs:
8717         Use the invariant culture when doing String.Compare for CLS case
8718         sensitivity.
8719         
8720 2004-05-23  Martin Baulig  <martin@ximian.com>
8721
8722         * decl.cs (DeclSpace.FindType): Only check the `using' list if we
8723         don't have any dots.  Fixes #52622, added cs0246-8.cs.
8724
8725         * namespace.cs (NamespaceEntry.Lookup): Likewise.
8726
8727 2004-05-23  Marek Safar  <marek.safar@seznam.cz>
8728
8729         * class.cs (MemberBase.Define): Reuse MemberType member for 
8730         resolved type. Other methods can use it too.
8731
8732 2004-05-23  Martin Baulig  <martin@ximian.com>
8733
8734         * ecore.cs (SimpleName.SimpleNameResolve): Only report a CS0135 if
8735         the variable also exists in the current block (otherwise, we need
8736         to report a CS0103).  Fixes #58670.
8737
8738 2004-05-23  Martin Baulig  <martin@ximian.com>
8739
8740         * flowanalysis.cs (Reachability.Reachable): Compute this
8741         on-the-fly rather than storing it as a field.
8742
8743 2004-05-23  Martin Baulig  <martin@ximian.com>
8744
8745         * flowanalysis.cs (Reachability.And): Manually compute the
8746         resulting `barrier' from the reachability.      
8747        
8748 2004-05-23  Marek Safar  <marek.safar@seznam.cz>
8749
8750         Fix bug #57835
8751         * attribute.cs (AttributeTester.GetMethodObsoleteAttribute): Returns
8752         instance of ObsoleteAttribute when symbol is obsolete.
8753
8754         * class.cs
8755         (IMethodData): Extended interface for ObsoleteAttribute support.
8756
8757 2004-05-22  Marek Safar  <marek.safar@seznam.cz>
8758
8759         * attribute.cs: Fix bug #55970
8760
8761 2004-05-22  Marek Safar  <marek.safar@seznam.cz>
8762
8763         Fix bug #52705
8764         * attribute.cs
8765         (GetObsoleteAttribute): New method. Creates the instance of
8766         ObsoleteAttribute.
8767         (AttributeTester.GetMemberObsoleteAttribute): Returns instance of
8768         ObsoleteAttribute when member is obsolete.
8769         (AttributeTester.Report_ObsoleteMessage): Common method for
8770         Obsolete error/warning reporting.
8771
8772         * class.cs
8773         (TypeContainer.base_classs_type): New member for storing parent type.
8774
8775         * decl.cs
8776         (MemberCore.GetObsoleteAttribute): Returns instance of ObsoleteAttribute
8777         for this MemberCore.
8778
8779 2004-05-21  Marek Safar  <marek.safar@seznam.cz>
8780
8781         * attribute.cs, const.cs: Fix bug #58590
8782
8783 2004-05-21  Martin Baulig  <martin@ximian.com>
8784
8785         * flowanalysis.cs (FlowBranching.MergeTopBlock): Don't check for
8786         out parameters if the end of the method is unreachable.  Fixes
8787         #58098. 
8788
8789 2004-05-21  Marek Safar  <marek.safar@seznam.cz>
8790
8791         * codegen.cs, cs-parser.jay: Removed SetAttributes method.
8792         Hari was right, why extra method.
8793
8794 2004-05-21  Marek Safar  <marek.safar@seznam.cz>
8795
8796         * attribute.cs, cs-parser.jay: Fix errors/cs0579-7.cs.
8797
8798 2004-05-20  Martin Baulig  <martin@ximian.com>
8799
8800         * delegate.cs: Convert this file to Unix mode - like the original
8801         version in mcs is.
8802
8803 2004-05-20  Martin Baulig  <martin@ximian.com>
8804
8805         * attribute.cs: Convert this file to Unix mode - like the original
8806         version in mcs is.
8807
8808 2004-05-19  Marek Safar  <marek.safar@seznam.cz>
8809
8810        Fix bug #58688 (MCS does not report error when the same attribute
8811        is assigned twice)
8812
8813        * attribute.cs (Attribute.Emit): Distinction between null and default.
8814
8815 2004-05-19  Raja R Harinath  <rharinath@novell.com>
8816
8817        * cs-parser.jay (attribute): Create a GlobalAttribute for the case
8818        of a top-level attribute without an attribute target.
8819        * attribute.cs (Attribute.Error_AttributeConstructorMismatch): 
8820        Make non-static.
8821        (Attribute.Conditional_GetConditionName), 
8822        (Attribute.Obsolete_GetObsoleteMessage): Update.
8823        (Attribute.IndexerName_GetIndexerName): New.  Attribute-specific
8824        part of ScanForIndexerName.
8825        (Attribute.CanIgnoreInvalidAttribute): New function.
8826        (Attribute.ScanForIndexerName): Move to ...
8827        (Attributes.ScanForIndexerName): ... here.
8828        (Attributes.Attrs): Rename from now-misnamed AttributeSections.
8829        (Attributes.Search): New internal variant that can choose not to
8830        complain if types aren't resolved.  The original signature now
8831        complains.
8832        (Attributes.GetClsCompliantAttribute): Use internal variant, with
8833        complaints suppressed.
8834        (GlobalAttribute.CheckAttributeType): Overwrite ds.NamespaceEntry
8835        only if it not useful.
8836        (CanIgnoreInvalidAttribute): Ignore assembly attribute errors at
8837        top-level for attributes that are shared between the assembly
8838        and a top-level class.
8839        * parameter.cs (ImplicitParameter): Rename from ParameterAtribute.
8840        * class.cs: Update to reflect changes.
8841        (DefineIndexers): Fuse loops.
8842        * codegen.cs (GetAssemblyName): Update to reflect changes.  Accept
8843        a couple more variants of attribute names.
8844
8845 2004-05-18  Marek Safar  <marek.safar@seznam.cz>
8846
8847         Fix bug #52585 (Implemented explicit attribute declaration)
8848
8849         * attribute.cs:
8850         (Attributable.ValidAttributeTargets): New abstract method. It gets
8851         list of valid attribute targets for explicit target declaration.
8852         (Attribute.Target): It holds target itself.
8853         (AttributeSection): Removed.
8854         (Attribute.CheckTargets): New method. It checks whether attribute
8855         target is valid for the current element.
8856
8857         * class.cs:
8858         (EventProperty): New class. For events that are declared like
8859         property (with add and remove accessors).
8860         (EventField): New class. For events that are declared like field.
8861         class.cs
8862
8863         * cs-parser.jay: Implemented explicit attribute target declaration.
8864
8865         * class.cs, decl.cs, delegate.cs, enum.cs, parameter.cs:        
8866         Override ValidAttributeTargets.
8867
8868         * parameter.cs:
8869         (ReturnParameter): Class for applying custom attributes on 
8870         the return type.
8871         (ParameterAtribute): New class. Class for applying custom
8872         attributes on the parameter type.
8873
8874 2004-05-17  Miguel de Icaza  <miguel@ximian.com>
8875
8876         * class.cs (MemberBase.DoDefine): Pass UNSAFE on interface
8877         definitions. 
8878
8879         (Method): Allow UNSAFE here.
8880
8881         * modifiers.cs: Support unsafe reporting.
8882
8883 2004-05-17  Marek Safar  <marek.safar@seznam.cz>
8884
8885         * decl.cs: Fix bug #58478.
8886
8887 2004-05-17  Gonzalo Paniagua Javier <gonzalo@ximian.com>
8888
8889         * statement.cs: When checking for unreachable code on an EmptyStatement,
8890         set the location. Fixes bug #58488.
8891
8892 2004-05-13  Miguel de Icaza  <miguel@ximian.com>
8893
8894         * driver.cs: Add -pkg handling.
8895
8896         From Gonzalo: UseShelLExecute=false
8897
8898 2004-05-12  Marek Safar  <marek.safar@seznam.cz>
8899
8900         * attribute.cs:
8901         (Attribute.GetAttributeTargets): New method. Gets AttributeTargets
8902         for attribute.
8903         (Attribute.IsClsCompliaceRequired): Moved to base for better
8904         accesibility.
8905         (Attribute.UsageAttribute): New property for AttributeUsageAttribute
8906         when attribute is AttributeUsageAttribute.
8907         (Attribute.GetValidTargets): Simplified.
8908         (Attribute.GetAttributeUsage): New method returns AttributeUsage
8909         attribute for this type.
8910         (Attribute.ApplyAttributes): Method renamed to Emit and make
8911         non-static.
8912         (GlobalAttributeSection): New class for special handling of global
8913         attributes (assembly, module).
8914         (AttributeSection.Emit): New method.
8915
8916         * class.cs: Implemented Attributable abstract methods.
8917         (MethodCore.LabelParameters): Moved to Parameter class.
8918         (Accessor): Is back simple class.
8919         (PropertyMethod): Implemented Attributable abstract class.
8920         (DelegateMethod): Implemented Attributable abstract class.
8921         (Event): New constructor for disctintion between normal Event
8922         and Event with accessors.
8923
8924         * cs-parser.jay: Used new Event ctor and GlobalAttributeSection.
8925
8926         * codegen.cs, const.cs, decl.cs, delegate.cs:
8927         (CommonAssemblyModulClass): Implemented Attributable abstract class
8928         and simplified.
8929
8930         * enum.cs: Implement IAttributeSupport interface.
8931         (EnumMember): New class for emum members. Implemented Attributable
8932         abstract class
8933
8934         * parameter.cs:
8935         (ParameterBase): Is abstract.
8936         (ReturnParameter): New class for easier [return:] attribute handling.
8937
8938         * typemanager.cs: Removed builder_to_attr.
8939
8940 2004-05-11  Raja R Harinath  <rharinath@novell.com>
8941
8942         Fix bug #57151.
8943         * attribute.cs (Attribute.GetPositionalValue): New function.
8944         * class.cs (TypeContainer.VerifyMembers): New function.
8945         (TypeContainer.Emit): Use it.
8946         (ClassOrStruct): New base class for Class and Struct.
8947         (ClassOrStruct.ApplyAttributeBuilder): New function.  Note if 
8948         StructLayout(LayoutKind.Explicit) was ascribed to the struct or
8949         class.
8950         (ClassOrStruct.VerifyMembers): If the struct is explicitly laid out,
8951         then each non-static field should have a FieldOffset attribute.
8952         Otherwise, none of the fields should have a FieldOffset attribute.
8953         * rootcontext.cs (RootContext.ResolveCore): Resolve StructLayout 
8954         and FieldOffset attributes.
8955         * typemanager.cs (TypeManager.struct_layout_attribute_type)
8956         (TypeManager.field_offset_attribute_type): New core types.
8957         (TypeManager.InitCoreTypes): Initialize them.
8958
8959 2004-05-11  Michal Moskal  <malekith@pld-linux.org>
8960
8961         * class.cs (Event.RemoveDelegateMethod.DelegateMethodInfo):
8962         Return correct type.
8963         From bug #58270.
8964
8965 2004-05-09  Miguel de Icaza  <miguel@ximian.com>
8966
8967         * expression.cs (Binary.DoNumericPromotions): 0 long constant can
8968         be implicitly converted to ulong.
8969         
8970         * expression.cs: The logic for allowing operator &, | and ^ worked
8971         was wrong, it worked before because we did not report an error in
8972         an else branch.  Fixes 57895.
8973
8974         * class.cs: Applied patch from iain@mccoy.id.au Iain McCoy to
8975         allow volatile fields to be reference types.
8976
8977 2004-05-07  Miguel de Icaza  <miguel@ximian.com>
8978
8979         * driver.cs: Add support for /debug-
8980
8981 2004-05-07  Raja R Harinath  <rharinath@novell.com>
8982
8983         * attribute.cs (Attribute.CheckAttributeType, Attribute.ResolveType): 
8984         Add a 'complain' parameter to silence errors.
8985         (Attribute.Resolve): Update to changes.  Put in sanity check to catch
8986         silently overlooked type-resolutions.
8987         (Attribute.ScanForIndexerName, Attribute.DefinePInvokeMethod): Update
8988         to reflect changes.
8989         (Attributes.Search): New function.
8990         (Attributes.Contains, Attributes.GetClsCompliantAttribute): Use Search.
8991         (Attributes.GetAttributeFullName): Remove hack.
8992         * class.cs (MethodCore.LabelParameters, MethodData.ApplyAttributes): 
8993         Update to reflect changes.
8994         * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
8995         Use Attributes.Search instead of nested loops.
8996
8997 2004-05-07  Marek Safar  <marek.safar@seznam.cz>
8998
8999         * decl.cs:
9000         (MemberCore.Flags): Extended for caching presence of CLSCompliantAttribute.
9001         (MemberCore.VerifyClsCompliance): Implemented CS3019 error report.
9002         (DeclSpace.GetClsCompliantAttributeValue): Returns simple bool.
9003
9004         * report.cs: (Report.Warning): Renamed to Warning_T because of
9005         parameter collision.
9006
9007 2004-05-05  Raja R Harinath  <rharinath@novell.com>
9008
9009         * expression.cs (MemberAccess.ResolveMemberAccess):
9010         Exit with non-zero status after Report.Error.
9011         * rootcontext.cs (RootContext.BootstrapCorlib_ResolveDelegate):
9012         Likewise.
9013         * typemanager.cs (TypeManager.CoreLookupType): Likewise.
9014
9015 2004-05-04  Lluis Sanchez Gual  <lluis@ximian.com>
9016
9017         * support.cs: Don't hang when the file is empty.
9018
9019 2004-05-04  Lluis Sanchez Gual  <lluis@ximian.com>
9020
9021         * support.cs: In SeekableStreamReader, compute the preamble size of the
9022           underlying stream. Position changes should take into account that initial
9023           count of bytes.
9024
9025 2004-05-03  Todd Berman  <tberman@sevenl.net>
9026
9027         * driver.cs: remove unused GetSysVersion function.
9028
9029 2004-05-03  Todd Berman  <tberman@sevenl.net>
9030
9031         * driver.cs: Remove the hack from saturday, as well as the hack
9032         from jackson (LoadAssemblyFromGac), also adds the CWD to the
9033         link_paths to get that bit proper.
9034
9035 2004-05-01  Todd Berman  <tberman@sevenl.net>
9036
9037         * driver.cs: Try a LoadFrom before a Load, this checks the current
9038         path. This is currently a bug in mono that is be fixed, however, this
9039         provides a workaround for now. This will be removed when the bug
9040         is fixed.
9041
9042 2004-05-01  Sebastien Pouliot  <sebastien@ximian.com>
9043
9044         * CryptoConvert.cs: Updated to latest version. Fix issue with 
9045         incomplete key pairs (#57941).
9046
9047 2004-05-01  Todd Berman  <tberman@sevenl.net>
9048
9049         * driver.cs: Remove '.' from path_chars, now System.* loads properly
9050         from the GAC
9051
9052 2004-04-30  Jackson Harper  <jackson@ximian.com>
9053
9054         * codegen.cs: Open keys readonly.
9055         
9056 2004-04-30  Gonzalo Paniagua Javier <gonzalo@ximian.com>
9057
9058         * typemanager.cs: don't report cyclic struct layout when a struct
9059         contains 2 or more fields of the same type. Failed for Pango.AttrShape
9060         which has 2 Pango.Rectangle fields.
9061
9062 2004-04-29 Ben Maurer  <bmaurer@users.sourceforge.net>
9063
9064         * expression.cs: Handle IntPtr comparisons with IL code
9065         rather than a method call.
9066
9067 2004-04-29  Martin Baulig  <martin@ximian.com>
9068
9069         * ecore.cs (PropertyExpr.FindAccessor): New private method.  Walk
9070         the list of PropertyInfo's in class hierarchy and find the
9071         accessor.  Fixes #56013.
9072
9073 2004-04-29  Martin Baulig  <martin@ximian.com>
9074
9075         * typemanager.cs (TypeManager.CheckStructCycles): Fixed.
9076
9077 2004-04-29  Martin Baulig  <martin@ximian.com>
9078
9079         Applying a patch from Benjamin Jemlich <pcgod@gmx.net>.
9080
9081         * ecore.cs (FieldExpr.AddressOf): Make this work for valuetypes.
9082
9083 2004-04-29  Martin Baulig  <martin@ximian.com>
9084
9085         * class.cs (ConstructorInitializer.Resolve): Check whether the
9086         parent .ctor is accessible.  Fixes #52146.
9087
9088 2004-04-29  Martin Baulig  <martin@ximian.com>
9089
9090         Applying a patch from Benjamin Jemlich <pcgod@gmx.net>.
9091
9092         * statement.cs (Using.EmitLocalVariableDecls): Use
9093         TypeManager.idisposable_type, not typeof (IDisposable).
9094         (Foreach.EmitCollectionForeach): Added support for valuetypes.
9095
9096 2004-04-29  Martin Baulig  <martin@ximian.com>
9097
9098         * class.cs (Event.Define): Don't emit the field and don't set
9099         RTSpecialName and SpecialName for events on interfaces.  Fixes
9100         #57703. 
9101
9102 2004-04-29  Raja R Harinath  <rharinath@novell.com>
9103
9104         Refactor Attribute.ApplyAttributes.
9105         * attribute.cs (Attributable): New base class for objects that can
9106         have Attributes applied on them.
9107         (Attribute): Make AttributeUsage fields public.
9108         (Attribute.GetFieldValue, Attribute.GetMarshal): Make non-static.
9109         (Attribute.IsInternalCall): New property.
9110         (Attribute.UsageAttr): Convert to a public read-only property.
9111         (Attribute.CheckAttributeType): Use a DeclSpace, not an EmitContext.
9112         (Attribute.ResolveType, Attribute.Resolve)
9113         (Attribute.ScanForIndexerName): Update to reflect changes.
9114         (Attribute.CheckAttributeTarget): Re-format.
9115         (Attribute.ApplyAttributes): Refactor, to various
9116         Attributable.ApplyAttributeBuilder methods.
9117         * decl.cs (MemberCore): Make Attributable.
9118         * class.cs (Accessor): Make Attributable.
9119         (MethodData.ApplyAttributes): Use proper attribute types, not
9120         attribute names.
9121         (TypeContainer.LabelParameters): Pass Parameter to ApplyAttributes.
9122         (TypeContainer.ApplyAttributeBuilder)
9123         (Method.ApplyAttributeBuilder, Constructor.ApplyAttributeBuilder)
9124         (Field.ApplyAttributeBuilder, Accessor.ApplyAttributeBuilder)   
9125         (PropertyBase.ApplyAttributeBuilder, Event.ApplyAttributeBuilder)
9126         (Operator.ApplyAttributeBuilder): New factored-out methods.
9127         * const.cs (Const.ApplyAttributeBuilder): Likewise.
9128         * delegate.cs (Delegate.ApplyAttributeBuilder): Likewise.
9129         * enum.cs (Enum.ApplyAttributeBuilder): Likewise.
9130         * parameter.cs (ParameterBase): New Attributable base class
9131         that can also represent Return types.
9132         (Parameter): Update to the changes.
9133
9134 2004-04-29  Jackson Harper  <jackson@ximian.com>
9135
9136         * driver.cs: Prefer the corlib system version when looking for
9137         assemblies in the GAC. This is still a hack, but its a better hack
9138         now.
9139         
9140 2004-04-29  Marek Safar  <marek.safar@seznam.cz>
9141
9142         * decl.cs, enum.cs: Improved error 3005 reporting.
9143   
9144         * report.cs (SymbolRelatedToPreviousError): New method for error reporting.
9145         (related_symbols): New private member for list of symbols
9146         related to reported error/warning.
9147         
9148         * tree.cs: Do not use now obsolete Report.LocationOfPreviousError.
9149
9150 2004-04-29  Martin Baulig  <martin@ximian.com>
9151
9152         * ecore.cs (Expression.Constantify): If we're an enum and
9153         TypeManager.TypeToCoreType() doesn't give us another type, use
9154         t.UnderlyingSystemType.  Fixes #56178.  
9155
9156 2004-04-29  Martin Baulig  <martin@ximian.com>
9157
9158         * decl.cs (MemberCache.SetupCacheForInterface): Look over all our
9159         interfaces and for each interface, only add members directly
9160         declared in that interface.  Fixes #53255.
9161
9162 2004-04-28  Martin Baulig  <martin@ximian.com>
9163
9164         * expression.cs (ConditionalLogicalOperator): Use a temporary
9165         variable for `left' to avoid that we evaluate it more than once;
9166         bug #52588.
9167
9168 2004-04-28  Martin Baulig  <martin@ximian.com>
9169
9170         * expression.cs (ComposedCast.DoResolveAsTypeStep): Don't allow
9171         `void[]' (CS1547).
9172
9173 2004-04-28  Martin Baulig  <martin@ximian.com>
9174
9175         * statement.cs (LocalInfo.Resolve): Check whether the type is not
9176         void (CS1547).
9177
9178         * class.cs (MemberBase.CheckParameters, FieldBase.DoDefine): Check
9179         whether the type is not void (CS1547).
9180
9181 2004-04-28  Martin Baulig  <martin@ximian.com>
9182
9183         * expression.cs (Unary.DoResolveLValue): Override this and report
9184         CS0131 for anything but Operator.Indirection.
9185
9186 2004-04-28  Martin Baulig  <martin@ximian.com>
9187
9188         Committing a patch from Ben Maurer; see bug #50820.
9189
9190         * typemanager.cs (TypeManager.FilterWithClosure): Added CS1540
9191         check for classes.
9192
9193         * ecore.cs (Expression.MemberLookupFailed): Added CS1540 check for
9194         classes.        
9195
9196 2004-04-28  Martin Baulig  <martin@ximian.com>
9197
9198         Committing a patch from Ben Maurer; see bug #50820.
9199
9200         * typemanager.cs (TypeManager.FilterWithClosure): Added CS1540
9201         check for classes.
9202
9203         * ecore.cs (Expression.MemberLookupFailed): Added CS1540 check for
9204         classes.        
9205
9206 2004-04-28  Martin Baulig  <martin@ximian.com>
9207
9208         * statement.cs (Block.LookupLabel): Also lookup in implicit child blocks.
9209         (Block.AddLabel): Call DoLookupLabel() to only search in the
9210         current block.
9211
9212 2004-04-28  Martin Baulig  <martin@ximian.com>
9213
9214         * cfold.cs (ConstantFold.BinaryFold): Added special support for
9215         comparing StringConstants and NullLiterals in Equality and Inequality.
9216
9217 2004-04-28  Jackson Harper  <jackson@ximian.com>
9218
9219         * driver.cs: Attempt to load referenced assemblies from the
9220         GAC. This is the quick and dirty version of this method that
9221         doesnt take into account versions and just takes the first
9222         canidate found. Will be good enough for now as we will not have more
9223         then one version installed into the GAC until I update this method.
9224
9225 2004-04-28  Martin Baulig  <martin@ximian.com>
9226
9227         * typemanager.cs (TypeManager.CheckStructCycles): New public
9228         static method to check for cycles in the struct layout.
9229
9230         * rootcontext.cs (RootContext.PopulateTypes): Call
9231         TypeManager.CheckStructCycles() for each TypeContainer.
9232         [Note: We only need to visit each type once.]
9233
9234 2004-04-28  Martin Baulig  <martin@ximian.com>
9235
9236         * constant.cs (StringConstant.Emit): Emit Ldnull if we're null.
9237
9238         * const.cs (Const.LookupConstantValue): Return a `bool' signalling
9239         success and added `out object value'.  Use a `bool resolved' field
9240         to check whether we've already been called rather than
9241         `ConstantValue != null' since this breaks for NullLiterals.
9242
9243 2004-04-28  Raja R Harinath  <rharinath@novell.com>
9244
9245         * driver.cs (Driver.MainDriver) [IsModuleOnly]: Open code the
9246         setting of this flag, since the 'set' method may be non-public.
9247
9248 2004-04-28  Raja R Harinath  <rharinath@novell.com>
9249
9250         * flowanalysis.cs (FlowBranchingException.LookupLabel): Add a null
9251         check on current_vector.Block.
9252
9253 2004-04-27  Martin Baulig  <martin@ximian.com>
9254
9255         * expression.cs (BaseAccess.CommonResolve): Don't allow `base' in
9256         a field initializer.  Fixes #56459.
9257
9258 2004-04-27  Martin Baulig  <martin@ximian.com>
9259
9260         * ecore.cs (PropertyExpr.DoResolve/DoResolveLValue): Check whether
9261         we're not attempting to use an indexer.  Fixes #52154.
9262
9263 2004-04-27  Martin Baulig  <martin@ximian.com>
9264
9265         * statement.cs (Return): Don't create a return label if we don't
9266         need it; reverts my change from January 20th.  Thanks to Ben
9267         Maurer for this.
9268
9269 2004-04-27  Martin Baulig  <martin@ximian.com>
9270
9271         According to the spec, `goto' can only leave a nested scope, but
9272         never enter it.
9273
9274         * statement.cs (Block.LookupLabel): Only lookup in the current
9275         block, don't recurse into parent or child blocks.
9276         (Block.AddLabel): Check in parent and child blocks, report
9277         CS0140/CS0158 if we find a duplicate.
9278         (Block): Removed this indexer for label lookups.
9279         (Goto.Resolve): Call LookupLabel() on our current FlowBranching;
9280         this already does the error reporting for us.
9281
9282         * flowanalysis.cs
9283         (FlowBranching.UsageVector.Block): New public variable; may be null.
9284         (FlowBranching.CreateSibling): Added `Block' argument.
9285         (FlowBranching.LookupLabel): New public virtual method.  Lookup a
9286         label for the target of a `goto' and check whether we're not
9287         leaving a `finally'.
9288
9289 2004-04-27  Martin Baulig  <martin@ximian.com>
9290
9291         * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
9292         a finite loop block, also do the ALWAYS->SOMETIMES for throws (not
9293         just for returns).
9294
9295 2004-04-27  Martin Baulig  <martin@ximian.com>
9296
9297         * statement.cs (Block.AddLabel): Also check for implicit blocks
9298         and added a CS0158 check.
9299
9300 2004-04-27  Martin Baulig  <martin@ximian.com>
9301
9302         * flowanalysis.cs (FlowBranchingLoop): New class.
9303         (FlowBranching.UsageVector.MergeJumpOrigins): Take a list of
9304         UsageVector's instead of an ArrayList.
9305         (FlowBranching.Label): Likewise.
9306         (FlowBranching.UsageVector.MergeBreakOrigins): New method.
9307         (FlowBranching.AddBreakVector): New method.
9308
9309 2004-04-27  Miguel de Icaza  <miguel@ximian.com>
9310
9311         * attribute.cs: Small regression fix: only convert the type if we
9312         the type is different, fixes System.Drawing build.
9313
9314 2004-04-27  Martin Baulig  <martin@ximian.com>
9315
9316         * attribute.cs (Attribute.Resolve): If we have a constant value
9317         for a named field or property, implicity convert it to the correct
9318         type.
9319
9320 2004-04-27  Raja R Harinath  <rharinath@novell.com>
9321
9322         * statement.cs (Block.Block): Implicit blocks share
9323         'child_variable_names' fields with parent blocks.
9324         (Block.AddChildVariableNames): Remove.
9325         (Block.AddVariable): Mark variable as "used by a child block" in
9326         every surrounding block.
9327         * ecore.cs (SimpleName.SimpleNameResolve): If the name has already
9328         been used in a child block, complain about violation of "Invariant
9329         meaning in blocks" rule.
9330         * cs-parser.jay (declare_local_variables): Don't use
9331         AddChildVariableNames.
9332         (foreach_statement): Don't create an implicit block: 'foreach'
9333         introduces a scope.
9334
9335 2004-04-23  Miguel de Icaza  <miguel@ximian.com>
9336
9337         * convert.cs (ImplicitNumericConversion): 0 is also positive when
9338         converting from 0L to ulong.  Fixes 57522.
9339
9340 2004-04-22  Marek Safar  <marek.safar@seznam.cz>
9341
9342         * decl.cs (FindMemberToOverride): Fix wrong warning for case when
9343         derived class hides via 'new' keyword field from base class (test-242.cs).
9344         TODO: Handle this in the more general way.
9345         
9346         * class.cs (CheckBase): Ditto.
9347
9348 2004-04-22  Marek Safar  <marek.safar@seznam.cz>
9349
9350         * decl.cs (caching_flags): New member for storing cached values
9351         as bit flags.
9352         (MemberCore.Flags): New enum where bit flags for caching_flags
9353         are defined.
9354         (MemberCore.cls_compliance): Moved to caching_flags.
9355         (DeclSpace.Created): Moved to caching_flags.
9356
9357         * class.cs: Use caching_flags instead of DeclSpace.Created
9358         
9359 2004-04-21  Miguel de Icaza  <miguel@ximian.com>
9360
9361         * ecore.cs (PropertyExpr.GetAccesor): Only perform the 1540 check
9362         if we are only a derived class, not a nested class.
9363
9364         * typemanager.cs: Same as above, but do this at the MemberLookup
9365         level (used by field and methods, properties are handled in
9366         PropertyExpr).   Allow for the qualified access if we are a nested
9367         method. 
9368
9369 2004-04-21  Marek Safar  <marek.safar@seznam.cz>
9370
9371         * class.cs: Refactoring.
9372         (IMethodData): New inteface; Holds links to parent members
9373         to avoid member duplication (reduced memory allocation).
9374         (Method): Implemented IMethodData interface.
9375         (PropertyBase): New inner classes for get/set methods.
9376         (PropertyBase.PropertyMethod): Implemented IMethodData interface
9377         (Event): New inner classes for add/remove methods.
9378         (Event.DelegateMethod): Implemented IMethodData interface.
9379
9380         * cs-parser.jay: Pass DeclSpace to Event class for creation of valid
9381         EmitContext (related to class.cs refactoring).
9382
9383 2004-04-21  Raja R Harinath  <rharinath@novell.com>
9384
9385         * delegate.cs (Delegate.VerifyApplicability): If the number of
9386         arguments are the same as the number of parameters, first try to
9387         verify applicability ignoring  any 'params' modifier on the last
9388         parameter.
9389         Fixes #56442.
9390
9391 2004-04-08  Martin Baulig  <martin@ximian.com>
9392
9393         Merged latest changes into gmcs.  Please keep this comment in
9394         here, it makes it easier for me to see what changed in MCS since
9395         the last time I merged.
9396
9397 2004-04-16  Raja R Harinath  <rharinath@novell.com>
9398
9399         * class.cs (TypeContainer.AddIndexer): Use
9400         'ExplicitInterfaceName' to determine if interface name was
9401         explicitly specified.  'InterfaceType' is not initialized at this time.
9402         (TypeContainer.DefineIndexers): Remove use of temporary list.  The
9403         Indexers array is already in the required order.  Initialize
9404         'IndexerName' only if there are normal indexers.
9405         (TypeContainer.DoDefineMembers): Don't initialize IndexerName.
9406         (TypeContainer.Emit): Emit DefaultMember attribute only if
9407         IndexerName is initialized.
9408         Fixes #56300.
9409
9410 2004-04-15  Benjamin Jemlich  <pcgod@gmx.net>
9411
9412         * enum.cs (Enum.DefineType): Don't allow char as type for enum.
9413         Fixes #57007
9414
9415 2004-04-15  Raja R Harinath  <rharinath@novell.com>
9416
9417         * attribute.cs (Attribute.CheckAttributeType): Check for ambiguous
9418         attributes.
9419         Fix for #56456.
9420
9421         * attribute.cs (Attribute.Resolve): Check for duplicate named
9422         attributes.
9423         Fix for #56463.
9424
9425 2004-04-15  Miguel de Icaza  <miguel@ximian.com>
9426
9427         * iterators.cs (MarkYield): track whether we are in an exception,
9428         and generate code accordingly.  Use a temporary value to store the
9429         result for our state.
9430
9431         I had ignored a bit the interaction of try/catch with iterators
9432         since their behavior was not entirely obvious, but now it is
9433         possible to verify that our behavior is the same as MS .NET 2.0
9434
9435         Fixes 54814
9436
9437 2004-04-14  Miguel de Icaza  <miguel@ximian.com>
9438
9439         * iterators.cs: Avoid creating temporaries if there is no work to
9440         do. 
9441
9442         * expression.cs (ArrayAccess.EmitLoadOpcode): If dealing with
9443         Enumerations, use TypeManager.EnumToUnderlying and call
9444         recursively. 
9445
9446         Based on the patch from Benjamin Jemlich (pcgod@gmx.net), fixes
9447         bug #57013
9448
9449         (This.Emit): Use EmitContext.EmitThis to emit our
9450         instance variable.
9451
9452         (This.EmitAssign): Ditto.
9453
9454         * ecore.cs (FieldExpr.Emit): Remove RemapToProxy special
9455         codepaths, we will move all the functionality into
9456         Mono.CSharp.This 
9457
9458         (FieldExpr.EmitAssign): Ditto.
9459
9460         This fixes several hidden bugs that I uncovered while doing a code
9461         review of this today.
9462
9463         * codegen.cs (EmitThis): reworked so the semantics are more clear
9464         and also support value types "this" instances.
9465
9466         * iterators.cs: Changed so that for iterators in value types, we
9467         do not pass the value type as a parameter.  
9468
9469         Initialization of the enumerator helpers is now done in the caller
9470         instead of passing the parameters to the constructors and having
9471         the constructor set the fields.
9472
9473         The fields have now `assembly' visibility instead of private.
9474
9475 2004-04-11  Miguel de Icaza  <miguel@ximian.com>
9476
9477         * expression.cs (Argument.Resolve): Check if fields passed as ref
9478         or out are contained in a MarshalByRefObject.
9479
9480         * typemanager.cs, rootcontext.cs: Add System.Marshalbyrefobject as
9481         another compiler type.
9482
9483 2004-04-06 Ben Maurer  <bmaurer@users.sourceforge.net>
9484
9485         * class.cs (Indexer.Define): use the new name checking method.
9486         Also, return false on an error.
9487         * cs-tokenizer.cs (IsValidIdentifier): Checks for a valid identifier.
9488         (is_identifier_[start/part]_character): make static.
9489
9490 2004-04-10  Miguel de Icaza  <miguel@ximian.com>
9491
9492         * expression.cs (Binary.ResolveOperator): Do no append strings
9493         twice: since we can be invoked more than once (array evaluation)
9494         on the same concatenation, take care of this here.  Based on a fix
9495         from Ben (bug #56454)
9496
9497 2004-04-08  Sebastien Pouliot  <sebastien@ximian.com>
9498
9499         * codegen.cs: Fix another case where CS1548 must be reported (when 
9500         delay-sign isn't specified and no private is available #56564). Fix
9501         loading the ECMA "key" to delay-sign an assembly. Report a CS1548 
9502         error when MCS is used on the MS runtime and we need to delay-sign 
9503         (which seems unsupported by AssemblyBuilder - see #56621).
9504
9505 2004-04-08  Marek Safar  <marek.safar@seznam.cz>
9506
9507         * typemanager.cs (TypeManager.TypeToCoreType): Handle IntPtr too.
9508         (TypeManager.ComputeNamespaces): Faster implementation for
9509         Microsoft runtime.
9510
9511         * compiler.csproj: Updated AssemblyName to mcs.
9512
9513 2004-05-11  Jackson Harper  <jackson@ximian.com>
9514
9515         * Makefile: Preserve MONO_PATH
9516         
9517 2004-05-11  Jackson Harper  <jackson@ximian.com>
9518
9519         * Makefile: Use mono and mcs to build gmcs
9520         
9521 2004-05-03  Miguel de Icaza  <miguel@ximian.com>
9522
9523         * codegen.cs: Add patch from Robert Shade
9524         <rshade@dvsconsulting.com>, use FileAccess.Read on the keyfile, to
9525         sync with mcs.
9526
9527 2004-05-02  Sebastien Pouliot  <sebastien@ximian.com>
9528
9529         * CryptoConvert.cs: Updated to latest version. Fix issue with 
9530         incomplete key pairs (#57941).
9531
9532 2004-04-08  Sebastien Pouliot  <sebastien@ximian.com>
9533
9534         * codegen.cs: Fix another case where CS1548 must be reported (when 
9535         delay-sign isn't specified and no private is available #56564). Fix
9536         loading the ECMA "key" to delay-sign an assembly. Report a CS1548 
9537         error when MCS is used on the MS runtime and we need to delay-sign 
9538         (which seems unsupported by AssemblyBuilder - see #56621).
9539
9540 2004-04-29  Jackson Harper  <jackson@ximian.com>
9541
9542         * Makefile: Set MONO_PATH to use the bootstrap corlib
9543         * driver.cs: Check the GAC for referenced assemblies.
9544                 
9545 2004-04-29  Martin Baulig  <martin@ximian.com>
9546
9547         * Makefile (gmcs.exe): Set MONO_PATH to use `../class/lib/net_2_0'.
9548
9549 2004-04-07  Martin Baulig  <martin@ximian.com>
9550
9551         * expression.cs (Binary.ResolveOperator): Added special case for
9552         Equality/Inequality between a type parameter and a null literal.
9553
9554 2004-04-07  Martin Baulig  <martin@ximian.com>
9555
9556         * convert.cs: Check null literal -> type parameter conversions.
9557
9558 2004-04-07  Martin Baulig  <martin@ximian.com>
9559
9560         * generic.cs (ConstructedType.CheckConstraints): Enforce the
9561         `class' and `struct' constraints.
9562
9563 2004-04-07  Martin Baulig  <martin@ximian.com>
9564
9565         * generic.cs (SpecialConstraint): New public enum.
9566         (Constraints.Resolve): Added support for the `class' and `struct'
9567         constraints.
9568
9569         * cs-parser.jay (type_parameter_constraint): Added support for the
9570         `class' and `struct' constraints.
9571
9572 2004-04-07  Martin Baulig  <martin@ximian.com>
9573
9574         * support.cs (GenericConstraints): Replaced `Types' by
9575         `ClassConstraint' and `InterfaceConstraints'; added
9576         `HasClassConstraint'.   
9577
9578 2004-04-07  Martin Baulig  <martin@ximian.com>
9579
9580         * generic.cs
9581         (Constraints.InterfaceConstraints): New public property.
9582         (Constraints.Types): Make this property public
9583         (TypeParameter): Implement IMemberContainer.
9584         (TypeParameter.Define): Take a `GenericTypeParameterBuilder'
9585         instead of a TypeBuilder/MethodBuilder; pass the interface
9586         constraints to TypeManager.AddTypeParameter().
9587         (TypeParameter.DefineType): Just take an EmitContext and no
9588         TypeBuilder/MethodBuilder.  Use the new public API.
9589
9590         * typemanager.cs (TypeManager.AddTypeParameter): Added
9591         `TypeExpr[]' argument; add the interfaces to the
9592         `builder_to_ifaces' hash.
9593         (TypeManager.LookupMemberContainer): For
9594         GenericTypeParameterBuilders, get the TypeParameter from the
9595         `builder_to_type_param'.
9596         (TypeManager.FindMembers): For GenericTypeParameterBuilders, get
9597         the TypeParameter and call FindMembers on it.
9598
9599 2004-04-07  Martin Baulig  <martin@ximian.com>
9600
9601         * class.cs
9602         (MethodCore.GenericMethod): Moved this field here from Method.
9603         (MethodCore.IsDuplicateImplementation): Take the number of type
9604         parameters into account if we're a generic method.
9605
9606         * expression.cs (Invocation.InferTypeArguments): Don't return true
9607         if `arguments' is null; we still need to check whether we actually
9608         don't need to infer anything in this case.
9609         (MemberAccess): Merged the functionality from GenericMemberAccess
9610         into this class.
9611
9612         * generic.cs (GenericMemberAccess): Removed.
9613
9614 2004-04-05  Martin Baulig  <martin@ximian.com>
9615
9616         * decl.cs (MemberCore): For generic classes, interfaces and
9617         structs, `Name' now includes the number of type parameters
9618         ("Stack!1.Node!1").
9619         (DeclSpace.FindType): Removed the `num_type_args' argument; we now
9620         encode the number of type arguments in the type name.
9621
9622         * expression.cs (Expression.MemberLookup): Removed the
9623         `num_type_args' argument; we now encode the number of type
9624         arguments in the type name.
9625
9626         * ecore.cs (SimpleName): Encode the number of type arguments in
9627         the type name itself.
9628
9629         * generic.cs (ConstructedType): Likewise.
9630
9631         * tree.cs (Tree.RecordDecl): Take a `string' instead of a
9632         `MemberName'; we now include the number of type parameters in the
9633         type name.
9634
9635         * typemanager.cs (TypeManager.CheckGeneric): Removed.
9636         (TypeManager.MemberLookup): Removed the
9637         `num_type_args' argument; we now encode the number of type
9638         arguments in the type name.     
9639
9640 2004-04-03  Martin Baulig  <martin@ximian.com>
9641
9642         * decl.cs (MemberCore.ctor): Take a MemberName instead of a sting.
9643         (MemberCore.MemberName): Moved here from MemberBase.
9644         (DeclSpace.SetParameterInfo): Just take the constraints as an
9645         ArrayList; we already have the type parameters in our
9646         `MemberName'; also do the CS0080 reporting here.
9647
9648         * cs-parser.jay (struct_declaration): Use `member_name' instead of
9649         `IDENTIFIER opt_type_parameter_list'; when constructing our
9650         `MemberName', it'll already include our type parameters.
9651         (class_declaration, interface_declaration): Likewise.
9652         (delegate_declaration): Likewise.
9653         (MakeName): Take a MemberName and return a MemberName.
9654         The following two changes are required to avoid shift/reduce conflicts:
9655         (member_name): Don't include a TypeName anymore; ie. this is now
9656         just 'IDENTIFIER opt_type_parameter_list'.
9657         (property_declaration, event_declaration): Use a
9658         `namespace_or_type_name' instead of a `member_name'.            
9659
9660 2004-04-03  Martin Baulig  <martin@ximian.com>
9661
9662         * decl.cs (MemberName): Renamed to `TypeName' and created a new
9663         `MemberName' class.
9664         (TypeName): Formerly known as MemberName.
9665
9666         * namespace.cs (NamespaceEntry.UsingAlias): Take a `TypeName'
9667         instead of a `MemberName'.
9668
9669         * cs-parser.jay (namespace_or_type_name): Create a TypeName.
9670         (member_name): New rule; create a MemberName.
9671
9672 2004-04-02  Martin Baulig  <martin@ximian.com>
9673
9674         * namespace.cs (NamespaceEntry.VerifyUsing): Added error checking
9675         (CS0305 and CS0308).
9676
9677 2004-04-02  Martin Baulig  <martin@ximian.com>
9678
9679         * generic.cs (GenericMemberAccess.ResolveAsTypeStep): Added
9680         support for nested types.
9681
9682 2004-04-02  Martin Baulig  <martin@ximian.com>
9683
9684         * ecore.cs (IAlias): New public interface.
9685         (TypeExpr, TypeExpression): Implement IAlias.
9686         (TypeAliasExpression): New public class.
9687
9688         * namespace.cs (Namespace): Implement IAlias.
9689         (Namespace.Lookup): Return an IAlias instead on an object.
9690         (Namespace.DefineName): Take an IAlias instead of an object.
9691         (NamespaceEntry.AliasEntry.Resolve): Return an IAlias instead of
9692         an object.
9693         (NamespaceEntry.UsingAlias): Take a Membername instead of an
9694         Expression.
9695         (NamespaceEntry.LookupAlias): Return an IAlias instead on an
9696         object.
9697         (NamespaceEntry.Lookup): Likewise.
9698
9699         * rootcontext.cs (RootContext.LookupType): Return a TypeExpr
9700         instead of a Type.      
9701
9702         * decl.cs (DeclSpace): Implement IAlias.
9703         (DeclSpace.LookupAlias): Return an IAlias instead of a string.
9704
9705         * generic.cs (ConstructedType): Improved error checking.
9706
9707 2004-04-02  Martin Baulig  <martin@ximian.com>
9708
9709         * convert.cs: Added type parameter conversions.
9710
9711         * ecore.cs
9712         (UnboxCast.Emit): Emit an `unbox.any' for type params.
9713         (ClassCast.Emit): If the source type is a type parameter, box it.
9714         If the target type is a type parameter, emit an `unbox.any'
9715         instead of a `classcast'.1      
9716
9717 2004-04-01  Martin Baulig  <martin@ximian.com>
9718
9719         * cs-tokenizer.cs (parse_less_than): Allow Token.DOT.
9720
9721 2004-04-01  Martin Baulig  <martin@ximian.com>
9722
9723         * generic.cs (ConstructedType.CheckConstraints): Use
9724         Convert.ImplicitStandardConversionExists(); user-defined implicit
9725         conversions are not allowed according to the spec.
9726
9727 2004-03-30  Martin Baulig  <martin@ximian.com>
9728
9729         * expression.cs (New): Added support for type parameters.
9730
9731         * typemanager.cs
9732         (TypeManager.activator_type): New public static field.
9733         (TypeManager.activator_create_instance): Likewise.
9734
9735 2004-03-30  Martin Baulig  <martin@ximian.com>
9736
9737         * typemanager.cs (TypeManager.HasConstructorConstraint): New
9738         public method.
9739
9740 2004-03-30  Martin Baulig  <martin@ximian.com>
9741
9742         * generic.cs (ConstructedType.CheckConstraints): Actually follow
9743         the spec here: the argument type must be convertible to the
9744         constraints.
9745
9746 2004-03-30  Martin Baulig  <martin@ximian.com>
9747
9748         * generic.cs
9749         (TypeParameter.Define, TypeParameter.DefineMethod): Call
9750         TypeManager.AddTypeParameter().
9751         (ConstructedType.CheckConstraints): Re-enable this and actually
9752         check whether we have a constructor constraint.
9753
9754         * typemanager.cs
9755         (TypeManager.builder_to_type_param): New static field.
9756         (TypeManager.AddTypeParameter): New static method.
9757         (TypeManager.LookupTypeParameter): New public method.
9758
9759 2004-03-30  Martin Baulig  <martin@ximian.com>
9760
9761         * generic.cs (TypeParameter.DefineType): Return a boolean and use
9762         the new API to actually define the constructor constraint.
9763
9764         * typemanager.cs
9765         (TypeManager.new_constraint_attr_type): New static field.
9766         (TypeManager.InitCoreTypes): Initialize it.
9767
9768 2004-03-30  Martin Baulig  <martin@ximian.com>
9769
9770         * generic.cs (Constraints): Completed error checking, use correct
9771         error numbers.
9772
9773 2004-03-29  Martin Baulig  <martin@ximian.com>
9774
9775         * delegate.cs (Delegate.VerifyMethod): Infer type arguments.
9776
9777         * expression.cs (Invocation.InferTypeArguments): Added overloaded
9778         public version which takes a `ParameterData pd' instead of an
9779         `ArrayList args'.
9780
9781 2004-03-29  Martin Baulig  <martin@ximian.com>
9782
9783         * typemanager.cs (TypeManager.IsGenericMethod): Take a MethodBase,
9784         not a MethodInfo.       
9785
9786 2004-03-29  Martin Baulig  <martin@ximian.com>
9787
9788         * expression.cs (Argument.ResolveMethodGroup): If we're a
9789         ConstructedType, call GetMemberAccess() on it.  
9790
9791 2004-03-29  Martin Baulig  <martin@ximian.com>
9792
9793         * class.cs (MethodBase.CheckGenericOverride): New abstract method.
9794         (MethodCore.CheckGenericOverride): When overriding a generic
9795         method, check whether the constraints match.
9796
9797         * support.cs (GenericConstraints): New public interface.
9798         (ParameterData.GenericConstraints): New public method.
9799
9800         * parameter.cs (Parameter.Resolve): Check whether we're a generic
9801         method parameter and compute our constraints if appropriate.
9802         (Parameter.GenericConstraints): New public property.
9803
9804         * generic.cs (Constraints): Implement GenericConstraints.
9805
9806 2004-03-29  Martin Baulig  <martin@ximian.com>
9807
9808         * decl.cs (MemberCache.FindMemberToOverride): Use
9809         `paramTypes [j].Equals (cmpAttrs [j])' instead of `=='.
9810
9811 2004-03-29  Martin Baulig  <martin@ximian.com>
9812
9813         * generic.cs (GenericMethod.Define): Resolve our type parameters.
9814
9815 2004-03-29  Martin Baulig  <martin@ximian.com>
9816
9817         * cs-parser.jay: Report CS0080 instead of -200 ("Constraints are
9818         not allowed on non-generic declarations").
9819
9820 2004-03-29  Martin Baulig  <martin@ximian.com>
9821
9822         * expression.cs (Invocation.InferTypeArguments): Added overloaded
9823         public version of this method.
9824
9825         * class.cs (MethodCore.IsDuplicateImplementation): Use
9826         Invocation.InferTypeArguments() to check this.
9827
9828 2004-03-29  Martin Baulig  <martin@ximian.com>
9829
9830         * convert.cs: Use TypeManager.IsDelegateType() instead of
9831         comparing types correctly.
9832
9833 2004-03-29  Martin Baulig  <martin@ximian.com>
9834
9835         * convert.cs: Use TypeManager.IsSubclassOf() instead of comparing
9836         types directly to make it work for generic instances.
9837
9838         * typemanager.cs (TypeManager.IsSubclassOf): New static method.
9839
9840 2004-03-29  Martin Baulig  <martin@ximian.com>
9841
9842         * typemanager.cs (TypeManager.MayBecomeEqualGenericTypes): Added
9843         support for arrays.     
9844
9845 2004-03-24  Martin Baulig  <martin@ximian.com>
9846
9847         * decl.cs (DeclSpace.FindType): Also use
9848         TypeManager.CheckGeneric() for types from the using clauses.
9849
9850 2004-03-23  Martin Baulig  <martin@ximian.com>
9851
9852         * expression.cs (Invocation.OverloadResolve): Added `bool
9853         may_fail' argument and use it instead of the Location.IsNull() hack.
9854
9855 2004-03-23  Martin Baulig  <martin@ximian.com>
9856
9857         * expression.cs (Invocation.InferType): Use correct type inference
9858         rules here.     
9859
9860 2004-03-23  Martin Baulig  <martin@ximian.com>
9861
9862         * ecore.cs (MethodGroupExpr.Name): Use
9863         TypeManager.CSharpSignature() instead of just the name.
9864
9865         * expression.cs (Invocation.OverloadResolve): Provide better error
9866         reporting.
9867         (Invocation.DoResolve): OverloadResolve() never returns null
9868         without reporting an error, so removed the error -6 reporting here.
9869
9870 2004-03-23  Martin Baulig  <martin@ximian.com>
9871
9872         * typemanager.cs (TypeManager.GetMethodFlags): Fixed the FIXME for
9873         generic methods.
9874
9875         * cs-parser.jay (delegate_declaration): Support generic delegates.
9876
9877         * delegate.cs: Support generic delegates.
9878
9879 2004-03-22  Martin Baulig  <martin@ximian.com>
9880
9881         * expression.cs (Invocation.InferParamsTypeArguments): New static
9882         method; does type inference for params arguments.
9883
9884 2004-03-21  Martin Baulig  <martin@ximian.com>
9885
9886         * typemanager.cs (TypeManager.IsGenericMethod): New public static
9887         method; checks whether a method is a generic method.    
9888
9889         * expression.cs (Invocation.InferTypeArguments): New static method;
9890         infer type arguments for generic method invocation.
9891
9892         * ecore.cs (MethodGroupExpr.HasTypeArguments): New public
9893         property; we set this to true if we're resolving a generic method
9894         invocation and the user specified type arguments, ie. we're not
9895         doing type inference.
9896
9897 2004-03-20  Martin Baulig  <martin@ximian.com>
9898
9899         * class.cs (MethodData.DeclaringType): New public property.
9900         (MethodData.Define): Set DeclaringType here.
9901         (Operator.Define): Use OperatorMethod.MethodData.DeclaringType
9902         instead of OperatorMethodBuilder.DeclaringType.
9903
9904 2004-03-20  Martin Baulig  <martin@ximian.com>
9905
9906         * cs-tokenizer.cs (xtoken): Return a special
9907         Token.DEFAULT_OPEN_PARENS for "`default' followed by open parens".
9908
9909         * cs-parser.jay (default_value_expression): Switch to the new
9910         syntax (14.5.13).
9911
9912 2004-03-19  Martin Baulig  <martin@ximian.com>
9913
9914         * decl.cs (MemberName): New class.  We use this to "construct"
9915         namespace_or_type_name's.
9916
9917         * generics.cs (TypeArguments.GetDeclarations): New public method;
9918         returns the type arguments as a string[] and reports a CS0081 if
9919         one of them is not an identifier.
9920
9921         * class.cs (MemberBase): The .ctor now takes the name as a
9922         MemberName instead of a string.
9923         (MemberBase.ExplicitInterfaceName): Changed type from string to
9924         Expression.
9925         (MemberBase.DoDefine): If we're an explicit implementation, the
9926         InterfaceType may be a generic instance.
9927
9928         * cs-parser.jay (namespace_or_type_name): Return a MemberName.
9929         (namespace_name): Call MemberName.GetName () to transform the
9930         MemberName into a string and ensure we don't have any type
9931         arguments.
9932         (type_name): Call MemberName.GetTypeExpression() to transfrom the
9933         MemberName into an expression.
9934         (method_header): Use namespace_or_type_name instead of member_name.     
9935
9936 2004-04-07  Miguel de Icaza  <miguel@ximian.com>
9937
9938         * rootcontext.cs: Add new types to the boot resolution.
9939
9940         * ecore.cs (TypeExpr.CanInheritFrom): Inheriting from
9941         MulticastDelegate is not allowed.
9942
9943         * typemanager.cs: Add new types to lookup: System.TypedReference
9944         and ArgIterator.
9945
9946         * paramter.cs (Parameter.Resolve): if we are an out/ref parameter,
9947         check for TypedReference or ArgIterator, they are not allowed. 
9948
9949         * ecore.cs (BoxedCast): Set the eclass to ExprClass.Value, this
9950         makes us properly catch 1510 in some conditions (see bug 56016 for
9951         details). 
9952
9953 2004-04-06  Bernie Solomon  <bernard@ugsolutions.com>
9954
9955         * CryptoConvert.cs: update from corlib version
9956         with endian fixes.
9957
9958 2004-04-05  Miguel de Icaza  <miguel@ximian.com>
9959
9960         * class.cs (Indexer.Define): Check indexername declaration
9961
9962 2004-04-05  Marek Safar  <marek.safar@seznam.cz>
9963
9964         * attribute.cs (IsClsCompliant): Fixed problem with handling
9965         all three states (compliant, not-compliant, undetected).
9966
9967 2004-03-30  Marek Safar  <marek.safar@seznam.cz>
9968
9969         * attribute.cs (Attribute): Location is now public.
9970         (Resolve): Store resolved arguments (pos_values) in attribute class.
9971         Attribute extractors (now GetClsCompliantAttributeValue) can reuse them.
9972         (GetClsCompliantAttributeValue): New method that gets
9973         CLSCompliantAttribute value.
9974         (GetClsCompliantAttribute): Returns CLSCompliantAttribute for DeclSpace
9975         if exists else null.
9976         (AttributeTester): New class for CLS-Compliant verification routines.
9977
9978         * class.cs (Emit): Add CLS-Compliant verification.
9979         (Method.GetSignatureForError): Implemented.
9980         (Constructor.GetSignatureForError): Implemented
9981         (Constructor.HasCompliantArgs): Returns if constructor has
9982         CLS-Compliant arguments.
9983         (Constructor.Emit): Override.
9984         (Construcor.IsIdentifierClsCompliant): New method; For constructors
9985         is needed to test only parameters.
9986         (FieldBase.GetSignatureForError): Implemented.
9987         (TypeContainer): New member for storing base interfaces.
9988         (TypeContainer.FindMembers): Search in base interfaces too.
9989
9990         * codegen.cs (GetClsComplianceAttribute): New method that gets
9991         assembly or module CLSCompliantAttribute value.
9992         (ResolveClsCompliance): New method that resolve CLSCompliantAttribute
9993         for assembly.
9994         (ModuleClass.Emit): Add error 3012 test.
9995
9996         * const.cs (Emit): Override and call base for CLS-Compliant tests.
9997
9998         * decl.cs (ClsComplianceValue): New enum that holds CLS-Compliant
9999         state for all decl types.
10000         (MemberCore.Emit): Emit is now virtual and call VerifyClsCompliance
10001         if CLS-Compliant tests are required.
10002         (IsClsCompliaceRequired): New method. Analyze whether code
10003         must be CLS-Compliant.
10004         (IsExposedFromAssembly): New method. Returns true when MemberCore
10005         is exposed from assembly.
10006         (GetClsCompliantAttributeValue): New method. Resolve CLSCompliantAttribute
10007         value or gets cached value.
10008         (HasClsCompliantAttribute): New method. Returns true if MemberCore
10009         is explicitly marked with CLSCompliantAttribute.
10010         (IsIdentifierClsCompliant): New abstract method. This method is
10011         used to testing error 3005.
10012         (IsIdentifierAndParamClsCompliant): New method. Common helper method
10013         for identifier and parameters CLS-Compliant testing.
10014         (VerifyClsCompliance): New method. The main virtual method for
10015         CLS-Compliant verifications.
10016         (CheckAccessLevel): In one special case (System.Drawing) was TypeBuilder
10017         null. I don't know why is null (too many public members !).
10018         (GetClsCompliantAttributeValue). New method. Goes through class hierarchy
10019         and get value of first CLSCompliantAttribute that found.
10020
10021         * delegate.cs (Emit): Override and call base for CLS-Compliant tests.
10022         (VerifyClsCompliance): Override and add extra tests.
10023
10024         * driver.cs (CSCParseOption): New command line options (clscheck[+|-]).
10025         clscheck- disable CLS-Compliant verification event if assembly is has
10026         CLSCompliantAttribute(true).
10027
10028         * enum.cs (Emit): Override and call base for CLS-Compliant tests.
10029         ApllyAttribute is now called in emit section as in the other cases.
10030         Possible future Emit integration.
10031         (IsIdentifierClsCompliant): New override.
10032         (VerifyClsCompliance): New override.
10033         (GetEnumeratorName): Returns full enum name.
10034
10035         * parameter.cs (GetSignatureForError): Implemented.
10036
10037         * report.cs (WarningData): New struct for Warning message information.
10038         (LocationOfPreviousError): New method.
10039         (Warning): New method. Reports warning based on the warning table.
10040         (Error_T): New method. Reports error based on the error table.
10041
10042         * rootcontext.cs (EmitCode): Added new Emit(s) because CLS-Compliant
10043         verifications are done here.
10044
10045         * tree.cs (RecordDecl): Used new LocationOfPreviousError method.
10046
10047         * typemanager.cs (cls_compliant_attribute_type): New member thath holds
10048         CLSCompliantAttribute.
10049         (all_imported_types): New member holds all imported types from other
10050         assemblies.
10051         (LoadAllImportedTypes): New method fills static table with exported types
10052         from all referenced assemblies.
10053         (Modules): New property returns all assembly modules.
10054
10055 2004-03-30  Miguel de Icaza  <miguel@ximian.com>
10056
10057         * cs-parser.jay: Add a rule to catch wrong event syntax instead of
10058         throwing a parser error.
10059
10060         * ecore.cs (PropertyExpr.GetAccessor): Apply patch from Patrik Reali
10061         which removes the hardcoded get_/set_ prefixes for properties, as
10062         IL allows for the properties to be named something else.  
10063
10064         Bug #56013
10065
10066         * expression.cs: Do not override operand before we know if it is
10067         non-null.  Fix 56207
10068
10069 2004-03-29 Ben Maurer  <bmaurer@users.sourceforge.net>
10070
10071         * typemanager.cs: support for pinned variables.
10072
10073 2004-03-29 Ben Maurer  <bmaurer@users.sourceforge.net>
10074
10075         * decl.cs, typemanager.cs: Avoid using an arraylist
10076         as a buffer if there is only one result set.
10077
10078 2004-03-29 Ben Maurer  <bmaurer@users.sourceforge.net>
10079
10080         * expression.cs: Make sure you cant call a static method
10081         with an instance expression, bug #56174.
10082
10083 2004-03-29  Miguel de Icaza  <miguel@ximian.com>
10084
10085         * class.cs (IsDuplicateImplementation): Improve error reporting to
10086         flag 663 (method only differs in parameter modifier).
10087
10088         * cs-tokenizer.cs: Do not require whitespace when a ( or " will do
10089         in preprocessor directives.
10090
10091         * location.cs (LookupFile): Allow for the empty path.
10092
10093         * attribute.cs (DefinePInvokeMethod): Fix 56148;  I would like a
10094         better approach for some of that patch, but its failing with the
10095         CharSet enumeration.  For now try/catch will do.
10096
10097         * typemanager.cs: Do not crash if a struct does not have fields.
10098         Fixes 56150.
10099
10100 2004-03-28 Ben Maurer  <bmaurer@users.sourceforge.net>
10101
10102         * expression.cs: cs0213, cant fix a fixed expression.
10103         fixes 50231.
10104
10105 2004-03-28 Ben Maurer  <bmaurer@users.sourceforge.net>
10106
10107         * cs-parser.jay: detect invalid embeded statements gracefully.
10108         bug #51113.
10109
10110 2004-03-28 Ben Maurer  <bmaurer@users.sourceforge.net>
10111
10112         * ecore.cs, typemanager.cs: Correct impl of cs1540 check.
10113         As a regex:
10114         s/
10115         the invocation type may not be a subclass of the tye of the item/
10116         The type of the item must be a subclass of the invocation item.
10117         /g
10118
10119         Fixes bug #50820.
10120
10121 2004-03-25  Sebastien Pouliot  <sebastien@ximian.com>
10122
10123         * attribute.cs: Added methods to get a string and a bool from an
10124         attribute. Required to information from AssemblyKeyFileAttribute,
10125         AttributeKeyNameAttribute (string) and AssemblyDelaySign (bool).
10126         * codegen.cs: Modified AssemblyName creation to include support for
10127         strongnames. Catch additional exceptions to report them as CS1548.
10128         * compiler.csproj: Updated include CryptoConvert.cs.
10129         * compiler.csproj.user: Removed file - user specific configuration.
10130         * CryptoConvert.cs: New. A COPY of the class CryptoConvert from 
10131         Mono.Security assembly. The original class is maintained and tested in
10132         /mcs/class/Mono.Security/Mono.Security.Cryptography/CryptoConvert.cs.
10133         * drivers.cs: Added support for /keyfile, /keycontainer and /delaysign
10134         like CSC 8.0 (C# v2) supports.
10135         * Makefile: Added CryptoConvert.cs to mcs sources.
10136         * rootcontext.cs: Added new options for strongnames.
10137
10138 2004-03-24 Ben Maurer  <bmaurer@users.sourceforge.net>
10139
10140         * driver.cs: For --expect-error, report error code `2'
10141         if the program compiled with no errors, error code `1' if
10142         it compiled with an error other than the one expected.
10143
10144 2004-03-24  Sebastien Pouliot  <sebastien@ximian.com>
10145
10146         * compiler.csproj: Updated for Visual Studio .NET 2003.
10147         * compiler.csproj.user: Updated for Visual Studio .NET 2003.
10148         * compiler.sln: Updated for Visual Studio .NET 2003.
10149
10150 2004-03-24  Ravi Pratap M  <ravi@ximian.com>
10151
10152         * expression.cs: Fix bug #47234. We basically need to apply the
10153         rule that we prefer the conversion of null to a reference type
10154         when faced with a conversion to 'object' (csc behaviour).
10155
10156 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
10157
10158         * statement.cs: Shorter form for foreach, eliminates
10159         a local variable. r=Martin.
10160
10161 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
10162
10163         * constant.cs, ecore.cs, literal.cs: New prop IsZeroInteger that
10164         checks if we can use brtrue/brfalse to test for 0.
10165         * expression.cs: use the above in the test for using brtrue/brfalse.
10166         cleanup code a bit.
10167
10168 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
10169
10170         * expression.cs: Rewrite string concat stuff. Benefits:
10171
10172         - "a" + foo + "b" + "c" becomes "a" + foo + "bc"
10173         - "a" + foo + "b" + bar + "c" + baz ... uses concat (string []).
10174         rather than a concat chain.
10175
10176         * typemanager.cs: Add lookups for more concat overloads.
10177
10178 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
10179
10180         * expression.cs: Emit shorter il code for array init.
10181
10182         newarr
10183         dup
10184         // set 1
10185
10186         // set 2
10187
10188         newarr
10189         stloc.x
10190
10191         ldloc.x
10192         // set 1
10193
10194         ldloc.x
10195         // set 2
10196
10197 2004-03-22 Ben Maurer  <bmaurer@users.sourceforge.net>
10198
10199         * statement.cs: Before, two switch blocks would be merged if the
10200         total size of the blocks (end_item - begin_item + 1) was less than
10201         two times the combined sizes of the blocks.
10202
10203         Now, it will only merge if after the merge at least half of the
10204         slots are filled.
10205
10206         fixes 55885.
10207
10208 2004-03-20  Atsushi Enomoto  <atsushi@ximian.com>
10209
10210         * class.cs : csc build fix for GetMethods(). See bug #52503.
10211
10212 2004-03-20 Ben Maurer  <bmaurer@users.sourceforge.net>
10213
10214         * expression.cs: Make sure fp comparisons work with NaN.
10215         This fixes bug #54303. Mig approved this patch a long
10216         time ago, but we were not able to test b/c the runtime
10217         had a related bug.
10218
10219 2004-03-19  Miguel de Icaza  <miguel@ximian.com>
10220
10221         * ecore.cs (TypExpr.GetHashCode): implement this overload. 
10222
10223 2004-03-19  Martin Baulig  <martin@ximian.com>
10224
10225         * class.cs (MemberCore.IsDuplicateImplementation): Check whether
10226         two overloads may unify for some type parameter substitutions and
10227         report a CS0408 if appropriate.
10228
10229 2004-03-19  Martin Baulig  <martin@ximian.com>
10230
10231         * class.cs (MemberCore.IsDuplicateImplementation): Report the
10232         error here and not in our caller.
10233
10234 2004-03-19  Martin Baulig  <martin@ximian.com>
10235
10236         * interface.cs: Completely killed this file.
10237         (Interface): We're now a TypeContainer and live in class.cs.
10238
10239         * class.cs (TypeContainer.GetClassBases): Added `bool is_iface'
10240         argument; we're now also called for interfaces.
10241         (TypeContainer.DefineMembers): Allow this method being called
10242         multiple times.
10243         (TypeContainer.GetMethods): New public method; formerly known as
10244         Interface.GetMethod().  This is used by PendingImplementation.
10245         (TypeContainer.EmitDefaultMemberAttr): Moved here from Interface;
10246         it's now private and non-static.
10247         (Interface): Moved this here; it's now implemented similar to
10248         Class and Struct.
10249         (Method, Property, Event, Indexer): Added `bool is_interface'
10250         argument to their .ctor's.
10251         (MemberBase.IsInterface): New public field.
10252
10253         * cs-parser.jay: Create normal Method, Property, Event, Indexer
10254         instances instead of InterfaceMethod, InterfaceProperty, etc.
10255         (opt_interface_base): Removed; we now use `opt_class_base' instead.
10256         (InterfaceAccessorInfo): Create `Get' and `Set' Accessor's.
10257
10258 2004-03-19  Martin Baulig  <martin@ximian.com>
10259
10260         * class.cs (MethodCore.IsDuplicateImplementation): New private
10261         method which does the CS0111 checking.
10262         (Method.CheckBase, Constructor.CheckBase, PropertyBase.CheckBase):
10263         Use IsDuplicateImplementation().
10264
10265 2004-03-17 Ben Maurer  <bmaurer@users.sourceforge.net>
10266
10267         * decl.cs (FindMemberToOverride): New method to find the correct
10268         method or property to override in the base class.
10269         * class.cs
10270             - Make Method/Property use the above method to find the
10271               version in the base class.
10272             - Remove the InheritableMemberSignatureCompare as it is now
10273               dead code.
10274
10275         This patch makes large code bases much faster to compile, as it is
10276         O(n) rather than O(n^2) to do this validation.
10277
10278         Also, it fixes bug 52458 which is that nested classes are not
10279         taken into account when finding the base class member.
10280
10281         Reviewed/Approved by Martin.
10282
10283 2004-03-17  Martin Baulig  <martin@ximian.com>
10284
10285         * expression.cs (MemberAccess.DoResolve): Take the parent's number
10286         of type arguments into account; use the `real_num_type_args'
10287         approach like in DoResolveAsTypeStep().
10288
10289         * generic.cs (GenericMemberAccess.DoResolve): Make this work for
10290         nested types.
10291
10292 2004-03-17  Marek Safar  <marek.safar@seznam.cz>
10293
10294         * interface.cs: In all interface classes removed redundant
10295         member initialization.
10296
10297 2004-03-16  Martin Baulig  <martin@ximian.com>
10298
10299         * class.cs (TypeContainer.GetClassBases): Fix the CS0528 check.
10300
10301 2004-03-15  Miguel de Icaza  <miguel@ximian.com>
10302
10303         * decl.cs (DefineTypeAndParents): New helper method to define a
10304         type's containers before the type itself is defined;  This is a
10305         bug exposed by the recent changes to Windows.Forms when an
10306         implemented interface was defined inside a class that had not been
10307         built yet.   
10308
10309         * modifiers.cs (MethodAttr): All methods in C# are HideBySig.
10310
10311         (Check): Loop correctly to report errors modifiers
10312         (UNSAFE was not in the loop, since it was the same as TOP).
10313
10314         * interface.cs: Every interface member now takes a ModFlags,
10315         instead of a "is_new" bool, which we set on the base MemberCore. 
10316
10317         Every place where we called "UnsafeOk" in the interface, now we
10318         call the proper member (InterfaceMethod.UnsafeOK) instead to get
10319         the unsafe settings from the member declaration instead of the
10320         container interface. 
10321
10322         * cs-parser.jay (opt_new): Allow unsafe here per the spec. 
10323
10324         * pending.cs (TypeAndMethods): Add `get_indexer_name' and
10325         `set_indexer_name' to the pending bits (one per type).
10326
10327         We fixed a bug today that was picking the wrong method to
10328         override, since for properties the existing InterfaceMethod code
10329         basically ignored the method name.  Now we make sure that the
10330         method name is one of the valid indexer names.
10331
10332 2004-03-14  Gustavo Giráldez  <gustavo.giraldez@gmx.net>
10333  
10334         * support.cs (SeekableStreamReader): Keep track of stream byte
10335         positions and don't mix them with character offsets to the buffer.
10336
10337         Patch from Gustavo Giráldez
10338
10339 2004-03-15  Marek Safar  <marek.safar@seznam.cz>
10340
10341         * interface.cs (InterfaceSetGetBase): Removed double member
10342         initialization, base class does it as well.
10343
10344 2004-03-13  Martin Baulig  <martin@ximian.com>
10345
10346         * class.cs: Reverted Miguel's latest commit; it makes mcs crash
10347         when compiling corlib.
10348
10349 2004-03-13  Miguel de Icaza  <miguel@ximian.com>
10350
10351         * convert.cs (ExplicitConversion): We were reporting an error on
10352         certain conversions (object_type source to a value type, when the
10353         expression was `null') before we had a chance to pass it through
10354         the user defined conversions.
10355
10356         * driver.cs: Replace / and \ in resource specifications to dots.
10357         Fixes 50752
10358
10359         * class.cs: Add check for duplicate operators.  Fixes 52477
10360
10361 2004-03-11  Miguel de Icaza  <miguel@ximian.com>
10362
10363         * statement.cs (Switch.SimpleSwitchEmit): Deal with default labels
10364         that are in the middle of the statements, not only at the end.
10365         Fixes #54987
10366
10367         * class.cs (TypeContainer.AddField): No longer set the
10368         `HaveStaticConstructor' flag, now we call it
10369         `UserDefineStaticConstructor' to diferentiate the slightly
10370         semantic difference.
10371
10372         The situation is that we were not adding BeforeFieldInit (from
10373         Modifiers.TypeAttr) to classes that could have it.
10374         BeforeFieldInit should be set to classes that have no static
10375         constructor. 
10376
10377         See:
10378
10379         http://www.yoda.arachsys.com/csharp/beforefieldinit.html
10380
10381         And most importantly Zoltan's comment:
10382
10383         http://bugzilla.ximian.com/show_bug.cgi?id=44229
10384
10385         "I think beforefieldinit means 'it's ok to initialize the type sometime 
10386          before its static fields are used', i.e. initialization does not need
10387          to be triggered by the first access to the type. Setting this flag
10388          helps the JIT to compile better code, since it can run the static
10389          constructor at JIT time, and does not need to generate code to call it
10390          (possibly lots of times) at runtime. Unfortunately, mcs does not set
10391          this flag for lots of classes like String. 
10392          
10393          csc sets this flag if the type does not have an explicit static 
10394          constructor. The reasoning seems to be that if there are only static
10395          initalizers for a type, and no static constructor, then the programmer
10396          does not care when this initialization happens, so beforefieldinit
10397          can be used.
10398          
10399          This bug prevents the AOT compiler from being usable, since it 
10400          generates so many calls to mono_runtime_class_init that the AOT code
10401          is much slower than the JITted code. The JITted code is faster, 
10402          because it does not generate these calls if the vtable is type is
10403          already initialized, which is true in the majority of cases. But the
10404          AOT compiler can't do this."
10405
10406 2004-03-10  Miguel de Icaza  <miguel@ximian.com>
10407
10408         * class.cs (MethodData.Emit): Refactor the code so symbolic
10409         information is generated for destructors;  For some reasons we
10410         were taking a code path that did not generate symbolic information
10411         before. 
10412
10413 2004-03-11 Ben Maurer  <bmaurer@users.sourceforge.net>
10414
10415         * class.cs: Create a Constructor.CheckBase method that
10416         takes care of all validation type code. The method
10417         contains some code that was moved from Define.
10418
10419         It also includes new code that checks for duplicate ctors.
10420         This fixes bug #55148.
10421
10422 2004-03-09  Joshua Tauberer <tauberer@for.net>
10423
10424         * expression.cs (ArrayCreation): Fix: More than 6 nulls in
10425         a { ... }-style array creation invokes EmitStaticInitializers
10426         which is not good for reference-type arrays.  String, decimal
10427         and now null constants (NullCast) are not counted toward
10428         static initializers.
10429
10430 2004-03-05  Martin Baulig  <martin@ximian.com>
10431
10432         * location.cs (SourceFile.HasLineDirective): New public field;
10433         specifies whether the file contains or is referenced by a "#line"
10434         directive.
10435         (Location.DefineSymbolDocuments): Ignore source files which
10436         either contain or are referenced by a "#line" directive.        
10437
10438 2004-02-29  Ben Maurer <bmaurer@users.sourceforge.net>
10439
10440         * class.cs (Method.CheckBase): Avoid using FindMembers, we have
10441         direct access to our parent, so check the method inline there.
10442
10443 2004-02-27 Ben Maurer  <bmaurer@users.sourceforge.net>
10444
10445         * expression.cs (Invocation.EmitCall): Miguel's last commit
10446         caused a regression. If you had:
10447
10448             T t = null;
10449             t.Foo ();
10450
10451         In Foo the implict this would be null.
10452
10453 2004-02-27  Miguel de Icaza  <miguel@ximian.com>
10454
10455         * expression.cs (Invocation.EmitCall): If the method is not
10456         virtual, do not emit a CallVirt to it, use Call.
10457
10458         * typemanager.cs (GetFullNameSignature): Improve the method to
10459         cope with ".ctor" and replace it with the type name.
10460
10461         * class.cs (ConstructorInitializer.Resolve): Now the method takes
10462         as an argument the ConstructorBuilder where it is being defined,
10463         to catch the recursive constructor invocations.
10464
10465 2004-03-16  Martin Baulig  <martin@ximian.com>
10466
10467         * expression.cs (MemberAccess.DoResolve): If `expr' resolved to a
10468         ConstructedType, call ResolveType() on it to get the type rather
10469         than just using `expr.Type'.
10470
10471 2004-03-16  Martin Baulig  <martin@ximian.com>
10472
10473         * generics.cs (ConstructedType.GetMemberAccess): Take the
10474         EmitContext instead on the TypeExpr and use
10475         ec.TypeContainer.CurrentType/ec.ContainerType.
10476
10477 2004-03-16  Martin Baulig  <martin@ximian.com>
10478
10479         * ecore.cs (SimpleName.DoResolveAsTypeStep): Lookup type
10480         parameters before aliases.
10481
10482 2004-03-16  Martin Baulig  <martin@ximian.com>
10483
10484         * typemanager.cs (TypeManager.MayBecomeEqualGenericInstances):
10485         New oublic function; checks whether two generic instances may become
10486         equal under some instantiations (26.3.1).
10487
10488         * class.cs (TypeContainer.Define): Call
10489         TypeManager.MayBecomeEqualGenericInstances() and report CS0695 on
10490         error.
10491
10492 2004-03-16  Martin Baulig  <martin@ximian.com>
10493
10494         * class.cs (TypeContainer.GetClassBases): Moved
10495         Error_TypeParameterAsBase() here and also check whether the base
10496         class is not an attribute.
10497
10498 2004-03-16  Martin Baulig  <martin@ximian.com>
10499
10500         * class.cs (TypeContainer.GetClassBases): Fix the CS0528 check.
10501
10502 2004-03-16  Martin Baulig  <martin@ximian.com>
10503
10504         * class.cs (Error_TypeParameterAsBase): Use correct error number
10505         here (CS0689).  
10506
10507 2004-03-16  Martin Baulig  <martin@ximian.com>
10508
10509         * decl.cs (DeclSpace.ResolveTypeExpr): Added more error checking
10510         for generics.
10511
10512         * generics.cs (ConstructedType.DoResolveAsTypeStep): Added better
10513         error reporting.
10514
10515 2004-03-15  Martin Baulig  <martin@ximian.com>
10516
10517         * typemanager.cs (TypeManager.GetFullName): New public method.
10518         (TypeManager.MemberLookup): Added `int_num_type_arguments'
10519         argument; only return members with the correct number of type
10520         arguments.
10521         (TypeManager.CheckGeneric): Allow -1 to bypass the check.
10522         (TypeManager.FilterWithClosure): Call CheckGeneric() to check
10523         whether the number of type arguments matches.
10524
10525         * generic.cs (GenericMemberAccess.ResolveAsTypeStep): Allow `expr'
10526         not being a ConstructedType; we can now do "typeof (Foo.Bar<U>)".
10527
10528         * expression.cs (MemberAccess): Added public `NumTypeArguments'
10529         field; it's set by the protected .ctor when we're actually a
10530         GenericMemberAccess.
10531         (MemberAccess.ResolveAsTypeStep): Compute the total number of type
10532         arguments and pass it to MemberLookupFinal ().
10533
10534         * ecore.cs (Expression.MemberLookup): Added `int
10535         num_type_arguments' argument; only return members with the correct
10536         number of type arguments.
10537         (Expression.MemberLookupFailed): Check whether the MemberLookup
10538         failed because we did not have the correct number of type
10539         arguments; report CS0305 in this case.
10540
10541         * decl.cs (DeclSpace.ResolveTypeExpr): Don't report an error if
10542         `e.ResolveAsTypeTerminal()' already did so.
10543
10544 2004-03-15  Martin Baulig  <martin@ximian.com>
10545
10546         * ecore.cs (Expression.ResolveLValue): Allow e.type being null if
10547         we're a ConstructedType; in this case, the caller must report an
10548         error (for instance CS0131).
10549
10550         * generic.cs (TypeArguments): Added Location argument to the .ctor.
10551         (TypeArguments.Resolve): Actually report errors here.
10552
10553 2004-03-15  Miguel de Icaza  <miguel@ximian.com>
10554
10555         * pending.cs (TypeAndMethods): Add `get_indexer_name' and
10556         `set_indexer_name' to the pending bits (one per type).
10557
10558         We fixed a bug today that was picking the wrong method to
10559         override, since for properties the existing InterfaceMethod code
10560         basically ignored the method name.  Now we make sure that the
10561         method name is one of the valid indexer names.
10562
10563 2004-03-15  Martin Baulig  <martin@ximian.com>
10564
10565         * typemanager.cs (TypeManager.IndexerPropertyName): Added support
10566         for generic instances.
10567
10568 2004-03-13  Martin Baulig  <martin@ximian.com>
10569
10570         * class.cs (TypeContainer.DefineType): Call
10571         TypeManager.AddUserType() immediately after creating the
10572         TypeBuilder; pass all type parameters when creating the
10573         CurrentType.
10574
10575         * decl.cs (DeclSpace.FindNestedType): New public method.
10576         (DeclSpace.FindType): Added `int num_type_args' argument; only
10577         return types with the correct number of type parameters.
10578         (DeclSpace.CountTypeParams): New public property.
10579
10580         * ecore.cs (SimpleName.ctor): Added overloaded version which takes
10581         the number of type parameters; defaults to zero.
10582
10583         * generic.cs (TypeArguments.Count): New public property.
10584         (ConstructedType.DoResolveAsTypeStep): First call
10585         ds.FindNestedType() to find out whether we're nested in the
10586         current generic type; in this case, we inherit all type parameters
10587         from the current class.
10588
10589         * rootcontext.cs (RootContext.NamespaceLookup): Added `int
10590         num_type_args' argument.
10591         (RootContext.LookupType): Added overloaded version which takes the
10592         number of type arguments; only return types with the correct
10593         number of type arguments.
10594
10595         * typemanager.cs (TypeManager.CheckGeneric): New public function;
10596         checks whether `Type t' has `int num_type_args'.
10597
10598 2004-03-13  Martin Baulig  <martin@ximian.com>
10599
10600         * generic.cs (GenericMethod.DefineType): New method; calls
10601         DefineType() on all the type parameters.
10602
10603         * class.cs (MethodData.ctor): Added `GenericMethod generic' argument.
10604         (MethodData.Define): If we're a generic method, call
10605         GenericMethod.DefineType() to define the type parameters.       
10606
10607 2004-03-10  Martin Baulig  <martin@ximian.com>
10608
10609         * pending.cs (Pending.InterfaceMethod): Use TypeManager.IsEqual()
10610         instead of IsAssignableFrom.    
10611
10612 2004-03-10  Martin Baulig  <martin@ximian.com>
10613
10614         * ecore.cs (FieldExpr.ctor): Use TypeManager.TypeToCoreType().
10615
10616         * support.cs (ParameterData.HasArrayParameter): New property.
10617         (ReflectionParameters.ctor): Take a MethodBase instead of a
10618         ParameterInfo[].  If we have any type parameters, get the generic
10619         method definition and ask it whether we have variable arguments.
10620
10621 2004-02-26  Miguel de Icaza  <miguel@ximian.com>
10622
10623         * iterators.cs (IteratorHandler.IsIEnumerator, IsIEnumerable): New
10624         routines to check if a type is an enumerable/enumerator allow
10625         classes that implement the IEnumerable or IEnumerator interfaces.
10626
10627         * class.cs (Property, Operator): Implement IIteratorContainer, and
10628         implement SetYields.
10629
10630         (Property.Define): Do the block swapping for get_methods in the
10631         context of iterators.   We need to check if Properties also
10632         include indexers or not.
10633
10634         (Operator): Assign the Block before invoking the
10635         OperatorMethod.Define, so we can trigger the Iterator code
10636         replacement. 
10637
10638         * cs-parser.jay (SimpleIteratorContainer): new helper class.  Both
10639         Property and Operator classes are not created when we parse the
10640         declarator but until we have the block completed, so we use a
10641         singleton SimpleIteratorContainer.Simple to flag whether the
10642         SetYields has been invoked.
10643
10644         We propagate this setting then to the Property or the Operator to
10645         allow the `yield' to function.
10646
10647 2004-02-25  Marek Safar  <marek.safar@seznam.cz>
10648
10649         * codegen.cs: Implemented attribute support for modules.
10650         New AssemblyClass, ModuleClass and CommonAssemblyModulClass for
10651         Assembly/Module functionality.
10652
10653         * attribute.cs, class.cs, cs-parser.jay, delegate.cs, driver.cs, enum.cs
10654         interface.cs, rootcontext.cs, statement.cs, typemanager.cs:
10655         Updated dependencies on CodeGen.ModuleBuilder and CodeGen.AssemblyBuilder.
10656
10657 2004-02-16  Marek Safar  <marek.safar@seznam.cz>
10658
10659         * interface.cs (FindMembers): The operation is performed on all base
10660         interfaces and not only on the first. It is required for future CLS Compliance patch.
10661
10662 2004-02-12 Ben Maurer  <bmaurer@users.sourceforge.net>
10663
10664         * statement.cs, codegen.cs:
10665         This patch deals with patterns such as:
10666
10667         public class List : IEnumerable {
10668
10669                 public MyEnumerator GetEnumerator () {
10670                         return new MyEnumerator(this);
10671                 }
10672
10673                 IEnumerator IEnumerable.GetEnumerator () {
10674                         ...
10675                 }
10676                 
10677                 public struct MyEnumerator : IEnumerator {
10678                         ...
10679                 }
10680         }
10681
10682         Before, there were a few things we did wrong:
10683         1) we would emit callvirt on a struct, which is illegal
10684         2) we emited ldarg when we needed to emit ldarga
10685         3) we would mistakenly call the interface methods on an enumerator
10686         type that derived from IEnumerator and was in another assembly. For example:
10687
10688         public class MyEnumerator : IEnumerator
10689
10690         Would have the interface methods called, even if there were public impls of the
10691         method. In a struct, this lead to invalid IL code.
10692
10693 2004-02-11  Marek Safar  <marek.safar@seznam.cz>
10694
10695         * const.cs: Const is now derived from FieldBase. Method EmitConstant name
10696           renamed to Emit.
10697
10698         * delegate.cs (Define): Fixed crash when delegate type is undefined.
10699
10700 2004-02-11  Miguel de Icaza  <miguel@ximian.com>
10701
10702         * cs-parser.jay: Fix small regression: we were not testing V2
10703         compiler features correctly.
10704
10705         * interface.cs: If the emit context is null, then create one
10706
10707 2004-02-09  Marek Safar  <marek.safar@seznam.cz>
10708
10709         * decl.cs (GetSignatureForError): New virtual method to get full name
10710           for error messages.
10711
10712         * attribute.cs (IAttributeSupport): New interface for attribute setting.
10713           Now it is possible to rewrite ApplyAttributes method to be less if/else.
10714
10715         * interface.cs : All InterfaceXXX classes are now derived from MemberCore.
10716           Duplicated members and code in these classes has been removed.
10717           Better encapsulation in these classes.
10718
10719 2004-02-07  Miguel de Icaza  <miguel@ximian.com>
10720
10721         * assign.cs (Assign.DoResolve): When dealing with compound
10722         assignments, there is a new rule in ECMA C# 2.4 (might have been
10723         there before, but it is documented here) that states that in:
10724
10725         a op= b;
10726
10727         If b is of type int, and the `op' is a shift-operator, then the
10728         above is evaluated as:
10729
10730         a = (int) a op b 
10731
10732         * expression.cs (Binary.ResolveOperator): Instead of testing for
10733         int/uint/long/ulong, try to implicitly convert to any of those
10734         types and use that in pointer arithmetic.
10735
10736         * delegate.cs (Error_NoMatchingMethodForDelegate): Compute the
10737         method to print information for from the type, not from the
10738         null-method we were given.
10739
10740 2004-02-01  Duncan Mak  <duncan@ximian.com>
10741
10742         * cs-tokenizer.cs (get_cmd_arg): Skip over whitespace before
10743         parsing for cmd, fixes bug #53694.
10744
10745 2004-02-04  Marek Safar  <marek.safar@seznam.cz>
10746
10747         * class.cs, decl.cs: Fixed problem where IndexerName attribute was ignored
10748         in the member name duplication tests. Property and operator name duplication
10749         was missing too (error tests cs0102-{2,3,4,5}.cs, cs0111-{3,4}.cs).
10750
10751 2004-02-03  Marek Safar  <marek.safar@seznam.cz>
10752
10753         * interface.cs (PopulateMethod): Fixed crash when interface method
10754         returns not existing type (error test cs0246-3.cs).
10755
10756 2004-02-02  Ravi Pratap M <ravi@ximian.com>
10757
10758         * cs-parser.jay (interface_accessors): Re-write actions to also
10759         store attributes attached to get and set methods. Fix spelling
10760         while at it.
10761
10762         (inteface_property_declaration): Modify accordingly.
10763
10764         (InterfaceAccessorInfo): New helper class to store information to pass
10765         around between rules that use interface_accessors.
10766
10767         * interface.cs (Emit): Apply attributes on the get and set
10768         accessors of properties and indexers too.
10769
10770         * attribute.cs (ApplyAttributes): Modify accordingly to use the
10771         right MethodBuilder when applying attributes to the get and set accessors.
10772
10773 2004-01-31  Miguel de Icaza  <miguel@ximian.com>
10774
10775         * cs-tokenizer.cs: Applied patch from Marek Safar to fix bug 53386
10776
10777 2004-01-26  Miguel de Icaza  <miguel@ximian.com>
10778
10779         * cs-tokenizer.cs: Handle #line hidden from PDC bits.
10780
10781 2004-01-25  Miguel de Icaza  <miguel@ximian.com>
10782
10783         * cs-parser.jay: Remove YIELD token, instead use the new grammar
10784         changes that treat `yield' specially when present before `break'
10785         or `return' tokens.
10786
10787         * cs-tokenizer.cs: yield is no longer a keyword.
10788
10789 2004-01-23  Marek Safar  <marek.safar@seznam.cz>
10790
10791         * cs-parser.jay, class.cs (DefineDefaultConstructor): Fixed ModFlags
10792         setting for default constructors.
10793         For default constructors are almost every time set wrong Modifier. The
10794         generated IL code has been alright. But inside mcs this values was
10795         wrong and this was reason why several of my CLS Compliance tests
10796         failed.
10797
10798 2004-02-27  Martin Baulig  <martin@ximian.com>
10799
10800         * generics.cs (ConstructedType.ResolveType): Make the nested type
10801         stuff actually work.
10802
10803 2004-02-25  Martin Baulig  <martin@ximian.com>
10804
10805         * decl.cs (DeclSpace.CurrentTypeParameters): New protected
10806         property; returns the type parameters just from the current type,
10807         ie. with the ones from outer classes.
10808         (DeclSpace.LookupGeneric): First search in the current class, then
10809         in outer classes.
10810         (DeclSpace.initialize_type_params): When hiding a type parameter
10811         from an outer class, put it into the `type_param_list' anyways.
10812
10813         * expression.cs (MemberAccess.expr): Made this field protected.
10814
10815         * class.cs (TypeContainer.Define): The `CurrentType' just contains
10816         the type parameters from the current class.
10817
10818         * generic.cs (ConstructedType.ResolveType): Support nested generic
10819         types by taking the type parameters which we inherit from outer
10820         classes into account.
10821         (GenericMemberAccess.ResolveAsTypeStep): Override this and added
10822         support for nested generic types.
10823
10824 2004-02-23  Martin Baulig  <martin@ximian.com>
10825
10826         * decl.cs (DeclSpace.IsGeneric): Make this a property instead of a
10827         field and check whether we're nested inside a generic type.
10828         (DeclSpace.ResolveType): If we're resolving to a generic type
10829         definition, create a ConstructedType and return its resolved type.
10830         (DeclSpace.initialize_type_params): New private method;
10831         initializes the `type_param_list' field from the type parameters
10832         from this and all enclosing classes.
10833         (DeclSpace.TypeParameters): Call initialize_type_params() unless
10834         we're already initialized.
10835
10836 2004-02-23  Martin Baulig  <martin@ximian.com>
10837
10838         * class.cs (Method.Define): Create the generic method before
10839         calling DoDefine().
10840         (Memberbase.DoDefine): Added DeclSpace argument (in addition to
10841         the TypeContainer one); we use this for generic methods.
10842
10843         * decl.cs (CheckAccessLevel): If we're a GenericMethod, use our
10844         parent's TypeBuilder.
10845
10846 2004-02-18  Martin Baulig  <martin@ximian.com>
10847
10848         * ecore.cs (FieldExpr.DoResolveLValue): Use TypeManager.IsEqual()
10849         to check for equality.
10850
10851 2004-02-05  Martin Baulig  <martin@ximian.com>
10852
10853         * ecore.cs (FieldExpr.DoResolveLValue): If we have an
10854         `ec.TypeContainer.CurrentType', use it instead of
10855         `ec.ContainerType' to check whether we're in the type's ctor.
10856
10857 2004-01-29  Martin Baulig  <martin@ximian.com>
10858
10859         * expression.cs (Invocation.DoResolve): If we're a
10860         `ConstructedType', then we're actually a generic method, so
10861         rewrite the expr as a GenericMemberAccess.
10862
10863         * cs-parser.jay (member_name): Don't use `namespace_or_type_name'
10864         here; manually parse it into a string.
10865
10866 2004-01-28  Martin Baulig  <martin@ximian.com>
10867
10868         * typemanager.cs (TypeManager.IsEqual): New static method.
10869         (TypeManager.FilterWithClosure): Call TypeManager.IsEqual() to
10870         check for equality instead of using `=='.
10871
10872 2004-01-26  Martin Baulig  <martin@ximian.com>
10873
10874         * decl.cs (DeclSpace.CurrentType): New public field.
10875
10876         * expression.cs (This.ResolveBase): If we have an
10877         `ec.TypeContainer.CurrentType', use it instead of
10878         `ec.ContainerType'.
10879
10880         * class.cs (TypeContainer.DefineType): If we're a generic type,
10881         create the `CurrentType' (unresolved).
10882         (TypeContainer.GenericType): New private field.
10883         (TypeContainer.DefineMembers): If we have a `CurrentType', resolve
10884         it and store it in `GenericType' before creating the MemberCache.
10885         (TypeContainer.GetMembers): If we have a `GenericType', call
10886         TypeManager.FindMembers() on it.
10887
10888         * interface.cs (Interface.GenericType): New private field.
10889         (Interface.DefineType): If we're a generic type, create the
10890         `CurrentType' (unresolved).
10891         (Interface.DefineMembers): If we have a `CurrentType', resolve it
10892         and store it in `GenericType' before creating the MemberCache.
10893         (Interface.GetMembers): If we have a `GenericType', call
10894         TypeManager.FindMembers() on it.
10895
10896 2004-01-22  Martin Baulig  <martin@ximian.com>
10897
10898         * cs-parser.jay (namespace_or_type_name): Return an Expression,
10899         not a QualifiedIdentifier.  This is what `type_name_expression'
10900         was previously doing.
10901         (type_name_expression): Removed; the code is now in
10902         `namespace_or_type_name'.
10903         (qualified_identifier): Removed, use `namespace_or_type_name'
10904         instead.
10905         (QualifiedIdentifier): Removed this class.      
10906
10907 2004-01-22  Martin Baulig  <martin@ximian.com>
10908
10909         * namespace.cs (NamespaceEntry.UsingAlias): Take an Expression,
10910         not a string as alias name.
10911
10912 2004-01-21  Miguel de Icaza  <miguel@ximian.com>
10913
10914         * ecore.cs (FieldInfo.AddressOf): Revert patch from previous
10915         #52730 bug, and instead compute correctly the need to use a
10916         temporary variable when requesting an address based on the
10917         static/instace modified of the field and the constructor.
10918  
10919 2004-01-21  Martin Baulig  <martin@ximian.com>
10920
10921         * ecore.cs (SimpleName.ResolveAsTypeStep): Lookup in the current
10922         class and namespace before looking up aliases.  Fixes #52517.
10923
10924 2004-01-21  Martin Baulig  <martin@ximian.com>
10925
10926         * flowanalysis.cs (UsageVector.Merge): Allow variables being
10927         assinged in a 'try'; fixes exception4.cs.
10928
10929 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
10930         * class.cs : Implemented parameter-less constructor for TypeContainer
10931
10932         * decl.cs: Attributes are now stored here. New property OptAttributes
10933
10934         * delegate.cs, enum.cs, interface.cs: Removed attribute member.
10935
10936         * rootcontext.cs, tree.cs: Now use parameter-less constructor of TypeContainer
10937
10938 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
10939
10940         * typemanager.cs (CSharpSignature): Now reports also inner class name.
10941           (CSharpSignature): New method for indexer and property signature.
10942
10943 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
10944
10945         * pending.cs (IsVirtualFilter): Faster implementation.
10946
10947 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
10948
10949         * typemanager.cs: Avoid inclusion of same assembly more than once.
10950
10951 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
10952
10953         * cs-parser.jay: Fixed problem where the last assembly attribute
10954           has been applied also to following declaration (class, struct, etc.)
10955           
10956 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
10957
10958         * class.cs: Added error CS0538, CS0539 reporting.
10959         Fixed crash on Microsoft runtime when field type is void.
10960
10961         * cs-parser.jay: Added error CS0537 reporting.
10962
10963         * pending.cs: Added error CS0535 reporting.
10964         Improved error report for errors CS0536, CS0534.
10965
10966 2004-01-20  Miguel de Icaza  <miguel@ximian.com>
10967
10968         Merge a few bits from the Anonymous Method MCS tree.
10969
10970         * statement.cs (ToplevelBlock): New class for toplevel methods,
10971         will hold anonymous methods, lifted variables.
10972
10973         * cs-parser.jay: Create toplevel blocks for delegates and for
10974         regular blocks of code. 
10975
10976 2004-01-20  Martin Baulig  <martin@ximian.com>
10977
10978         * codegen.cs (EmitContext): Removed `InTry', `InCatch',
10979         `InFinally', `InLoop', `TryCatchLevel', `LoopBeginTryCatchLevel'
10980         and `NeedExplicitReturn'; added `IsLastStatement'.
10981         (EmitContext.EmitTopBlock): Emit the explicit "ret" if we either
10982         have a `ReturnLabel' or we're not unreachable.
10983
10984         * flowanalysis.cs (FlowBranching.MergeChild): Actually merge the
10985         child's reachability; don't just override ours with it.  Fixes
10986         #58058 (lluis's example).
10987         (FlowBranching): Added public InTryOrCatch(), InCatch(),
10988         InFinally(), InLoop(), InSwitch() and
10989         BreakCrossesTryCatchBoundary() methods.
10990
10991         * statement.cs (Return): Do all error checking in Resolve().
10992         Unless we are the last statement in a top-level block, always
10993         create a return label and jump to it.
10994         (Break, Continue): Do all error checking in Resolve(); also make
10995         sure we aren't leaving a `finally'.
10996         (Block.DoEmit): Set `ec.IsLastStatement' when emitting the last
10997         statement in a top-level block.
10998         (Block.Flags): Added `IsDestructor'.
10999         (Block.IsDestructor): New public property.
11000
11001 2004-01-20  Martin Baulig  <martin@ximian.com>
11002
11003         * statement.cs (Break.DoEmit): Set ec.NeedExplicitReturn; fixes #52427.
11004
11005 2004-01-20  Martin Baulig  <martin@ximian.com>
11006
11007         * statement.cs (Statement.ResolveUnreachable): New public method.
11008         (If, While): Do the dead-code elimination in Resolve(), not in Emit().
11009         (Block.Resolve): Resolve unreachable statements.
11010
11011 2004-01-19 Ben Maurer  <bmaurer@users.sourceforge.net>
11012
11013         * expression.cs: We need to fix the case where we do
11014         not have a temp variable here.
11015
11016         * assign.cs: Only expression compound assignments need
11017         temporary variables.
11018
11019 2004-01-19 Ben Maurer  <bmaurer@users.sourceforge.net>
11020
11021         * flowanalysis.cs: Reduce memory allocation in a few ways:
11022           - A block with no variables should not allocate a bit
11023             vector for itself.
11024           - A method with no out parameters does not need any tracking
11025             for assignment of the parameters, so we need not allocate
11026             any data for it.
11027           - The arrays:
11028                 public readonly Type[] VariableTypes;
11029                 public readonly string[] VariableNames;
11030             Are redundant. The data is already stored in the variable
11031             map, so we need not allocate another array for it.
11032           - We need to add alot of checks for if (params | locals) == null
11033             due to the first two changes.
11034
11035 2004-01-18  Miguel de Icaza  <miguel@ximian.com>
11036
11037         * ecore.cs (FieldExpr.AddressOf): For ValueTypes that do not
11038         implement IMemoryLocation, we store a copy on a local variable and
11039         take the address of it.  Patch from Benjamin Jemlich
11040
11041         * cs-parser.jay: Applied patch from Ben Maurer to the "type" rule
11042         to use a special "type_name_expression" rule which reduces the
11043         number of "QualifiedIdentifier" classes created, and instead
11044         directly creates MemberAccess expressions.
11045
11046 2004-01-17  Miguel de Icaza  <miguel@ximian.com>
11047
11048         * convert.cs: Applied patch from Benjamin Jemlich (pcgod@gmx.net)
11049         that fixes #52853.  Null literal assignment to ValueType
11050
11051         * class.cs (MethodData.Emit): Instead of checking the name of the
11052         method to determine if its a destructor, create a new derived
11053         class from Method called Destructor, and test for that.  
11054
11055         * cs-parser.jay: Create a Destructor object instead of a Method.  
11056
11057         Based on a fix from Benjamin Jemlich (pcgod@gmx.net)
11058
11059         Fixes: 52933
11060
11061 2004-01-16  Miguel de Icaza  <miguel@ximian.com>
11062
11063         * expression.cs (Binary.ResolveOperator): Perform an implicit
11064         conversion from MethodGroups to their delegate types on the
11065         Addition operation.
11066
11067         * delegate.cs: Introduce a new class DelegateCreation that is the
11068         base class for `NewDelegate' and `ImplicitDelegateCreation',
11069         factor some code in here.
11070
11071         * convert.cs (Convert.ImplicitConversionStandard): Add an implicit
11072         conversion from MethodGroups to compatible delegate types. 
11073
11074         * ecore.cs (Expression.Resolve): Do not flag error 654
11075         (Methodgroupd needs parenthesis) if running on the V2 compiler, as
11076         we allow conversions from MethodGroups to delegate types now.
11077
11078         * assign.cs (Assign.DoResolve): Do not flag errors on methodgroup
11079         assignments in v2 either.
11080
11081 2004-01-10  Miguel de Icaza  <miguel@ximian.com>
11082
11083         * ecore.cs (FieldExpr.AddressOf): Fix generated IL for accessing
11084         static read-only fields in ctors.
11085
11086         Applied patch from Benjamin Jemlich 
11087
11088         * expression.cs (UnaryMutator): Avoid leaking local variables. 
11089
11090 2004-01-09  Miguel de Icaza  <miguel@ximian.com>
11091
11092         * cs-tokenizer.cs (IsCastToken): Allow the various native types
11093         here to return true, as they can be used like this:
11094
11095                 (XXX) int.MEMBER ()
11096
11097         Fixed 49836 and all the other dups
11098
11099 2004-01-09  Zoltan Varga  <vargaz@freemail.hu>
11100
11101         * driver.cs: Implement /win32res and /win32icon.
11102
11103 2004-01-08  Miguel de Icaza  <miguel@ximian.com>
11104
11105         * cs-parser.jay: Add a rule to improve error handling for the
11106         common mistake of placing modifiers after the type.
11107
11108 2004-01-07  Miguel de Icaza  <miguel@ximian.com>
11109
11110         * cs-parser.jay (interface_event_declaration): Catch
11111         initialization of events on interfaces, and report cs0068
11112
11113         * cs-parser.jay (interface_event_declaration): Catch
11114         initialization of events. 
11115
11116         * ecore.cs: Better report missing constructors.
11117
11118         * expression.cs (Binary.ResolveOperator): My previous bug fix had
11119         the error reporting done in the wrong place.  Fix.
11120
11121         * expression.cs (Binary.ResolveOperator): Catch the 
11122         operator + (E x, E y) error earlier, and later allow for implicit
11123         conversions in operator +/- (E e, U x) from U to the underlying
11124         type of E.
11125
11126         * class.cs (TypeContainer.DefineDefaultConstructor): Fix bug
11127         52596, if the container class is abstract, the default constructor
11128         is protected otherwise its public (before, we were always public).
11129
11130         * statement.cs (Fixed.Resolve): Catch a couple more errors in the
11131         fixed statement.
11132
11133         (Using.EmitLocalVariableDecls): Applied patch from Benjamin
11134         Jemlich that fixes bug #52597, MCS was generating invalid code for
11135         idisposable structs.   Thanks to Ben for following up with this
11136         bug as well.
11137
11138 2004-01-06  Miguel de Icaza  <miguel@ximian.com>
11139
11140         * driver.cs: Allow assemblies without code to be generated, fixes
11141         52230.
11142
11143 2004-01-07  Nick Drochak <ndrochak@gol.com>
11144
11145         * attribute.cs: Remove unneeded catch variables. Eliminates a warning.
11146
11147 2004-01-05  Miguel de Icaza  <miguel@ximian.com>
11148
11149         * cs-parser.jay: Add rules to improve error reporting if fields or
11150         methods are declared at the namespace level (error 116)
11151
11152         * Add rules to catch event add/remove
11153
11154 2004-01-04  David Sheldon <dave-mono@earth.li>
11155
11156   * expression.cs: Added matching ")" to error message for 
11157   CS0077
11158
11159 2004-01-03 Todd Berman <tberman@gentoo.org>
11160
11161         * ecore.cs, attribute.cs:
11162         Applying fix from #52429.
11163
11164 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
11165
11166         * ecore.cs, expression.cs, statement.cs:
11167         Total rewrite of how we handle branching. We
11168         now handle complex boolean expressions with fewer
11169         jumps. As well if (x == 0) no longer emits a ceq.
11170
11171         if (x is Foo) is much faster now, because we generate
11172         better code.
11173
11174         Overall, we get a pretty big improvement on our benchmark
11175         tests. The code we generate is smaller and more readable.
11176
11177         I did a full two-stage bootstrap. The patch was reviewed
11178         by Martin and Miguel.
11179
11180 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
11181
11182         * cs-parser.jay: Make primary_expression not take a QI.
11183         we dont need this because the member_access rule covers
11184         us here. So we replace the rule with just IDENTIFIER.
11185
11186         This has two good effects. First, we remove a s/r conflict.
11187         Second, we allocate many fewer QualifiedIdentifier objects.
11188
11189 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
11190
11191         * attribute.cs: Handle MarshalAs attributes as pseudo, and
11192         set the correct information via SRE. This prevents
11193         hanging on the MS runtime. Fixes #29374.
11194
11195 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
11196
11197         * convert.cs: correctly handle conversions to value types
11198         from Enum and ValueType as unboxing conversions.
11199
11200         Fixes bug #52569. Patch by Benjamin Jemlich.
11201
11202 2004-01-02  Ravi Pratap  <ravi@ximian.com>
11203
11204         * expression.cs (BetterConversion): Prefer int -> uint
11205         over int -> ulong (csc's behaviour). This fixed bug #52046.
11206
11207 2004-01-02 Ben Maurer  <bmaurer@users.sourceforge.net>
11208
11209         * decl.cs (MemberCache.FindMembers): now returns a
11210         MemberInfo [].
11211
11212         * typemanager.cs: In general, go with with ^^.
11213         (CopyNewMethods): take an IList.
11214         (RealMemberLookup): Only allocate an arraylist
11215         if we copy from two sets of methods.
11216
11217         This change basically does two things:
11218         1) Fewer array lists allocated due to CopyNewMethods.
11219         2) the explicit cast in MemberList costed ALOT.
11220
11221 2004-01-02  Zoltan Varga  <vargaz@freemail.hu>
11222
11223         * cs-tokenizer.cs (consume_identifier) driver.cs: Cache identifiers in
11224         a hashtable to avoid needless string allocations when an identifier is
11225         used more than once (the common case).
11226
11227 2004-01-01 Ben Maurer  <bmaurer@users.sourceforge.net>
11228
11229         * pending.cs: MS's TypeBuilder.GetInterfaces ()
11230         is broken, it will not return anything. So, we
11231         have to use the information we have in mcs to
11232         do the task.
11233
11234         * typemanager.cs: Add a cache for GetInterfaces,
11235         since this will now be used more often (due to ^^)
11236
11237         (GetExplicitInterfaces) New method that gets the
11238         declared, not effective, interfaces on a type
11239         builder (eg, if you have interface IFoo, interface
11240         IBar, Foo : IFoo, Bar : Foo, IBar, GetExplInt (Bar) ==
11241         { IBar }.
11242
11243         This patch makes MCS able to bootstrap itself on
11244         Windows again.
11245
11246 2004-01-01 Ben Maurer  <bmaurer@users.sourceforge.net>
11247
11248         * expression.cs: Remove the Nop's that Miguel put
11249         in by mistake.
11250
11251 2003-12-31 Ben Maurer  <bmaurer@users.sourceforge.net>
11252
11253         * report.cs, codegen.cs: Give the real stack trace to
11254         the error when an exception is thrown.
11255
11256 2003-12-31 Ben Maurer  <bmaurer@users.sourceforge.net>
11257
11258         * decl.cs: only allocate hashtables for ifaces if 
11259         it is an iface!
11260
11261 2003-12-31 Ben Maurer  <bmaurer@users.sourceforge.net>
11262
11263         * expression.cs: fix the error from cs0121-2.cs
11264         (a parent interface has two child interfaces that
11265         have a function with the same name and 0 params
11266         and the function is called through the parent).
11267
11268 2003-12-30 Ben Maurer  <bmaurer@users.sourceforge.net>
11269
11270         * class.cs, rootcontext.cs, typmanager.cs: do not
11271         leak pointers.
11272
11273 2003-12-28 Ben Maurer  <bmaurer@users.sourceforge.net>
11274
11275         * codegen.cs: remove stack for the ec flow branching.
11276         It is already a linked list, so no need.
11277
11278 2003-12-27 Ben Maurer  <bmaurer@users.sourceforge.net>
11279
11280         * Makefile: Allow custom profiler here.
11281
11282 2003-12-26 Ben Maurer  <bmaurer@users.sourceforge.net>
11283
11284         * typemanager.cs (LookupType):
11285           - Use a static char [], because split takes
11286             a param array for args, so it was allocating
11287             every time.
11288           - Do not store true in a hashtable, it boxes.
11289
11290 2003-12-26 Ben Maurer  <bmaurer@users.sourceforge.net>
11291
11292         * flowanalysis.cs: bytify common enums.
11293
11294 2003-12-25 Ben Maurer  <bmaurer@users.sourceforge.net>
11295
11296         * modifiers.cs: Add a new set of flags for the
11297         flags allowed on explicit interface impls.
11298         * cs-parser.jay: catch the use of modifiers in
11299         interfaces correctly.
11300         * class.cs: catch private void IFoo.Blah ().
11301
11302         All related to bug #50572.
11303
11304 2003-12-25 Ben Maurer  <bmaurer@users.sourceforge.net>
11305
11306         * decl.cs: Rewrite the consistant accessability checking.
11307         Accessability is not linear, it must be implemented in
11308         a tableish way. Fixes #49704.
11309
11310 2003-12-25 Ben Maurer  <bmaurer@users.sourceforge.net>
11311
11312         * expression.cs: Handle negation in a checked context.
11313         We must use subtraction from zero. Fixes #38674.
11314
11315 2003-12-23 Ben Maurer  <bmaurer@users.sourceforge.net>
11316
11317         * class.cs: Ignore static void main in DLLs.
11318         * rootcontext.cs: Handle the target type here,
11319         since we are have to access it from class.cs
11320         * driver.cs: account for the above.
11321
11322 2003-12-23 Ben Maurer  <bmaurer@users.sourceforge.net>
11323
11324         * report.cs: Give line numbers and files if available.
11325
11326 2003-12-20  Zoltan Varga  <vargaz@freemail.hu>
11327
11328         * driver.cs: Implement /addmodule.
11329
11330         * typemanager.cs:  Change 'modules' field so it now contains Modules not
11331         ModuleBuilders.
11332
11333 2003-12-20  Martin Baulig  <martin@ximian.com>
11334
11335         * class.cs (TypeContainer.DefineMembers): Don't do the CS0649 check here.
11336         (FieldBase.IsAssigned): Removed this field.
11337         (FieldBase.SetAssigned): New public method.
11338         (TypeContainer.Emit): Make the CS0169/CS0649 checks actually work.
11339
11340 2003-12-20  Martin Baulig  <martin@ximian.com>
11341
11342         * expression.cs (LocalVariableReference.DoResolve): Don't set
11343         `vi.Used' if we're called from DoResolveLValue().
11344
11345         * statement.cs (Block.DoResolve): `ec.DoEndFlowBranching()' now
11346         returns the usage vector it just merged into the current one -
11347         pass this one to UsageWarning().
11348         (Block.UsageWarning): Take the `FlowBranching.UsageVector' instead
11349         of the `EmitContext', don't call this recursively on our children.
11350
11351 2003-12-19  Zoltan Varga  <vargaz@freemail.hu>
11352
11353         * driver.cs: Implement /target:module.
11354
11355 2003-12-18  Zoltan Varga  <vargaz@freemail.hu>
11356
11357         * support.cs (CharArrayHashtable): New helper class.
11358
11359         * cs-tokenizer.cs: Store keywords in a hashtable indexed by 
11360         char arrays, not strings, so we can avoid creating a string in
11361         consume_identifier if the identifier is a keyword.
11362
11363 2003-12-16  Martin Baulig  <martin@ximian.com>
11364
11365         * statement.cs (LocalInfo.Assigned): Removed this property.
11366         (LocalInfo.Flags): Removed `Assigned'.
11367         (LocalInfo.IsAssigned): New public method; takes the EmitContext
11368         and uses flow analysis.
11369         (Block.UsageWarning): Made this method private.
11370         (Block.Resolve): Call UsageWarning() if appropriate.
11371
11372         * expression.cs (LocalVariableReference.DoResolve): Always set
11373         LocalInfo.Used here.
11374
11375 2003-12-13  Martin Baulig  <martin@ximian.com>
11376
11377         * statement.cs (Statement.DoEmit, Statement.Emit): Don't return
11378         any value here; we're now using flow analysis to figure out
11379         whether a statement/block returns a value.
11380
11381 2003-12-13  Martin Baulig  <martin@ximian.com>
11382
11383         * flowanalysis.cs (UsageVector.MergeFinallyOrigins): Made this
11384         working again.
11385         (FlowBranching.MergeFinally): Don't call
11386         `branching.CheckOutParameters()' here, this is called in
11387         MergeTopBlock().
11388         (FlowBranchingException.AddSibling): Call MergeFinallyOrigins()
11389         when adding the `finally' vector.       
11390
11391 2003-12-13  Martin Baulig  <martin@ximian.com>
11392
11393         * flowanalysis.cs
11394         (UsageVector.MergeJumpOrigins, FlowBranching.Label): Make this
11395         actually work and also fix #48962.
11396
11397 2003-12-12 Ben Maurer  <bmaurer@users.sourceforge.net>
11398
11399         * decl.cs: Do not check System.Object for nested types,
11400         since we know it does not have any. Big bang for buck:
11401
11402         BEFORE:
11403            Run 1:   8.35 seconds
11404            Run 2:   8.32 seconds
11405            corlib:  17.99 seconds
11406         AFTER:
11407            Run 1:   8.17 seconds
11408            Run 2:   8.17 seconds
11409            corlib:  17.39 seconds
11410
11411 2003-12-11 Ben Maurer  <bmaurer@users.sourceforge.net>
11412
11413         * class.cs (FindMembers): Allocate arraylists on demand. Most of the
11414         time we are returning 0 members, so we save alot here.
11415
11416 2003-12-11  Martin Baulig  <martin@ximian.com>
11417
11418         * flowanalysis.cs (UsageVector.MergeResult): Renamed this back to
11419         `MergeChild()', also just take the `FlowBranching' as argument;
11420         call Merge() on it and return the result.
11421         (FlowBranching.Merge): We don't need to do anything if we just
11422         have one sibling.
11423
11424 2003-12-11  Martin Baulig  <martin@ximian.com>
11425
11426         * flowanalysis.cs: Use a list of `UsageVector's instead of storing
11427         them in an `ArrayList' to reduce memory usage.  Thanks to Ben
11428         Maurer for this idea.
11429
11430 2003-12-11  Martin Baulig  <martin@ximian.com>
11431
11432         * flowanalysis.cs (MergeResult): This class is now gone; we now
11433         use the `UsageVector' for this.  The reason for this is that if a
11434         branching just has one sibling, we don't need to "merge" them at
11435         all - that's the next step to do.
11436         (FlowBranching.Merge): We now return a `UsageVector' instead of a
11437         `MergeResult'.
11438
11439 2003-12-11  Martin Baulig  <martin@ximian.com>
11440
11441         Reworked flow analyis and made it more precise and bug-free.  The
11442         most important change is that we're now using a special `Reachability'
11443         class instead of having "magic" meanings of `FlowReturns'.  I'll
11444         do some more cleanups and optimizations and also add some more
11445         documentation this week.
11446
11447         * flowanalysis.cs (Reachability): Added `Throws' and `Barrier';
11448         largely reworked this class.
11449         (FlowReturns): Removed `Unreachable' and `Exception'; we now use
11450         the new `Reachability' class instead of having "magic" values here.
11451         (FlowBranching): We're now using an instance of `Reachability'
11452         instead of having separate `Returns', `Breaks' etc. fields.
11453
11454         * codegen.cs (EmitContext.EmitTopBlock): Set `has_ret' solely
11455         based on flow analysis; ignore the return value of block.Emit ().
11456
11457 2003-12-10  Zoltan Varga  <vargaz@freemail.hu>
11458
11459         * driver.cs typemanager.cs: Find the mono extensions to corlib even
11460         if they are private.
11461
11462 2003-12-09  Martin Baulig  <martin@ximian.com>
11463
11464         * flowanalyis.cs (FlowBranching.Return, Goto, Throw): Removed;
11465         call them directly on the UsageVector.
11466
11467 2003-12-09  Martin Baulig  <martin@ximian.com>
11468
11469         * flowanalysis.cs (FlowBranching.MergeChild, MergeTopBlock):
11470         Changed return type from `FlowReturns' to `Reachability'.
11471
11472 2003-12-09  Martin Baulig  <martin@ximian.com>
11473
11474         * flowanalysis.cs (FlowBranching.Reachability): New sealed class.
11475         (FlowBranching.MergeResult): Replaced the `Returns', `Breaks' and
11476         `Reachable' fields with a single `Reachability' one.
11477
11478 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
11479
11480         * class.cs (FindMembers): Remove foreach's.
11481
11482         Bootstrap times:
11483
11484         BEFORE
11485                 Run 1:   8.74 seconds
11486                 Run 2:   8.71 seconds
11487
11488         AFTER
11489                 Run 1:   8.64 seconds
11490                 Run 2:   8.58 seconds
11491
11492
11493 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
11494
11495         * cs-parser.jay:
11496         * gen-treedump.cs:
11497         * statement.cs:
11498         This patch does a few things:
11499                 1. EmptyStatement is now a singleton, so it is never reallocated.
11500                 2. All blah is EmptyStatement constructs have been changed to
11501                    blah == EmptyStatement.Value, which is much faster and valid
11502                    now that EmptyStatement is a singleton.
11503                 3. When resolving a block, rather than allocating a new array for
11504                    the non-empty statements, empty statements are replaced with
11505                    EmptyStatement.Value
11506                 4. Some recursive functions have been made non-recursive.
11507         Mainly the performance impact is from (3), however (1) and (2) are needed for
11508         this to work. (4) does not make a big difference in normal situations, however
11509         it makes the profile look saner.
11510
11511         Bootstrap times:
11512
11513         BEFORE
11514         9.25user 0.23system 0:10.28elapsed 92%CPU (0avgtext+0avgdata 0maxresident)k
11515         9.34user 0.13system 0:10.23elapsed 92%CPU (0avgtext+0avgdata 0maxresident)k
11516         Total memory allocated: 56397 KB
11517
11518         AFTER
11519         9.13user 0.09system 0:09.64elapsed 95%CPU (0avgtext+0avgdata 0maxresident)k
11520         8.96user 0.24system 0:10.13elapsed 90%CPU (0avgtext+0avgdata 0maxresident)k
11521         Total memory allocated: 55666 KB
11522
11523 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
11524
11525         * support.cs: Rewrite DoubleHash to use its own impl. Is faster
11526         than the hashtable in a hashtable version
11527
11528         * decl.cs: Right now, whenever we try to lookup a type inside a namespace,
11529         we always end up concating a string. This results in a huge perf
11530         loss, because many strings have to be tracked by the GC. In this
11531         patch, we first use a hashtable that works with two keys, so that
11532         the strings do not need to be concat'ed.
11533
11534         Bootstrap times:
11535         BEFORE
11536                 Run 1:   8.74 seconds
11537                 Run 2:   8.71 seconds
11538
11539         AFTER
11540                 Run 1:   8.65 seconds
11541                 Run 2:   8.56 seconds
11542
11543 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
11544
11545         * Makefile: Add a new target `do-time' that does a quick and simple
11546         profile, leaving easy to parse output.
11547
11548 2003-12-08  Zoltan Varga  <vargaz@freemail.hu>
11549
11550         * codegen.cs (Init): Create the dynamic assembly with 
11551         AssemblyBuilderAccess.Save, to enable some optimizations in the runtime.
11552
11553 2003-12-02 Ben Maurer  <bmaurer@users.sourceforge.net>
11554
11555         * support.cs: Make the PtrHashtable use only one
11556         instance of its comparer.
11557
11558 2003-11-30  Zoltan Varga  <vargaz@freemail.hu>
11559
11560         * typemanager.cs: Fix lookup of GetNamespaces.
11561
11562 2003-11-29  Miguel de Icaza  <miguel@ximian.com>
11563
11564         * expression.cs: Removed redundant line.
11565
11566         * statement.cs (Block.Resolve, Block.Emit): Avoid foreach on
11567         ArrayLists, use for loops with bounds.  
11568
11569         * flowanalysis.cs (FlowBranching.Merge): Avoid foreach on
11570         arraylist.
11571
11572         * expression.cs (Invocation.OverloadResolve): Avoid foreach on
11573         arraylists, use for loop with bounds.
11574
11575         The above three changes give us a 0.071 second performance
11576         improvement out of 3.294 seconds down to 3.223.  On my machine
11577         the above changes reduced the memory usage by 1,387 KB during
11578         compiler bootstrap.
11579
11580         * cs-parser.jay (QualifiedIdentifier): New class used to represent
11581         QualifiedIdentifiers.  Before we created a new string through
11582         concatenation, and mostly later on, the result would be
11583         manipulated by DecomposeQI through string manipulation.
11584
11585         This reduced the compiler memory usage for bootstrapping from
11586         59380 KB to 59007 KB on my machine, 373 KB, and also reduced the
11587         compile times in 0.05 seconds.
11588
11589 2003-11-28  Dick Porter  <dick@ximian.com>
11590
11591         * support.cs: Do string compares with the Invariant culture.
11592
11593         * rootcontext.cs: 
11594         * gen-treedump.cs: 
11595         * expression.cs: 
11596         * driver.cs: 
11597         * decl.cs: 
11598         * codegen.cs: 
11599         * class.cs: Use the char forms of IndexOf and LastIndexOf, so that
11600         the comparison is done with the Invariant culture.
11601
11602 2003-11-27  Miguel de Icaza  <miguel@ximian.com>
11603
11604         * statement.cs (Foreach.TryType): Use DeclaredOnly to find the
11605         GetEnumerator method.
11606
11607         (ProbeCollectionType): Iterate starting at the most specific type
11608         upwards looking for a GetEnumerator
11609
11610         * expression.cs: Shift count can be up to 31 for int/uint and 63
11611         for long/ulong.
11612
11613 2003-11-26  Miguel de Icaza  <miguel@ximian.com>
11614
11615         * statement.cs (Block.LookupLabel): Also look for the label on the
11616         children blocks.  Use a hash table to keep track of visited
11617         nodes. 
11618
11619         * cfold.cs (IntConstant to UIntConstant mapping): Only return if
11620         we actually did transform the other operand, otherwise fall back
11621         to the common codepath that casts to long.
11622
11623         * cs-tokenizer.cs: Use the same code pattern as the int case.
11624         Maybe I should do the parsing myself, and avoid depending on the
11625         Parse routines to get this done.
11626
11627 2003-11-25  Miguel de Icaza  <miguel@ximian.com>
11628
11629         * expression.cs: Apply fix from l_m@pacbell.net (Laurent Morichetti),  
11630         which fixes bug 51347.  This time test it.
11631
11632         * expression.cs: Make TypeOfVoid derive from TypeOf, so code in
11633         attributes for example can not tell the difference between these.
11634         The difference was only a syntax feature of the language. 
11635
11636         * attribute.cs: Apply attributes to delegates.
11637
11638         * delegate.cs: Call the apply attributes method.
11639
11640 2003-11-24  Miguel de Icaza  <miguel@ximian.com>
11641
11642         * convert.cs (TryImplicitIntConversion): One line bug fix: we were
11643         comparing 0 vs Byte.MinValue, not the value
11644
11645         (ImplicitConversionRequired): When reporting a conversion error,
11646         use error 31 to print out the constant error instead of the
11647         simpler 29.
11648
11649         * expression.cs: Apply fix from l_m@pacbell.net (Laurent Morichetti),  
11650         which fixes bug 51347.
11651
11652 2003-11-22  Miguel de Icaza  <miguel@ximian.com>
11653
11654         * driver.cs: Applied patch from gert.driesen@pandora.be (Gert Driesen) 
11655         which fixes the -warnaserror command line option.
11656
11657 2003-11-21  Miguel de Icaza  <miguel@ximian.com>
11658
11659         * cfold.cs (DoNumericPromotions): During constant folding of
11660         additions on UIntConstant, special case intconstants with
11661         IntConstants like we do on the expression binary operator. 
11662
11663 2003-11-12  Miguel de Icaza  <miguel@ximian.com>
11664
11665         * convert.cs (ImplicitReferenceConversion): We were missing a case
11666         (System.Enum are not value types or class types, so we need to
11667         classify them separatedly).
11668
11669         * driver.cs: We do not support error 2007.
11670
11671 2003-11-12 Jackson Harper <jackson@ximian.com>
11672
11673         * driver.cs: Use corlib.dll or mscorlib.dll when looking up the
11674         system directory. Also use the full file name so users can
11675         libraries names mscorlib-o-tron.dll in a non system dir.
11676         
11677 2004-01-04  David Sheldon <dave-mono@earth.li>
11678
11679         * expression.cs: Added matching ")" to error message for CS0077.
11680
11681 2003-12-19  Martin Baulig  <martin@ximian.com>
11682
11683         * typemanager.cs (TypeManager.IsEqualGenericType): New public
11684         static method; see documentation in the method.
11685         (TypeManager.IsSubclassOrNestedChild): Allow IsEqualGenericType().
11686
11687         * convert.cs (Convert.ImplicitReferenceConversion,
11688         Convert.ImplicitReferenceConversionExists): Add support for
11689         generic type declarations; see gen-36.cs.
11690
11691 2003-12-19  Martin Baulig  <martin@ximian.com>
11692
11693         * pending.cs (Pending.InterfaceMethod): Use
11694         `Type.IsAssignableFrom()' instead of `=='.
11695
11696 2003-12-18  Martin Baulig  <martin@ximian.com>
11697
11698         * decl.cs (DeclSpace.AsAccessible): Check for array, pointer and
11699         byref types first.
11700
11701         * convert.cs (Convert.ImplicitStandardConversionExists): Use
11702         `expr_type.Equals (target_type)' instead of `=='.
11703
11704 2003-12-08  Martin Baulig  <martin@ximian.com>
11705
11706         * generics.cs (Constraints.Types): Removed.
11707         (Constraints.Resolve): Just resolve everything to TypeExpr's, not
11708         to Type's.
11709         (Constraints.ResolveTypes): New public method; resolves the
11710         TypeExpr's to Type's.
11711         (TypeParameter.Define): TypeBuilder.DefineGenericParameter() no
11712         longer takes the constraints.
11713         (TypeParameter.DefineMethod): Likewise.
11714         (TypeParameter.DefineType): New public method.  Calls
11715         `TypeBuilder/MethodBuilder.SetGenericParameterConstraints()' to set
11716         the constraints.
11717
11718 2003-12-08  Martin Baulig  <martin@ximian.com>
11719
11720         * convert.cs (Convert.ImplicitConversionStandard): Use
11721         `expr_type.Equals (target_type)' instead of `=='.
11722
11723 2003-12-08  Martin Baulig  <martin@ximian.com>
11724
11725         * typemanager.cs (TypeManager.GetReferenceType): Call
11726         `Type.MakeByRefType ()'.
11727
11728 2003-12-08  Martin Baulig  <martin@ximian.com>
11729
11730         * cs-parser.jay, cs-tokenizer.cs: `where' is not a keyword, it
11731         just has some special meaning in some situations.  For instance,
11732         it is allowed to use `where' as the name of a variable etc.
11733
11734 2003-12-04  Martin Baulig  <martin@ximian.com>
11735
11736         * expression.cs (ComposedCast.DoResolveAsTypeStep): Use
11737         `Type.MakeArrayType()' for array types.
11738
11739 2003-11-18  Miguel de Icaza  <miguel@ximian.com>
11740
11741         * expression.cs (Invocation.VerifyArgumentsCompat): Remove
11742         debugging message.
11743
11744         (SizeOf.DoResolve): assign the `type_queried' field.  This gets
11745         corlib to compile.
11746
11747 2003-11-16  Martin Baulig  <martin@ximian.com>
11748
11749         * codegen.cs (EmitContext.IsGeneric): Removed.
11750
11751         * ecore.cs (SimpleName.ResolveAsTypeStep): Always call
11752         ResolveGeneric() on the DeclSpace.
11753
11754 2003-11-16  Martin Baulig  <martin@ximian.com>
11755
11756         * generic.cs (TypeArguments.Resolve):
11757         `Expression.ResolveAsTypeTerminal()' returns a TypeExpr; call
11758         `ResolveType()' on it to get the Type.
11759
11760 2003-11-15  Martin Baulig  <martin@ximian.com>
11761
11762         * generic.cs (ConstructedType.GetInterfaces): Override this.
11763
11764 2003-11-14  Martin Baulig  <martin@ximian.com>
11765
11766         * interface.cs (Interface.DefineType): Define all type parameters
11767         before adding the interfaces we inherit.
11768
11769 2003-11-11  Martin Baulig  <martin@ximian.com>
11770
11771         * generic.cs (ConstructedType.ResolveType): Always call
11772         `gt.BindGenericParameters (atypes)'; also if `args.HasTypeArguments'.
11773
11774 2003-11-10  Martin Baulig  <martin@ximian.com>
11775
11776         * typemanager.cs (TypeManager.ResolveExpressionTypes): Removed.
11777         (TypeManager.InitCoreTypes): Initialize them here, but instead of
11778         calling `ResolveType()' on them, directly assign their `Type'.
11779
11780 2003-11-08  Martin Baulig  <martin@ximian.com>
11781
11782         * generic.cs (ConstructedType): Override `IsClass' etc.
11783
11784 2003-11-08  Martin Baulig  <martin@ximian.com>
11785
11786         * class.cs (TypeContainer.GetClassBases): Use TypeExpr's for the
11787         return value and the `out parent' parameter.
11788         (TypeContainer.DefineType): Moved the CS0644 check into
11789         GetClassBases().  Don't pass the interface types to the
11790         `builder.DefineType()'/`builder.DefineNestedType()', but resolve
11791         them later and then call `TypeBuilder.AddInterfaceImplementation()'.
11792
11793         * ecore.cs (TypeExpr.IsAttribute): New property.
11794         (TypeExpr.GetInterfaces): New method.
11795
11796         * interface.cs (Interface.GetInterfaceTypeByName): Return a
11797         TypeExpr instead of a Type.
11798         (Interface.GetInterfaceBases): Return TypeExpr's instead of Type's.
11799         (Interface.DefineType): Don't pass the interface types to the
11800         `builder.Definetype()'/`builder.DefineNestedType()', but resolve
11801         them later and then call `TypeBulider.AddInterfaceImplementation()'.
11802
11803         * typemanager.cs (TypeManager.AddUserType): Take a `TypeExpr[]'
11804         instead of a `Type[]'.
11805         (TypeManager.RegisterBuilder): Likewise.
11806         (TypeManager.AddUserInterface): Likewise.
11807         (TypeManager.ExpandInterfaces): Take a `Type[]' instead of a
11808         `Type[]' and also return a `TypeExpr[]'.
11809         (TypeManager.GetInterfaces): Return a `TypeExpr[]'.
11810
11811 2003-11-08  Martin Baulig  <martin@ximian.com>
11812
11813         * decl.cs (DeclSpace.ResolveTypeExpr): Return a TypeExpr, not an
11814         Expression.     
11815
11816 2003-11-08  Martin Baulig  <martin@ximian.com>
11817
11818         * decl.cs (DeclSpace.GetTypeResolveEmitContext): Call
11819         TypeManager.ResolveExpressionTypes().
11820
11821         * ecore.cs (Expression.ResolveAsTypeTerminal): Return a TypeExpr
11822         instead of an Expression.
11823         (TypeExpr): This is now an abstract base class for `TypeExpression'.
11824         (TypeExpression): New public class; formerly known as `TypeExpr'.
11825
11826         * expression.cs (ComposedCast): Derive from TypeExpr.
11827
11828         * typemanager.cs (TypeManager.system_*_expr): These are now
11829         TypExpr's instead of Expression's.
11830         (TypeManager.ResolveExpressionTypes): New public static function;
11831         called from DeclSpace.GetTypeResolveEmitContext() to resolve all
11832         of them.        
11833
11834 2003-11-06  Miguel de Icaza  <miguel@ximian.com>
11835
11836         * expression.cs (New.DoResolve): Do not dereference value that
11837         might be a null return.
11838
11839         * statement.cs (Block.EmitMeta): Use the Const.ChangeType to make
11840         sure that the constant value has the right type.  Fixes an
11841         unreported bug, similar to 50425.
11842
11843         * const.cs (Const.LookupConstantValue): Call
11844         ImplicitStandardConversionExists before doing a conversion to
11845         avoid havng the TypeManager.ChangeType do conversions.
11846
11847         Reduced the number of casts used
11848
11849         (Const.ChangeType): New routine to enable reuse of the constant
11850         type changing code from statement.
11851
11852         * typemanager.cs (ChangeType): Move common initialization to
11853         static global variables.
11854
11855         Fixes #50425.
11856
11857         * convert.cs (ImplicitReferenceConversion): Somehow we allowed
11858         every value type to go through, even if it was void.  Fix that. 
11859
11860         * cs-tokenizer.cs: Use is_identifier_start_character on the start
11861         character of the define, and the is_identifier_part_character for
11862         the rest of the string.
11863
11864 2003-11-05  Miguel de Icaza  <miguel@ximian.com>
11865
11866         * expression.cs (UnaryMutator.EmitCode): When I updated
11867         LocalVariableReference.DoResolve, I overdid it, and dropped an
11868         optimization done on local variable references.
11869
11870 2003-11-04  Miguel de Icaza  <miguel@ximian.com>
11871
11872         * ecore.cs: Convert the return from Ldlen into an int.
11873
11874 2003-10-20  Miguel de Icaza  <miguel@ximian.com>
11875
11876         * decl.cs (DeclSpace.GetAccessLevel): Handle NotPublic case for
11877         the accessibility, this is a special case for toplevel non-public
11878         classes (internal for instance).
11879
11880 2003-10-20  Nick Drochak <ndrochak@gol.com>
11881
11882         * ecore.cs: Fix typo and build.  Needed another right paren.
11883
11884 2003-10-19  Miguel de Icaza  <miguel@ximian.com>
11885
11886         * ecore.cs: Applied fix from Ben Maurer.   We were handling in the
11887         `internal' case regular and protected, but not allowing protected
11888         to be evaluated later.  Bug 49840
11889
11890 2003-10-15  Miguel de Icaza  <miguel@ximian.com>
11891
11892         * statement.cs (Switch.TableSwitchEmit): Compare the upper bound
11893         to kb.Nlast, and not the kb.nFirst to isolate the switch
11894         statement.
11895
11896         Extract the underlying type, so enumerations of long/ulong are
11897         treated like long/ulong.
11898
11899 2003-10-14  Miguel de Icaza  <miguel@ximian.com>
11900
11901         * expression.cs (New): Overload the meaning of RequestedType to
11902         track the possible creation of the NewDelegate type, since
11903         DoResolve is invoked more than once for new constructors on field
11904         initialization.
11905
11906         See bugs: #48800 and #37014
11907
11908         * cs-parser.jay (declare_local_constants): Take an arraylist
11909         instead of a single constant.
11910
11911         (local_constant_declaration): It should take a
11912         constant_declarators, not a constant_declarator.  Fixes 49487
11913
11914         * convert.cs: Fix error report.
11915
11916 2003-10-13 Jackson Harper <jackson@ximian.com>
11917
11918         * typemanager.cs (TypeToCoreType): Add float and double this fixes
11919         bug #49611
11920         
11921 2003-11-03  Martin Baulig  <martin@ximian.com>
11922
11923         * expression.cs (ArrayAccess.GetStoreOpcode): Added
11924         `out bool has_type_arg'; if set, we need to pass the type to
11925         ig.Emit().
11926         (ArrayAccess.GetStoreOpcode, ArrayAccess.EmitLoadOpcode): Use
11927         Stelem_Any/Ldelem_Any for generic parameters.   
11928
11929 2003-11-02  Martin Baulig  <martin@ximian.com>
11930
11931         * expression.cs (Invocation.EmitCall): Use
11932         `TypeManager.IsValueType()' to check whether it's a value type.
11933         Don't set `struct_call' when calling a method on a type parameter.
11934
11935 2003-11-02  Martin Baulig  <martin@ximian.com>
11936
11937         * generics.cs (ConstructedType.Resolve): Renamed to ResolveType()
11938         and removed the TypeBuilder argument.
11939
11940         * typemanager.cs (TypeManager.IsValueType): Return
11941         `t.IsGenericParameter || t.IsValueType'.
11942
11943 2003-10-25  Martin Baulig  <martin@ximian.com>
11944
11945         * decl.cs (DeclSpace.ResolveType): If we're a ConstructedType,
11946         call ConstructedType.Resolve() on it.
11947
11948         * generic.cs (ConstructedType.Resolve): Set `type' on success.
11949
11950 2003-10-25  Martin Baulig  <martin@ximian.com>
11951
11952         * class.cs (TypeContainer.GetClassBases): Changed
11953         `out Type parent' into `out TypeExpr parent'.  Moved CS0644 and
11954         CS8214 reporting here.
11955         (TypeContainer.DefineType): GetClassBases() gives us a `TypeExpr'
11956         instead of a `Type' for our parent.  In case of a recursive
11957         declaration (see tests/gen-23.cs for an example), our parent is a
11958         ConstructedType and it doesn't have its type set.  So, first
11959         create our own TypeBuilder, then call constructed.Resolve() to get
11960         the parent's type and finally TypeBuilder.SetParent() it.
11961
11962         * ecore.cs (TypeExpr.Name): New public virtual property.
11963
11964         * generic.cs
11965         (ConstructedType): We're now a TypeExpr and not just an Expression.
11966         (ConstructedType.ResolveAsTypeStep): Don't resolve our type
11967         arguments here; this is done later.
11968         (ConstructedType.Resolve): New public method to resolve the type
11969         arguments and bind them.
11970
11971 2003-10-21  Martin Baulig  <martin@ximian.com>
11972
11973         * convert.cs: Use `TypeManager.IsValueType' instead of
11974         'type.IsValueType' everywhere.
11975
11976         * typemanager.cs (TypeManager.IsValueType): Return true for type
11977         parameters.  The reason for this is that we need to box a type
11978         parameter when converting it to a reference type.
11979
11980         * cs-parser.jay: Added support for default value expressions.
11981
11982         * generics.cs (DefaultValueExpression): New public class.       
11983
11984 2003-10-17  Martin Baulig  <martin@ximian.com>
11985
11986         * generic.cs (Constraints.Resolve): Take a DecpSpace instead of a
11987         TypeContainer so we can also use this for Interfaces.
11988         (TypeParameter.Resolve): Likewise.
11989
11990         * interface.cs (Interface.DefineType): Added support for generic
11991         interfaces.
11992
11993         * cs-parser.jay: Added support for generic structs and interfaces.
11994
11995 2003-10-17  Martin Baulig  <martin@ximian.com>
11996
11997         * generic.cs (GenericMemberAccess.DoResolve): We can now actually
11998         call generic methods :-)
11999
12000 2003-10-16  Martin Baulig  <martin@ximian.com>
12001
12002         * cs-parser.jay (namespace_or_type_name): Only create a
12003         GenericMemberAccess if we actually have type arguments.
12004
12005 2003-10-13  Martin Baulig  <martin@ximian.com>
12006
12007         * class.cs (Method.Define): If we're a generic method, call
12008         TypeBuilder.DefineGenericMethod () before resolving
12009         the parameters.
12010         (MethodData): Added .ctor which takes an additional MethodBuilder
12011         argument; this is used for generic methods.
12012         (MethodData.Define): Call `builder.SetGenericMethodSignature()' if
12013         we already have a MethodBuilder.
12014
12015 2003-10-10  Martin Baulig  <martin@ximian.com>
12016
12017         * class.cs (Method): Added .ctor which takes a `GenericMethod'
12018         instead of a `DeclSpace'.  This is used for generic methods.
12019
12020         * cs-parser.jay (method_header): Added support for generic
12021         methods; create a `GenericMethod' instance and pass it to the
12022         `Method's .ctor; it'll be used as the `DeclSpace' to lookup
12023         parameters and locals.
12024
12025         * decl.cs (DeclSpace.SetParameterInfo): Removed Location argument
12026         since we already have the location.  Check whether we're a generic
12027         type declaration or a generic method and create the correct type
12028         parameter.
12029
12030         * generic.cs (TypeParameter.DefineMethod): New public method.
12031         (GenericMethod): New public class; derives from DeclSpace and is
12032         used for generic methods.       
12033
12034 2003-10-09  Martin Baulig  <martin@ximian.com>
12035
12036         * class.cs (MethodCore): Added additional `DeclSpace ds' argument
12037         to the .ctor.
12038         (MethodCore.DoDefineParameters): Removed the TypeContainer
12039         argument; use the DeclSpace which was passed to the .ctor instead.
12040         (MethodCore.CheckParameter): Take a DeclSpace instead of a
12041         TypeContainer; we only need a DeclSpace here.
12042
12043 2003-10-09  Martin Baulig  <martin@ximian.com>
12044
12045         * class.cs (MethodData): Added additional `DeclSpace ds' argument
12046         to the .ctor.
12047         (MethodData.Define, MethodData.Emit): Pass the `ds' to the
12048         EmitContext's .ctor.    
12049
12050 2003-10-09  Martin Baulig  <martin@ximian.com>
12051
12052         * decl.cs (DeclSpace.AsAccessible): Moved here from TypeContainer.
12053         (AccessLevel, CheckAccessLevel, GetAccessLevel): They're used by
12054         AsAccessible(), moved them as well.
12055
12056         * class.cs (TypeContainer.AsAccessible): Moved to DeclSpace.
12057
12058 2003-10-07  Miguel de Icaza  <miguel@ximian.com>
12059
12060         * expression.cs (Binary.Emit.GreatherThanOrEqual): Fix the code
12061         generation for >=, as spotted by Paolo, bug 48679.  
12062         Patch from David Waite.
12063
12064         * cs-tokenizer.cs: Add handling for #pragma.
12065
12066         * cs-parser.jay: Allow for both yield and yield return in the
12067         syntax.  The anti-cobolization of C# fight will go on!
12068
12069         * class.cs (TypeBuilder.DefineType): Catch error condition here
12070         (Parent.DefineType erroring out and returning null).
12071
12072         * expression.cs (ArrayCreation.EmitDynamicInitializers): When
12073         coping with enumerations variables, we were mistakenly processing
12074         them as a regular value type instead of built-in types.  Fixes the
12075         bug #48063
12076
12077         * typemanager.cs (IsBuiltinOrEnum): New method.
12078
12079 2003-09-30  Miguel de Icaza  <miguel@ximian.com>
12080
12081         * cs-parser.jay: Upgrade: yield now needs the return clause.
12082
12083 2003-10-08  Atsushi Enomoto <ginga@kit.hi-ho.ne.jp>
12084
12085         * cs-parser.jay : Renamed yyName to yyNames related to jay.
12086
12087 2003-09-29  Martin Baulig  <martin@ximian.com>
12088
12089         * typemanager.cs (TypeManager.GetMethodFlags): Added support for
12090         inflated generic methods.
12091
12092         * generics.cs (ConstructedType): Distinguish between open and
12093         closed constructed types; correctly resolve the arguments.
12094
12095 2003-09-22  Martin Baulig  <martin@ximian.com>
12096
12097         * generic.cs (ConstructedType.ResolveAsTypeCheck): Check whether
12098         all type arguments meet their constraints.
12099
12100 2003-09-19  Martin Baulig  <martin@ximian.com>
12101
12102         * decl.cs (MemberCache.SetupCacheForInterface): Take a
12103         `MemberCache parent' argument.  Normally, an interface doesn't
12104         have a parent type except System.Object, but we use this in gmcs
12105         for generic type parameters.
12106
12107 2003-09-18  Martin Baulig  <martin@ximian.com>
12108
12109         * typemanager.cs (TypeHandle.ctor): Set `IsInterface' solely based
12110         on `type.IsInterface'; don't check whether the type has a parent
12111         to determine whether it's an interface.
12112
12113 2003-09-17  Martin Baulig  <martin@ximian.com>
12114
12115         * generic.cs (ConstructedType.ToString): Always use `name' as the
12116         type name.
12117
12118 2003-09-15  Martin Baulig  <martin@ximian.com>
12119
12120         * cs-parser.jay: Fix grammar wrt. type_parameter_constraints.
12121
12122         * generic.cs (Constraints.Resolve): New public method; this is
12123         called to resolve the constraint types and to check whether all
12124         the constraints are correct.
12125         (Constraints.Types): New public property.
12126         (TypeParameter.Resolve): New public method; resolves all the
12127         type's constraints.
12128
12129         * class.cs (TypeContainer.DefineType): Call
12130         TypeParameter.Resolve() before actually defining the type.
12131
12132 2003-09-15  Martin Baulig  <martin@ximian.com>
12133
12134         * class.cs (TypeContainer.DefineType): Added an error flag to
12135         avoid reporting duplicate CS0146's ("class definition is
12136         circular.").
12137
12138         * driver.cs (Driver.MainDriver): Abort if
12139         RootContext.ResolveTree() reported any errors.
12140
12141 2003-09-07  Martin Baulig  <martin@ximian.com>
12142
12143         * report.cs (Error, Warning): Added overloaded versions which take
12144         a `params object[] args' and call String.Format().
12145
12146 2003-09-07  Martin Baulig  <martin@ximian.com>
12147
12148         * decl.cs (DeclSpace..ctor): Don't call
12149         NamespaceEntry.DefineName() here; do it in RecordDecl() which is
12150         called from Tree.RecordDecl().  Fixes the CS0101 reporting.
12151         (DeclSpace.RecordDecl): New method.
12152
12153         * tree.cs (Tree.RecordDecl): Call ds.RecordDecl().
12154
12155 2003-09-02  Ravi Pratap  <ravi@ximian.com>
12156
12157         * attribute.cs (CheckAttributeTarget): Ensure that we allow return
12158         value attributes to be applied to ParameterBuilders.
12159
12160         * class.cs (MethodCore.LabelParameters): Make static and more
12161         generic so that it can be used from other places - like interface
12162         methods, for instance.
12163
12164         * interface.cs (Interface.Emit): Call LabelParameters before
12165         emitting attributes on the InterfaceMethod.
12166
12167 2003-09-07  Martin Baulig  <martin@ximian.com>
12168
12169         * generic.cs (ConstructedType.ResolveAsTypeStep): Report a CS8217
12170         if the number of type parameters doesn't match.
12171
12172 2003-09-04  Martin Baulig  <martin@ximian.com>
12173
12174         * expression.cs (ComposedCast.ResolveAsTypeStep): Added support
12175         for arrays of generic type params (ie. `!0[]').
12176
12177 2003-09-04  Martin Baulig  <martin@ximian.com>
12178
12179         * class.cs (TypeContainer.AsAccessible): Ignore generic parameters
12180         for the moment.
12181
12182 2003-09-04  Martin Baulig  <martin@ximian.com>
12183
12184         * decl.cs (DeclSpace.LookupGeneric): New method.
12185         (DeclSpace.CheckAccessLevel): Ignore generic parameters for the
12186         moment.
12187
12188         * generic.cs (TypeParameterExpr): Take a TypeParameter as
12189         argument, not just a string.
12190         (TypeParameter.Define): New public method; this is called to
12191         actually define the generic parameter; after this, you can use the
12192         new `Type' property to get the type.
12193
12194 2003-09-04  Martin Baulig  <martin@ximian.com>
12195
12196         * decl.cs (DeclSpace.SetParameterInfo): The `constraints' argument
12197         is now an ArrayList; initialize the result of the `TypeParameters'
12198         property here.
12199         (DeclSpace.GetGenericData): Removed.
12200         (DeclSpace.LookupGeneric): Temporarily removed; we need to
12201         implement this in a different way.
12202         (DeclSpace.GetTypeParameters): Removed; there's now a
12203         `TypeParameters' property.
12204         (DeclSpace.TypeParameters): New public property.
12205
12206         * generic.cs (Constraints): Make this class public.
12207         (TypeParameter): New public class.
12208
12209 2003-09-04  Martin Baulig  <martin@ximian.com>
12210
12211         * decl.cs (DeclSpace.GetTypeParameters): New method to return the
12212         generic parameters.
12213
12214         * class.cs (TypeContainer.DefineType): Call
12215         TypeBuilder.DefineGenericParameter () on all generic parameters if
12216         this is a generic type.
12217
12218 2003-08-28  Martin Baulig  <martin@ximian.com>
12219
12220         * sample-stack.il: Compile this with ilasm: "ilasm /dll
12221         sample-stack.il".
12222
12223         * sample-hello.cs: Compile this with gmcs: "gmcs
12224         /r:sample-stack.dll sample-hello.cs".
12225
12226 2003-08-28  Martin Baulig  <martin@ximian.com>
12227
12228         * generic.cs (ConstructedType.ResolveAsTypeStep): Actually bind
12229         the parameters to the generic type.
12230
12231 2003-08-28  Martin Baulig  <martin@ximian.com>
12232
12233         * cs-tokenizer.cs (parse_less_than): Also allow all builtin types.
12234
12235 2003-08-28  Martin Baulig  <martin@ximian.com>
12236
12237         * cs-parser.jay (opt_type_argument_list): Use
12238         `OP_GENERICS_LT type_arguments OP_GENERICS_GT'.
12239         (primary_expression): Replace `qualified_identifier' with `type_name'.
12240         (type_parameter_list): Use `OP_GENERICS_LT type_parameters OP_GENERICS_GT'.
12241
12242         * cs-tokenizer.cs (is_punct): When reading a `<', invoke a custom
12243         parser to check whether it is syntactically a type parameter list;
12244         return OP_GENERICS_LT/OP_GENERICS_GT instead of OP_LT/OP_GT in
12245         this case.
12246
12247 2003-08-26  Martin Baulig  <martin@ximian.com>
12248
12249         * ecore.cs (SimpleName.SimpleNameResolve): Look for members before
12250         resolving aliases; fixes #47927.
12251
12252 2003-08-26  Martin Baulig  <martin@ximian.com>
12253
12254         * statement.cs (Using.DoResolve): This is internally emitting a
12255         try/finally clause, so we need to set ec.NeedExplicitReturn if we
12256         do not always return.  Fixes #47681.
12257
12258 2003-08-26  Martin Baulig  <martin@ximian.com>
12259
12260         * decl.cs (MemberCore): Moved WarningNotHiding(),
12261         Error_CannotChangeAccessModifiers() and CheckMethodAgainstBase()
12262         into MemberBase.
12263         (AdditionResult): Make this nested in DeclSpace.
12264         (DeclSpace.ctor): The .ctor now takes an additional NamespaceEntry
12265         argument; call NamespaceEntry.Define() unless we're nested in a
12266         class or struct.
12267
12268         * namespace.cs (Namespace.DefineName): New public function.  This
12269         is called from DeclSpace's .ctor to add 
12270         (Namespace.Lookup): Include DeclSpaces in the lookup.
12271
12272         * class.cs (Operator): Derive from MemberBase, not MemberCore.
12273
12274         * const.cs (Const): Derive from MemberBase, not MemberCore.     
12275
12276 2003-08-25  Martin Baulig  <martin@ximian.com>
12277
12278         * convert.cs (Convert.ExplicitReferenceConversion): When
12279         converting from an interface type to a class, unbox if the target
12280         type is a struct type.  Fixes #47822.
12281
12282 2003-08-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
12283
12284         * typemanager.cs: fixed the values of MethodFlags. Closes #47855 and
12285         #47854.
12286
12287 2003-08-22  Martin Baulig  <martin@ximian.com>
12288
12289         * class.cs (TypeManager.DefineType): When defining a nested type,
12290         call DefineType() on our parent; fixes #47801.
12291
12292 2003-08-22  Martin Baulig  <martin@ximian.com>
12293
12294         * class.cs (MethodData.Define): While checking if a method is an
12295         interface implementation, improve the test a bit more to fix #47654.
12296
12297 2003-08-22  Martin Baulig  <martin@ximian.com>
12298
12299         * expression.cs (Probe.DoResolve): Check whether `expr' resolved
12300         correctly; fixes #47722.
12301
12302 2003-08-22  Martin Baulig  <martin@ximian.com>
12303
12304         * expression.cs (UnaryMutator.ResolveVariable): If the target is a
12305         LocalVariableReference, ensure it's not read-only.  Fixes #47536.
12306
12307         * statement.cs (Fixed.DoResolve): Make all variables read-only. 
12308
12309 2003-08-22  Martin Baulig  <martin@ximian.com>
12310
12311         * ecore.cs (FieldExpr.DoResolveLValue): Static read-only fields
12312         can only be assigned in static constructors.  Fixes #47161.
12313
12314 2003-08-22  Martin Baulig  <martin@ximian.com>
12315
12316         Rewrote and improved the flow analysis code.
12317
12318         * flowbranching.cs (FlowBranching): Make this class abstract.
12319         (FlowBranching.CreateBranching): New static function to create a
12320         new flow branching.
12321         (FlowBranchingBlock, FlowBranchingException): New classes.
12322         (FlowBranching.UsageVector.Type): New public readonly field.
12323         (FlowBranching.UsageVector.Breaks): Removed the setter.
12324         (FlowBranching.UsageVector.Returns): Removed the setter.
12325         (FlowBranching.UsageVector): Added Break(), Return(),
12326         NeverReachable() and Throw() methods to modify the reachability.
12327         (FlowBranching.UsageVector.MergeChildren): Removed, this is now
12328         done by FlowBranching.Merge().
12329         (FlowBranching.UsageVector.MergeChild): New method; merges the
12330         merge result into the current vector.
12331         (FlowBranching.Merge): New abstract method to merge a branching.
12332
12333 2003-08-12  Martin Baulig  <martin@ximian.com>
12334
12335         * expression.cs (Indirection.CacheTemporaries): Create the
12336         LocalTemporary with the pointer type, not its element type.
12337
12338 2003-08-10  Miguel de Icaza  <miguel@ximian.com>
12339
12340         * cs-parser.jay: FIRST_KEYWORD, LAST_KEYWORD: used to know if a
12341         token was a keyword or not.
12342
12343         Add `error' options where an IDENTIFIER was expected;  Provide
12344         CheckToken and CheckIdentifierToken convenience error reporting
12345         functions. 
12346
12347         Do not use `DeclSpace.Namespace', use `DeclSpace.NamespaceEntry'.
12348
12349         * decl.cs: Rename `NamespaceEntry Namespace' public field into
12350         NameSpaceEntry NameSpaceEntry.
12351
12352         (LookupInterfaceOrClass): Avoid creating a full qualified name
12353         from namespace and name: avoid doing lookups when we know the
12354         namespace is non-existant.   Use new Tree.LookupByNamespace which
12355         looks up DeclSpaces based on their namespace, name pair.
12356
12357         * driver.cs: Provide a new `parser verbose' to display the
12358         exception thrown during parsing.  This is turned off by default
12359         now, so the output of a failure from mcs is more graceful.
12360
12361         * namespace.cs: Track all the namespaces defined in a hashtable
12362         for quick lookup.
12363
12364         (IsNamespace): New method
12365
12366 2003-08-09  Miguel de Icaza  <miguel@ximian.com>
12367
12368         * namespace.cs: Remove redundant call;  Avoid using MakeFQN when
12369         we know that we need to concatenate (full typename can never be
12370         null). 
12371
12372         * class.cs: ditto.
12373
12374         * statement.cs: Use a bitfield;  Do not initialize to null things
12375         which are done by the constructor by default.
12376
12377         * cs-parser.jay: bug fix, parameter was 4, not 3.
12378
12379         * expression.cs: Just use the property;
12380
12381         * statement.cs: No need for GetVariableInfo method.
12382
12383 2003-08-08  Martin Baulig  <martin@ximian.com>
12384
12385         * flowanalysis.cs (FlowReturns): This is now nested in the
12386         `FlowBranching' class.
12387         (MyBitVector): Moved this here from statement.cs.
12388         (FlowBranching.SiblingType): New enum type.
12389         (FlowBranching.CreateSibling): Added `SiblingType' argument.
12390
12391 2003-08-07  Martin Baulig  <martin@ximian.com>
12392
12393         * flowanalysis.cs (FlowBranchingType): This is now nested in the
12394         `FlowBranching' class and called `BranchingType'.
12395
12396 2003-08-07  Martin Baulig  <martin@ximian.com>
12397
12398         * flowanalysis.cs: Moved all the control flow analysis code into
12399         its own file.
12400
12401 2003-08-07  Martin Baulig  <martin@ximian.com>
12402
12403         * assign.cs (Assign.DoResolve): `target' must either be an
12404         IAssignMethod or an EventAccess; report a CS0131 otherwise.  Fixes
12405         #37319.
12406
12407 2003-08-07  Miguel de Icaza  <miguel@ximian.com>
12408
12409         * expression.cs (BinaryMethod): This kind of expression is created by the
12410         Binary class if it determines that the operator has to be handled
12411         by a method.
12412
12413         (BinaryDelegate): This kind of expression is created if we are
12414         dealing with a + or - operator on delegates.
12415
12416         (Binary): remove method, argumetns, and DelegateOperator: when
12417         dealing with methods, 
12418
12419         * ecore.cs (EventExpr.EmitAddOrRemove): Update to new layout.
12420
12421         * statement.cs (Block): use bitfields for the three extra booleans
12422         we had in use.   Remove unused topblock parameter.
12423
12424         * codegen.cs: Remove unecessary argument to Block.EmitTopBlock
12425
12426         * assign.cs: Drop extra unneeded tests.
12427
12428 2003-08-06  Miguel de Icaza  <miguel@ximian.com>
12429
12430         * iterators.cs (Mapvariable): provide a mechanism to use prefixes.
12431
12432         * statement.cs (Foreach): Use VariableStorage instead of
12433         LocalBuilders.   
12434
12435         * codegen.cs (VariableStorage): New class used by clients that
12436         require a variable stored: locals or fields for variables that
12437         need to live across yield.
12438
12439         Maybe provide a convenience api for EmitThis+EmitLoad?
12440
12441         (GetTemporaryLocal, FreeTemporaryLocal): Recycle
12442         these bad boys.
12443
12444 2003-08-05  Miguel de Icaza  <miguel@ximian.com>
12445
12446         * codegen.cs (RemapLocal, RemapLocalLValue, RemapParameter,
12447         RemapParameterLValue): New methods that are used to turn a
12448         precomputed FieldInfo into an expression like this:
12449
12450                 instance.FieldInfo
12451
12452         The idea is to use this instead of making LocalVariableReference
12453         have more than one meaning.
12454
12455         * cs-parser.jay: Add error production to BASE.
12456
12457         * ecore.cs: Deal with TypeManager.GetField returning null, which
12458         is now a valid return value.
12459
12460         (FieldExprNoAddress): New expression for Fields whose address can
12461         not be taken.
12462
12463         * expression.cs (LocalVariableReference): During the resolve
12464         phases, create new expressions if we are in a remapping context.
12465         Remove code that dealt with remapping here.
12466
12467         (ParameterReference): same.
12468
12469         (ProxyInstance): New expression, like the `This' expression, but
12470         it is born fully resolved.  We know what we are doing, so remove
12471         the errors that are targeted to user-provided uses of `this'.
12472
12473         * statement.cs (Foreach): our variable is now stored as an
12474         Expression;  During resolution, follow the protocol, dont just
12475         assume it will return this.
12476
12477 2003-08-06  Martin Baulig  <martin@ximian.com>
12478
12479         * support.cs (SeekableStreamReader.cs): New public class.
12480
12481         * cs-tokenizer.cs, cs-parser.jay, driver.cs: Use the new
12482         SeekableStreamReader instead of the normal StreamReader.
12483
12484 2003-08-04  Martin Baulig  <martin@ximian.com>
12485
12486         * cs-parser.jay (CLOSE_PARENS_CAST, CLOSE_PARENS_NO_CAST,
12487         CLOSE_PARENS_OPEN_PARENS, CLOSE_PARENS_MINUS): New tokens to
12488         deambiguate casts and delegate invocations.
12489         (parenthesized_expression): Use the new tokens to ensure this is
12490         not a cast of method invocation.
12491
12492         * cs-tokenizer.cs (is_punct): Return one of the new special tokens
12493         when reading a `)' and Deambiguate_CloseParens () was previously
12494         called.
12495
12496         * expression.cs (ParenthesizedExpression): New class.  This is
12497         just used for the CS0075 test.
12498         (Binary.DoResolve): Check for CS0075.   
12499
12500 2003-07-29  Ravi Pratap  <ravi@ximian.com>
12501
12502         * expression.cs (Invocation.MakeUnionSet): Patch from Lluis
12503         Sanchez : use TypeManager.ArrayContainsMethod instead of a direct
12504         reference comparison.
12505
12506         (TypeManager.ArrayContainsMethod): When we have a MethodInfo, also
12507         examine the ReturnType for equality - this is necessary in the
12508         cases of implicit and explicit operators whose signature also
12509         includes the return type.
12510
12511 2003-07-26  Miguel de Icaza  <miguel@ximian.com>
12512
12513         * namespace.cs: Cache the result of the namespace computation,
12514         instead of computing it every time.
12515
12516 2003-07-24  Miguel de Icaza  <miguel@ximian.com>
12517
12518         * decl.cs: Use a global arraylist that we reuse over invocations
12519         to avoid excesive memory consumption.  Reduces memory usage on an
12520         mcs compile by one meg (45 average).
12521
12522         * typemanager.cs (LookupTypeReflection): In .NET pointers are
12523         private, work around that.
12524
12525 2003-07-23  Miguel de Icaza  <miguel@ximian.com>
12526
12527         * literal.cs (IntLiteral): Define Zero and One static literals. 
12528
12529         * cs-parser.jay (integer_literal): use static literals to reduce
12530         memory usage for the most used literals (0, 1 and -1).  211kb
12531         reduced in memory usage.
12532
12533         Replace all calls to `new ArrayList' with `new
12534         ArrayList(4)' which is a good average number for most allocations,
12535         and also requires only 16 bytes of memory for its buffer by
12536         default. 
12537
12538         This reduced MCS memory usage in seven megabytes for the RSS after
12539         bootstrapping.
12540
12541 2003-07-28  Ravi Pratap  <ravi@ximian.com>
12542
12543         * expression.cs (Invocation.OverloadResolve): Fix the algorithm to
12544         handle params methods the correct way by forming only one
12545         applicable set with params and normal methods in them. Earlier we
12546         were looking at params methods only if we found no normal methods
12547         which was not the correct thing to do.
12548
12549         (Invocation.BetterFunction): Take separate arguments indicating
12550         when candidate and the best method are params methods in their
12551         expanded form.
12552
12553         This fixes bugs #43367 and #46199.
12554
12555         * attribute.cs: Documentation updates.
12556
12557         (CheckAttribute): Rename to CheckAttributeTarget.
12558         (GetValidPlaces): Rename to GetValidTargets.
12559
12560         * expression.cs (Invocation.IsParamsMethodApplicable): Fix trivial
12561         bug - use Convert.ImplicitConversion, not ImplicitUserConversion!
12562
12563         Fixes bug #44468.
12564
12565 2003-07-28  Miguel de Icaza  <miguel@ximian.com>
12566
12567         * codegen.cs: Compute IsGeneric correctly.
12568
12569         * cs-parser.jay: Introduce OP_GENERIC_LT for the grammar ambiguity
12570         resolution. 
12571
12572         Bring back (temporarily) OP_LEFT_SHIFT, OP_RIGHT_SHIFT,
12573         OP_SHIFT_RIGHT_ASSIGN, OP_SHIFT_LEFT_ASSIGN.  There were too many
12574         regressions, and I was chasing more bugs than I required.
12575
12576         * interface.cs: Use expressions for base type names (like classes
12577         and structs have been doing for a while now), and resolve that.
12578         This patch should probably go into head as well.
12579
12580         This makes it one less user of FindType.
12581
12582 2003-07-24  Miguel de Icaza  <miguel@ximian.com>
12583
12584         This compiler can not self host currently.  Need to fix that.
12585         
12586         * Makefile: compile to `gmcs.exe'
12587
12588         * driver.cs: Turn on v2 by default on gmcs.
12589
12590         * generic.cs (ConstructedType): Does no longer take a container
12591         type argument;  That will be taken care of later.
12592
12593         (ConstructedType.DoResolve, ConstructedType.ResolveAsTypeStep):
12594         Use SimpleName to resolve for now, so we can continue the work on
12595         the parser, until we get Type.GetType that understands generics.
12596
12597         (ConstructedType.ToString): Implement
12598
12599         (TypeArguments.Resolve): Resolve the child expressions as types. 
12600         
12601         * cs-parser.jay: Rename interface_constraints to
12602         type_parameter_constraints
12603
12604         (namespace_or_type_name): Only use constructed types for the basic
12605         construction, we will deal with identifier<...> later.
12606
12607         (type/type_name): No longer call DecomposeQI, as
12608         namespace_or_type_name is always decoded now.
12609         
12610 2003-07-22  Ravi Pratap  <ravi@ximian.com>
12611
12612         * expression.cs (Invocation.OverloadResolve): Follow the spec more
12613         closely: we eliminate methods in base types when we have an
12614         applicable method in a top-level type.
12615
12616         Please see section 14.5.5.1 for an exact description of what goes
12617         on. 
12618
12619         This fixes bug #45127 and a host of other related to corlib compilation.
12620
12621         * ecore.cs (MethodGroupExpr.DeclaringType): The element in the
12622         array is the method corresponding to the top-level type (this is
12623         because of the changes made to icall.c) so we change this
12624         accordingly.
12625
12626         (MethodGroupExpr.Name): This too.
12627
12628         * typemanager.cs (GetElementType): New method which does the right
12629         thing when compiling corlib. 
12630
12631         * everywhere: Make use of the above in the relevant places.
12632
12633 2003-07-22  Martin Baulig  <martin@ximian.com>
12634
12635         * cs-parser.jay (invocation_expression): Moved
12636         `OPEN_PARENS expression CLOSE_PARENS unary_expression' here from
12637         `cast_expression', but create a InvocationOrCast which later
12638         resolves to either an Invocation or a Cast.
12639
12640         * ecore.cs (ExpressionStatement.ResolveStatement): New virtual
12641         method; call this before EmitStatement() to make sure that this
12642         expression can be used as a statement.
12643
12644         * expression.cs (InvocationOrCast): New class; resolves to either
12645         an Invocation or a Cast.
12646
12647         * statement.cs (StatementExpression): Call ResolveStatement() on
12648         the ExpressionStatement before emitting it.
12649
12650 2003-07-21  Martin Baulig  <martin@ximian.com>
12651
12652         * expression.cs (Invocation.VerifyArgumentsCompat): Check whether
12653         `ref' and `out' attributes match; fixes #46220.
12654         (MemberAccess.ResolveMemberAccess): You can't reference a type
12655         through an expression; fixes #33180.
12656         (Indexers.GetIndexersForType): Don't return the indexers from
12657         interfaces the class implements; fixes #46502.
12658
12659 2003-07-21  Martin Baulig  <martin@ximian.com>
12660
12661         * class.cs (TypeContainer.CheckPairedOperators): Added CS0660 and
12662         CS0661 checks; fixes bug #30442.
12663
12664 2003-07-21  Martin Baulig  <martin@ximian.com>
12665
12666         * decl.cs (AdditionResult): Added `Error'.
12667
12668         * enum.cs (AddEnumMember): Report a CS0076 if name is `value__'.
12669
12670         * typemanager.cs (TypeManager.ChangeType): Catch exceptions; makes
12671         cs0031.cs actually work.
12672
12673  2003-07-20  Miguel de Icaza  <miguel@ximian.com>
12674  
12675         * cs-parser.jay (namespace_name): do not use
12676         namespace_or_type_name, use qualified_identifier, because
12677         namespace_or_type_name will soon return a composed expression
12678         instead of a string.
12679  
12680         (namespace_or_type_name): Instead of returning a string, now this
12681         production returns an expression.
12682  
12683         * codegen.cs (EmitContext): Setup IsGeneric property based on
12684         whether our DeclSpace is generic, our the method is generic.
12685  
12686         * modifier.cs (Modifiers.METHOD_GENERIC): New definition, use if
12687         the method is generic.
12688  
12689         * cs-parser.jay (type_arguments, opt_type_argument_list,
12690         type_parameters, type_parameter_list, opt_type_parameter_list,
12691         type_parameter,, opt_type_parameter_constraints_clauses,
12692         type_parameter_constraints_clauses,
12693         type_parameter_constraint_clause, type_parameter_constraint,
12694         interface_constraints): Add new production
12695  
12696         * decl.cs (DeclSpace): IsGeneric, flag to track whether this
12697         DeclSpace is generic or not.
12698  
12699         (DeclSpace.SetParameterInfo): New routine, used to set the
12700         parameter info for a type.
12701  
12702         (DeclSpace.LookupGeneric): Lookups a name, and if it is a generic,
12703         returns a GenericTypeExpr
12704  
12705         * ecore.cs (SimpleName.ResolveAsTypeStep): If our container is
12706         generic, lookup the generic argument.
12707  
12708         * attribute.cs: Do not allow TypeParameterExpressions in
12709         Attributes.
12710  
12711         * class.cs: Do not allow the Main method to be defined in a
12712         Generic container.
12713  
12714         * expression.cs (SizeOf): Do not allow generic types to be used as
12715         arguments to sizeof.
12716  
12717         * typemanager.cs (IsGeneric): Wrapper for Reflection when we have
12718         it: whether a type is generic or not.  Only works for types we are
12719         currently building for now.
12720         
12721 2003-07-20  Martin Baulig  <martin@ximian.com>
12722
12723         * namespace.cs: Fixed that bug which caused a crash when compiling
12724         the debugger's GUI.
12725
12726 2003-07-20  Miguel de Icaza  <miguel@ximian.com>
12727
12728         * typemanager.cs (LookupTypeReflection): Never expose types which
12729         are NotPublic, NestedPrivate, NestedAssembly, or
12730         NestedFamANDAssem.  We used to return these, and later do a check
12731         that would report a meaningful error, but the problem is that we
12732         would not get the real match, if there was a name override.
12733
12734 2003-07-18  Miguel de Icaza  <miguel@ximian.com>
12735
12736         * namespace.cs (Namespace, Name): Do not compute the namespace
12737         name dynamically, compute it in the constructor.  This reduced
12738         memory usage by 1697 KB.
12739
12740         * driver.cs: Use --pause to pause at the end.
12741
12742 2003-07-17  Peter Williams  <peter@newton.cx>
12743
12744         * Makefile: Change the name of the test target so that it doesn't
12745         conflict with the recursive test target.
12746
12747 2003-07-17  Miguel de Icaza  <miguel@ximian.com>
12748
12749         * expression.cs (LocalVariableReference.Emit, EmitAssign,
12750         AddressOf): Do not use EmitThis, that was wrong, use the actual
12751         this pointer.
12752
12753 2003-07-15  Miguel de Icaza  <miguel@ximian.com>
12754
12755         * class.cs (MethodData.Define): While checking if a method is an
12756         interface implementation, improve the test: If we are not public
12757         (use new test here: use the computed MethodAttributes directly,
12758         instead of the parsed modifier flags) check if the `implementing'
12759         method comes from an interface or not.
12760
12761         * pending.cs (VerifyPendingMethods): Slightly better error
12762         message.
12763
12764         * makefile: add test target that does the mcs bootstrap.
12765
12766 2003-07-16  Ravi Pratap  <ravi@ximian.com>
12767
12768         * interface.cs (Define): Do nothing here since there are no
12769         members to populate etc. Move the attribute emission out of here
12770         since this was just totally the wrong place to put it. Attribute
12771         application happens during the 'Emit' phase, not in the 'Define'
12772         phase.
12773
12774         (Emit): Add this method and move the attribute emission here
12775
12776         * rootcontext.cs (EmitCode): Call the Emit method on interface
12777         types too.
12778
12779 2003-07-14  Ravi Pratap M  <ravi@ximian.com>
12780
12781         * expression.cs (OverloadResolve): Report error only if Location
12782         is not 'Null' which means that there was a probe going on.
12783
12784 2003-07-14  Martin Baulig  <martin@ximian.com>
12785
12786         * expression.cs (ConditionalLogicalOperator): New public class to
12787         implement user defined conditional logical operators.
12788         This is section 14.11.2 in the spec and bug #40505.
12789
12790 2003-07-14  Martin Baulig  <martin@ximian.com>
12791
12792         * ecore.cs (FieldExpr.DoResolveLValue): Fixed bug #46198.
12793
12794 2003-07-14  Martin Baulig  <martin@ximian.com>
12795
12796         * codegen.cs (EmitContext.InFixedInitializer): New public field.
12797
12798         * ecore.cs (IVariable.VerifyFixed): New interface method.
12799
12800         * expression.cs (Unary.ResolveOperator): When resolving the `&'
12801         operator, check whether the variable is actually fixed.  Fixes bug
12802         #36055.  Set a variable definitely assigned when taking its
12803         address as required by the spec.
12804
12805         * statement.cs (LocalInfo.IsFixed): New field.
12806         (LocalInfo.MakePinned): Set `IsFixed' to true.
12807
12808 2003-07-14  Ravi Pratap M  <ravi@ximian.com>
12809
12810         * attribute.cs (Attribute.Resolve): While doing a Member lookup
12811         for .ctors, ensure that we only ask for members declared in the
12812         attribute type (BindingFlags.DeclaredOnly).
12813
12814         Fixes bug #43632.
12815
12816         * expression.cs (Error_WrongNumArguments): Report error 1501
12817         correctly the way CSC does.
12818
12819 2003-07-13  Martin Baulig  <martin@ximian.com>
12820
12821         * expression.cs (MemberAccess.ResolveAsTypeStep): Try to do a type
12822         lookup on the fully qualified name, to make things like "X.X" work
12823         where "X.X" is a fully qualified type name, but we also have a
12824         namespace "X" in the using list.  Fixes #41975.
12825
12826 2003-07-13  Martin Baulig  <martin@ximian.com>
12827
12828         * assign.cs (Assign.GetEmbeddedAssign): New protected virtual
12829         function. If we're a CompoundAssign, we need to create an embedded
12830         CompoundAssign, not an embedded Assign.
12831         (Assign.DoResolve): Make this work for embedded CompoundAssign's.
12832         Fixes #45854.
12833
12834 2003-07-13  Martin Baulig  <martin@ximian.com>
12835
12836         * typemanager.cs (TypeManager.IsNestedChildOf): Make this actually
12837         work to fix bug #46088.
12838
12839 2003-07-13  Ravi Pratap <ravi@ximian.com>
12840
12841         * class.cs (Operator.Emit): Do not emit attributes here - it is
12842         taken care of by the Method class that we delegate too. This takes
12843         care of bug #45876.
12844
12845 2003-07-10  Martin Baulig  <martin@ximian.com>
12846
12847         * expression.cs (TypeOfVoid): New class.
12848         (TypeOf): Report a CS0673 if it's System.Void.  Fixes #42264.
12849
12850 2003-07-10  Martin Baulig  <martin@ximian.com>
12851
12852         * class.cs (MethodCore.DoDefineParameters): Added CS0225 check;
12853         bug #35957.
12854
12855 2003-07-10  Martin Baulig  <martin@ximian.com>
12856
12857         * rootcontext.cs (RootContext.NamespaceLookup): Take a DeclSpace,
12858         not a NamespaceEntry, so we can use DeclSpace.CheckAccessLevel().
12859
12860         * decl.cs (DeclSpace.FindType): Use DeclSpace.CheckAccessLevel().
12861
12862         * typemanager.cs (TypeManager.IsAccessibleFrom): Removed.
12863
12864 2003-07-10  Martin Baulig  <martin@ximian.com>
12865
12866         * expression.cs (ArrayCreation): Don't use a byte blob for arrays
12867         of decimal.  Fixes #42850.
12868
12869         NOTE: I also fixed the created byte blob, but this doesn't work on
12870         the MS runtime and csc never produces any byte blobs for decimal
12871         arrays.
12872
12873 2003-07-10  Martin Baulig  <martin@ximian.com>
12874
12875         * statement.cs (StructInfo.GetStructInfo): Catch deep cycles in
12876         structs; fixes #32068.
12877         (Block.AddChildVariableNames): Fixed #44302.
12878
12879 2003-07-07  Gonzalo Paniagua Javier <gonzalo@ximian.com>
12880
12881         * namespace.cs: fixed compilation with csc. It's bugzilla #44302.
12882
12883 2003-07-07  Miguel de Icaza  <miguel@ximian.com>
12884
12885         * attribute.cs: And this test is onger needed.
12886
12887 2003-07-08  Martin Baulig  <martin@ximian.com>
12888
12889         * rootcontext.cs (RootContext.NamespaceLookup): Ignore
12890         inaccessible types.  Fixes #36313.
12891
12892         * decl.cs (DeclSpace.FindType): Ignore inaccessible types.
12893
12894         * namespace.cs (NamespaceEntry): Create implicit entries for all
12895         namespaces; ie. if we have `namespace N1.N2.N3 { ... }', we create
12896         implicit entries for N1.N2 and N1.
12897
12898 2003-07-08  Martin Baulig  <martin@ximian.com>
12899
12900         Rewrote the handling of namespaces to fix a lot of the issues
12901         wrt. `using' aliases etc.
12902
12903         * namespace.cs (Namespace): Splitted this class into a
12904         per-assembly `Namespace' and a per-file `NamespaceEntry'.
12905
12906         * typemanager.cs (TypeManager.IsNamespace): Removed.
12907         (TypeManager.ComputeNamespaces): Only compute namespaces from
12908         loaded assemblies here, not the namespaces from the assembly we're
12909         currently compiling.
12910
12911 2003-07-08  Martin Baulig  <martin@ximian.com>
12912
12913         * rootcontext.cs, class.cs: Fixed the CS1530 reporting.
12914
12915 2003-07-07  Miguel de Icaza  <miguel@ximian.com>
12916
12917         * typemanager.cs: Reverted patch from Gonzalo, my previous patch
12918         already fixed it.  
12919
12920         I thought about the memory savings here, but LookupTypeReflection
12921         is used under already very constrained scenarios.  Compiling
12922         corlib or mcs only exposes one hit, so it would not really reduce
12923         any memory consumption.
12924
12925 2003-07-07  Gonzalo Paniagua Javier <gonzalo@ximian.com>
12926
12927         * typemanager.cs: fixes bug #45889 by only adding public types from
12928         other assemblies to the list of known types.
12929
12930 2003-07-07  Miguel de Icaza  <miguel@ximian.com>
12931
12932         * attribute.cs (Attribute.Resolve): Add call to CheckAccessLevel
12933         on the type we resolved.
12934
12935 2003-07-05  Martin Baulig  <martin@ximian.com>
12936
12937         * pending.cs (PendingImplementation.ParentImplements): Don't
12938         create the proxy if the parent is abstract.
12939
12940         * class.cs (TypeContainer.DefineIndexers): Process explicit
12941         interface implementations first.  Fixes #37714.
12942
12943 2003-07-04  Miguel de Icaza  <miguel@ximian.com>
12944
12945         * expression.cs (MemberAccess.ResolveMemberAccess): Events are
12946         defined recursively;  but since we modify the input parameters
12947         (left is set to `this' temporarily), we reset this value if the
12948         left_is_explicit is false, which gives the original semantics to
12949         the code.  
12950
12951         * literal.cs (NullPointer): new class used to represent a null
12952         literal in a pointer context.
12953
12954         * convert.cs (Convert.ImplicitReferenceConversion): Is the target
12955         type is a pointer, use a NullPointer object instead of a
12956         NullLiteral.   Closes 43687
12957
12958         (ExplicitConversion): Convert pointer values using
12959         the conv opcode to the proper type.
12960
12961         * ecore.cs (New): change ValueTypeVariable property into a method,
12962         that returns whether the valuetype is suitable for being used.
12963
12964         * expression.cs (Binary.DoNumericPromotions): Only return if we
12965         the int constant was a valid uint, and we can return both left and
12966         right as uints.  If not, we continue processing, to trigger the
12967         type conversion.  This fixes 39018.
12968
12969         * statement.cs (Block.EmitMeta): During constant resolution, set
12970         the CurrentBlock property on the emitcontext, so that we resolve
12971         constants propertly.
12972
12973 2003-07-02  Martin Baulig  <martin@ximian.com>
12974
12975         * codegen.cs (EmitContext.NeedExplicitReturn): New public variable.
12976         (EmitContext.EmitTopBlock): Emit an explicit return if it's set.
12977
12978         * statement.cs (Try.Resolve): Set ec.NeedExplicitReturn rather
12979         than emitting it here.
12980
12981         * statement.cs: Fixed some more flow analysis bugs.
12982
12983 2003-07-02  Martin Baulig  <martin@ximian.com>
12984
12985         * class.cs (MethodData.Define): When implementing interface
12986         methods, set Final unless we're Virtual.
12987
12988         * decl.cs (MemberCore.CheckMethodAgainstBase): Make the CS0506
12989         check work for interface methods.
12990
12991 2003-07-01  Martin Baulig  <martin@ximian.com>
12992
12993         * ecore.cs (EmitContext.This): Replaced this property with a
12994         GetThis() method which takes a Location argument.  This ensures
12995         that we get the correct error location for a CS0188.
12996
12997 2003-07-01  Miguel de Icaza  <miguel@ximian.com>
12998
12999         * ecore.cs: (Convert.ConvertIntLiteral): Add test for
13000         ImplicitStandardConversion.
13001
13002         * class.cs (TypeContainer.GetClassBases): Small bug fix for 45649.
13003
13004 2003-07-01  Zoltan Varga  <vargaz@freemail.hu>
13005
13006         * expression.cs (ResolveOperator): Fix Concat (string, string, string)
13007         optimization.
13008
13009 2003-06-30  Miguel de Icaza  <miguel@ximian.com>
13010
13011         * class.cs (Constructor.Define): Turn off initlocals for unsafe
13012         constructors.
13013
13014         (MethodData.Define): Turn off initlocals for unsafe methods.
13015
13016 2003-06-29  Miguel de Icaza  <miguel@ximian.com>
13017
13018         * decl.cs (DeclSpace.CheckAccessLevel): Make this routine
13019         complete;  Fixes #37521.
13020
13021         * delegate.cs: Use Modifiers.TypeAttr to compute the
13022         TypeAttributes, instead of rolling our own.  This makes the flags
13023         correct for the delegates.
13024
13025 2003-06-28  Miguel de Icaza  <miguel@ximian.com>
13026
13027         * class.cs (Constructor.Define): Set the private flag for static
13028         constructors as well.
13029
13030         * cs-parser.jay (statement_expression): Set the return value to
13031         null, to avoid a crash when we catch an error.
13032
13033 2003-06-24  Miguel de Icaza  <miguel@ximian.com>
13034
13035         * cs-parser.jay: Applied patch from Jackson that adds support for
13036         extern and unsafe modifiers to destructor declarations.
13037
13038         * expression.cs: Report error 21 if the user is trying to index a
13039         System.Array.
13040
13041         * driver.cs: Add an error message, suggested by the bug report.
13042
13043         * class.cs (TypeContainer.Emit): Only call EmitFieldInitializers
13044         if we do not have a ": this ()" constructor initializer.  Fixes 45149
13045
13046 2003-06-14  Miguel de Icaza  <miguel@ximian.com>
13047
13048         * namespace.cs: Add some information to reduce FAQs.
13049
13050 2003-06-13  Miguel de Icaza  <miguel@ximian.com>
13051
13052         * cfold.cs (BinaryFold): BitwiseAnd, BitwiseOr: handle other
13053         underlying enumeration types.  Fixes #43915.
13054
13055         * expression.cs: Treat ushort/short as legal values to be used in
13056         bitwise operations.
13057
13058 Wed Jun 4 13:19:04 CEST 2003 Paolo Molaro <lupus@ximian.com>
13059
13060         * delegate.cs: transfer custom attributes for paramenters from
13061         the delegate declaration to Invoke and BeginInvoke.
13062
13063 Tue Jun 3 11:11:08 CEST 2003 Paolo Molaro <lupus@ximian.com>
13064
13065         * attribute.cs: handle custom marshalers and emit marshal info
13066         for fields, too.
13067
13068 2003-05-28  Hector E. Gomez Morales  <hgomez_36@flashmail.com>
13069
13070         * makefile.gnu: Added anonymous.cs to the compiler sources.
13071
13072 2003-05-28  Miguel de Icaza  <miguel@ximian.com>
13073
13074         * iterators.cs: Change the name of the proxy class to include two
13075         underscores.
13076
13077         * cs-parser.jay: Update grammar to include anonymous methods.
13078
13079         * anonymous.cs: new file.
13080
13081 2003-05-27  Miguel de Icaza  <miguel@ximian.com>
13082
13083         * class.cs (Field.Define): Add missing test for pointers and
13084         safety. 
13085
13086 2003-05-27  Ravi Pratap  <ravi@ximian.com>
13087
13088         * expression.cs (ArrayAccess.GetStoreOpCode): For System.IntPtr,
13089         we use the stobj opcode.
13090
13091         (ArrayCreation.EmitDynamicInitializers): Revert Miguel's patch
13092         since it wasn't the correct fix. 
13093
13094         It still is puzzling that we are required to use stobj for IntPtr
13095         which seems to be a ValueType.
13096
13097 2003-05-26  Miguel de Icaza  <miguel@ximian.com>
13098
13099         * ecore.cs (SimpleName.SimpleNameResolve): Consider using aliases
13100         during regular simple name resolution.   Now, the trick is that
13101         instead of returning for processing the simplename, we do a
13102         TypeManager.LookupType (ie, a rooted lookup as opposed to a
13103         contextual lookup type).   If a match is found, return that, if
13104         not, return for further composition.
13105
13106         This fixes long-standing 30485.
13107
13108         * expression.cs (ArrayCreation.EmitDynamicInitializers): When
13109         using the address to initialize an object, do an Stobj instead of
13110         using the regular Stelem.
13111
13112         (IndexerAccess.Emit, IndexerAccess.EmitAssign):
13113         Pass `is_base_indexer' to Invocation.EmitCall instead of false.
13114         Because if we are a BaseIndexerAccess that value will be true.
13115         Fixes 43643.
13116
13117         * statement.cs (GotoCase.Resolve): Return after reporting an
13118         error, do not attempt to continue. 
13119
13120         * expression.cs (PointerArithmetic.Emit): If our operand is a
13121         long, convert our constants to match the operand before
13122         multiplying.  Convert to I type before adding.   Fixes 43670.
13123
13124 2003-05-14  Ravi Pratap  <ravi@ximian.com>
13125
13126         * enum.cs (ImplicitConversionExists) : Rename to
13127         ImplicitEnumConversionExists to remove ambiguity. 
13128
13129         * ecore.cs (NullCast): New type of cast expression class which
13130         basically is very similar to EmptyCast with the difference being
13131         it still is a constant since it is used only to cast a null to
13132         something else
13133         (eg. (string) null)
13134
13135         * convert.cs (ImplicitReferenceConversion): When casting a null
13136         literal, we return a NullCast.
13137
13138         * literal.cs (NullLiteralTyped): Remove - I don't see why this
13139         should be around anymore.
13140
13141         The renaming (reported was slightly wrong). Corrections:
13142
13143         ConvertImplicitStandard -> ImplicitConversionStandard
13144         ConvertExplicitStandard -> ExplicitConversionStandard
13145
13146         * expression.cs (StaticCallExpr.MakeSimpleCall): Resolve arguments
13147         before passing them in !
13148
13149         * convert.cs (ImplicitConversionStandard): When comparing for
13150         equal expr and target types, ensure that expr is not a
13151         NullLiteral.
13152
13153         In general, we must not be checking (expr_type ==
13154         target_type) in the top level conversion methods
13155         (ImplicitConversion, ExplicitConversion etc). This checking is
13156         done in the methods that they delegate to.
13157
13158 2003-05-20  Miguel de Icaza  <miguel@ximian.com>
13159
13160         * convert.cs: Move Error_CannotConvertType,
13161         ImplicitReferenceConversion, ImplicitReferenceConversionExists,
13162         ImplicitNumericConversion, ImplicitConversionExists,
13163         ImplicitUserConversionExists, StandardConversionExists,
13164         FindMostEncompassedType, FindMostSpecificSource,
13165         FindMostSpecificTarget, ImplicitUserConversion,
13166         ExplicitUserConversion, GetConversionOperators,
13167         UserDefinedConversion, ConvertImplicit, ConvertImplicitStandard,
13168         TryImplicitIntConversion, Error_CannotConvertImplicit,
13169         ConvertImplicitRequired, ConvertNumericExplicit,
13170         ExplicitReferenceConversionExists, ConvertReferenceExplicit,
13171         ConvertExplicit, ConvertExplicitStandard from the ecore.cs into
13172         its own file.
13173
13174         Perform the following renames:
13175
13176         StandardConversionExists -> ImplicitStandardConversionExists
13177         ConvertImplicit -> ImplicitConversion
13178         ConvertImplicitStandard -> ImplicitStandardConversion
13179         TryImplicitIntConversion -> ImplicitIntConversion
13180         ConvertImplicitRequired -> ImplicitConversionRequired
13181         ConvertNumericExplicit -> ExplicitNumericConversion
13182         ConvertReferenceExplicit -> ExplicitReferenceConversion
13183         ConvertExplicit -> ExplicitConversion
13184         ConvertExplicitStandard -> ExplicitStandardConversion
13185
13186 2003-05-19  Martin Baulig  <martin@ximian.com>
13187
13188         * statement.cs (TypeInfo.StructInfo): Made this type protected.
13189         (TypeInfo): Added support for structs having structs as fields.
13190
13191         * ecore.cs (FieldExpr): Implement IVariable.
13192         (FieldExpr.DoResolve): Call VariableInfo.GetSubStruct() to get the
13193         VariableInfo for the field.
13194
13195 2003-05-18  Martin Baulig  <martin@ximian.com>
13196
13197         * expression.cs (This.DoResolve): Report a CS0027 if we're
13198         emitting a field initializer.
13199
13200 2003-05-18  Martin Baulig  <martin@ximian.com>
13201
13202         * expression.cs (This.ResolveBase): New public function.
13203         (This.DoResolve): Check for CS0188.
13204
13205         * codegen.cs (EmitContext.This): Just call This.ResolveBase(), not
13206         This.Resolve().
13207
13208         * ecore.cs (MethodGroupExpr.DoResolve): Set the
13209         `instance_expression' to null if we don't have any non-static
13210         methods.
13211
13212 2003-05-18  Martin Baulig  <martin@ximian.com>
13213
13214         Reworked the way how local variables and parameters are handled by
13215         the flow analysis code.
13216
13217         * statement.cs (TypeInfo, VariableMap): New public classes.
13218         (VariableInfo): New public class.  This is now responsible for
13219         checking whether a variable has been assigned.  It is used for
13220         parameters and local variables.
13221         (Block.EmitMeta): Take the InternalParameters as argument; compute
13222         the layout of the flow vectors here.
13223         (Block.LocalMap, Block.ParameterMap): New public properties.
13224         (FlowBranching): The .ctor doesn't get the InternalParameters
13225         anymore since Block.EmitMeta() now computes the layout of the flow
13226         vector.
13227         (MyStructInfo): This class is now known as `StructInfo' and nested
13228         in `TypeInfo'; we don't access this directly anymore.
13229
13230         * ecore.cs (IVariable): Added `VariableInfo VariableInfo'
13231         property and removed IsAssigned(), IsFieldAssigned(),
13232         SetAssigned() and SetFieldAssigned(); we now call them on the
13233         VariableInfo so we don't need to duplicate this code everywhere.
13234
13235         * expression.cs (ParameterReference): Added `Block block' argument
13236         to the .ctor.
13237         (LocalVariableReference, ParameterReference, This): The new
13238         VariableInfo class is now responsible for all the definite
13239         assignment stuff.
13240
13241         * codegen.cs (EmitContext.IsVariableAssigned, SetVariableAssigned,
13242         IsParameterAssigned, SetParameterAssigned): Removed.
13243
13244 2003-05-18  Martin Baulig  <martin@ximian.com>
13245
13246         * typemanager.cs (InitCoreTypes): Try calling
13247         SetCorlibTypeBuilders() with 4 args; if that fails, fall back to
13248         the 3-args-version.  Corlib now also needs our `void_type'.
13249         (GetMethod): Added overloaded version which takes an optional
13250         `bool report_errors' to allow lookups of optional methods.
13251
13252 2003-05-12  Martin Baulig  <martin@ximian.com>
13253
13254         * statement.cs (VariableInfo): Renamed to LocalInfo since it's
13255         only used for locals and not for parameters.
13256
13257 2003-05-12  Miguel de Icaza  <miguel@ximian.com>
13258
13259         * support.cs (InternalParameters.ParameterType): Return the
13260         ExternalType of the parameter.
13261
13262         * parameter.cs (Parameter.ExternalType): drop the two arguments,
13263         they were unused.
13264
13265 2003-05-11  Miguel de Icaza  <miguel@ximian.com>
13266
13267         * class.cs (MethodData.Define): Do not set the `newslot' on
13268         interface members, if they are also flagged as "override".
13269
13270         * expression.cs (UnaryMutator.EmitCode): Simple workaround to emit
13271         better code for ++i and i++.  This only works for static fields
13272         and local variables.
13273
13274         * typemanager.cs (LookupDeclSpace): Add new method, sometimes we
13275         want to pull the DeclSpace out of the builder_to_declspace instead
13276         of the TypeBuilder (like in TypeContainer.FindMembers).
13277
13278         * class.cs (TypeContainer.FindMembers): Use LookupDeclSpace
13279         instead of LookupTypeContainer.  Fixes the crash on .NET for
13280         looking up interface members.
13281
13282         * const.cs: Create our own emit context during the Definition
13283         stage, so that constants are evaluated in the proper context, when
13284         a recursive definition happens.
13285
13286 2003-05-11  Martin Baulig  <martin@ximian.com>
13287
13288         * statement.cs (Block.CreateSwitchBlock): New method.  Creates a
13289         new block for a switch section.
13290         (Block.AddLabel, Block.LookupLabel): If we're a switch section, do
13291         the adding/lookup in the switch block.  Fixes #39828.
13292
13293 2003-05-09  Miguel de Icaza  <miguel@ximian.com>
13294
13295         * expression.cs (UnaryMutator.LoadOneAndEmitOp): Missing
13296         functionality: I needed to convert the data after I had performed
13297         the add/sub operation into the operands type size.
13298
13299         * ecore.cs (ImplicitReferenceConversion): When boxing an interface
13300         pass the type for the box operation, otherwise the resulting
13301         object would have been of type object.
13302
13303         (BoxedCast): Add constructor to specify the type to box as.
13304
13305 2003-05-07  Miguel de Icaza  <miguel@ximian.com>
13306
13307         * iterators.cs: I was reusing the `count' variable inadvertently,
13308         take steps to not allow this to happen.
13309
13310 2003-05-06  Miguel de Icaza  <miguel@ximian.com>
13311
13312         * attribute.cs (Attribute.Resolve): Params attributes are encoded
13313         by creating an array at the point where the params starts and
13314         putting all those arguments there, then adjusting the size of the
13315         array.
13316
13317 2003-05-05  Miguel de Icaza  <miguel@ximian.com>
13318
13319         * expression.cs (New.AddressOf): Implement interface
13320         IMemoryLocation.  This is used when the `new' operator is used in
13321         the context of an invocation to a method on a value type.
13322
13323         See http://bugzilla.ximian.com/show_bug.cgi?id=#42390 for an
13324         example. 
13325
13326         * namespace.cs: Also check the using aliases here.
13327
13328         * driver.cs: Move the test for using validity after the types have
13329         been entered, so we do a single pass that also includes the using
13330         aliases. 
13331
13332         * statement.cs (Try.Resolve): Avoid crashing if there is a failure
13333         in the regular case.   CreateSiblingForFinally is doing extra
13334         error checking.
13335
13336         * attribute.cs (GetAttributeArgumentExpression): Store the result
13337         on an out value, and use the return value to indicate failure
13338         instead of using null (which is a valid return for Constant.GetValue).
13339
13340         * statement.cs: Perform the analysis flow for the increment
13341         portion after the statement, because this will be the real flow of
13342         execution.  Fixes #42385
13343
13344         * codegen.cs (EmitContext.EmitArgument,
13345         EmitContext.EmitStoreArgument): New helper functions when the
13346         RemapToProxy flag is set.
13347
13348         * expression.cs (ParameterReference.EmitLdarg): Expose this useful
13349         function.
13350
13351         Add support for remapping parameters. 
13352
13353         * iterators.cs: Propagate parameter values;  Store parameter
13354         values in the proxy classes.
13355
13356 2003-05-04  Miguel de Icaza  <miguel@ximian.com>
13357
13358         * ecore.cs (FieldExpr): Fix an obvious bug.  static fields do not
13359         need a proxy reference;  I do not know what I was thinking
13360
13361         * cs-parser.jay (constructor_initializer): catch another error,
13362         and display nice message.
13363
13364         (field_declaration): catch void field declaration
13365         to flag a better error. 
13366
13367         * class.cs (MemberBase.CheckBase): Report an error instead of a
13368         warning if a new protected member is declared in a struct. 
13369         (Field.Define): catch the error of readonly/volatile.
13370
13371         * ecore.cs (FieldExpr.EmitAssign): reuse the field lookup.
13372
13373         (FieldExpr.AddressOf): ditto.  Catch error where the address of a
13374         volatile variable is taken
13375
13376 2003-05-02  Miguel de Icaza  <miguel@ximian.com>
13377
13378         * statement.cs (Fixed.Resolve): Report an error if we are not in
13379         an unsafe context.
13380
13381 2003-05-01  Miguel de Icaza  <miguel@ximian.com>
13382
13383         * typemanager.cs: reuse the code that handles type clashes for
13384         delegates and enumerations.
13385
13386         * class.cs (Report28): Always report.
13387
13388         * expression.cs (EncodeAsAttribute): Allow nulls here.
13389
13390 2003-04-28  Miguel de Icaza  <miguel@ximian.com>
13391
13392         * attribute.cs (Attribute.GetAttributeArgumentExpression): Moved
13393         the functionality for testing whether an expression is valid for
13394         an attribute here.  Also handle the case of arrays of elements
13395         being stored. 
13396
13397         * expression.cs (ArrayCreation.EncodeAsAttribute): Add support for
13398         encoding a linear array into an array of objects that are suitable
13399         to be passed to an CustomAttributeBuilder.
13400
13401         * delegate.cs: Check unsafe types being used outside of an Unsafe context.
13402
13403         * ecore.cs: (FieldExpr): Handle field remapping here.
13404
13405         * iteratators.cs: Pass the instance variable (if the method is an
13406         instance method) to the constructors, so we can access the field
13407         variables on the class.
13408
13409         TODO: Test this with structs.  I think the THIS variable on
13410         structs might have to be a pointer, and not a refenrece
13411
13412 2003-04-27  Miguel de Icaza  <miguel@ximian.com>
13413
13414         * codegen.cs (EmitContext.Mapvariable): Adds a mechanism to map
13415         local variables to fields in a proxy class.
13416
13417         * iterators.cs (PopulateProxy): Rename our internal fields to
13418         <XXX>.  
13419         Create a <THIS> field if we are an instance method, so we can
13420         reference our parent container variables.
13421         (MapVariable): Called back from the EmitContext code to enter a
13422         new variable to field mapping into the proxy class (we just create
13423         a FieldBuilder).
13424
13425         * expression.cs
13426         (LocalVariableReference.{Emit,EmitAssign,AddressOf}): Add support
13427         for using the remapped locals to fields.
13428
13429         I placed the code here, because that gives the same semantics to
13430         local variables, and only changes the Emit code.
13431
13432         * statement.cs (Fixed.Resolve): it is not allowed to have fixed
13433         statements inside iterators.
13434         (VariableInfo): Add a FieldBuilder for the cases when we are
13435         remapping local variables to fields in a proxy class
13436
13437         * ecore.cs (SimpleNameResolve): Avoid testing two times for
13438         current_block != null.
13439
13440         * statement.cs (Swithc.SimpleSwitchEmit): Removed code that did
13441         not cope with strings, as it has been moved to the
13442         TableSwitchEmit.  Fixed bug in switch generation.
13443
13444         * expression.cs (New.DoResolve): Provide more context for the user
13445         when reporting an error.
13446
13447         * ecore.cs (Expression.LoadFromPtr): Use ldind_i when loading
13448         pointers. 
13449
13450         * expression.cs (MemberAccess.DoResolve): When we get a type back,
13451         check the permissions for it.  Note than in a type-resolution
13452         context the check was already present in DeclSpace.ResolveType,
13453         but was missing from the MemberAccess.
13454
13455         (ArrayCreation.CheckIndices): warn if the user has
13456         more nested levels of expressions, but there are no more
13457         dimensions specified.  Avoids crash on bug 41906.
13458
13459 2003-04-26  Miguel de Icaza  <miguel@ximian.com>
13460
13461         * statement.cs (Block): replace Implicit bool, for a generic
13462         flags.   
13463         New flag: `Unchecked'.  This is used during the EmitMeta phase
13464         (which is out-of-line with the regular Resolve/Emit process for a
13465         statement, as this is done ahead of time, but still gets a chance
13466         to call constant resolve).
13467
13468         (Block.Flags): new enum for adding a new flag.
13469
13470         (Block.EmitMeta): track the state of unchecked.
13471
13472         (Unchecked): Set the "UnChecked" flags on any blocks we enclose,
13473         to enable constant resolution to work there as well.
13474
13475 2003-04-22  Miguel de Icaza  <miguel@ximian.com>
13476
13477         * typemanager.cs (ienumerable_type): Also look up
13478         System.Collections.IEnumerable. 
13479
13480 2003-04-21  Miguel de Icaza  <miguel@ximian.com>
13481
13482         TODO: Test more than one conditional per method.
13483
13484         * class.cs (Indexer.Define): Report the location where the user is
13485         referencing the unsupported feature.
13486
13487         (MethodData): Overload the use of `conditionals' to
13488         minimize the creation of needless ArrayLists.   This saves roughly
13489         212kb on my machine.
13490
13491         (Method): Implement the new IIteratorContainer interface.
13492         (Method.SetYields): Implement the method by setting the ModFlags
13493         to contain METHOD_YIELDS.
13494
13495         * expression.cs (Unary.ResolveOperator): Use expr_type, not Expr,
13496         which just got set to null.
13497
13498         * iterators.cs: New file.
13499
13500         (Yield, YieldBreak): New statements.
13501
13502         * statement.cs (Return.Resolve): Flag an error if we are used in
13503         an iterator method.
13504
13505         * codegen.cs (InIterator): New flag set if the code is being
13506         compiled in an iterator method.
13507
13508         * modifiers.cs: New flag METHOD_YIELDS.  This modifier is an
13509         internal modifier, and we just use it to avoid adding extra
13510         fields, as this is seldom used.  
13511
13512         * cs-parser.jay: Add yield_statement (yield and yield break).
13513
13514         * driver.cs: New flag -v2 to turn on version 2 features. 
13515
13516         * cs-tokenizer.cs (Tokenizer): Add yield and __yield to the
13517         hashtable when v2 is enabled.
13518
13519 2003-04-20  Miguel de Icaza  <miguel@ximian.com>
13520
13521         * typemanager.cs (TypeManager.NamespaceClash): Use to check if
13522         there is already a namespace defined with this name.
13523
13524         (TypeManager.InitCoreTypes): Remove the temporary workaround, as
13525         people upgraded their corlibs.
13526
13527         (TypeManager.CoreLookupType): Use LookupTypeDirect, as we
13528         always use fully qualified types, no need to use the compiler
13529         front end.
13530
13531         (TypeManager.IsNamespace): Use binarysearch.
13532
13533         * class.cs (AddClass, AddStruct, AddInterface, AddEvent,
13534         AddDelegate): I did not quite use the new IsValid API properly: I
13535         have to pass the short-name and the fullname.  I was passing only
13536         the basename instead of the fullname sometimes. 
13537
13538         (TypeContainer.DefineType): call NamespaceClash.
13539
13540         * interface.cs (Interface.DefineType): use NamespaceClash before
13541         defining the type.
13542
13543         * delegate.cs (Delegate.DefineType): use NamespaceClash before
13544         defining the type.
13545
13546         * enum.cs: (Enum.DefineType): use NamespaceClash before
13547         defining the type.
13548
13549         * typemanager.cs (: 3-line patch that gives us some tasty 11%
13550         speed increase.  First, use the negative_hits cache when we get a
13551         negative.  Second, add the type with its full original name
13552         instead of the new . and + encoded name (reflection uses + to
13553         separate type from a nested type).  Use LookupTypeReflection
13554         directly which bypasses the type->name hashtable (that we already
13555         know does not contain the type.
13556
13557         * decl.cs (DeclSpace.ResolveTypeExpr): track the
13558         location/container type. 
13559
13560         * driver.cs: When passing utf8, use directly the UTF8Encoding.
13561
13562 2003-04-19  Miguel de Icaza  <miguel@ximian.com>
13563
13564         * decl.cs (ResolveTypeExpr): Mirror check acess here too.
13565
13566         * delegate.cs (NewDelegate.Resolve): Test whether an instance
13567         method is being referenced in the method group from a static
13568         context, and report error 120 if so.
13569
13570         * expression.cs, ecore.cs (Error_UnexpectedKind): New name for
13571         Error118. 
13572
13573         * typemanager.cs: Add intermediate namespaces (if a namespace A.B
13574         is created, we create the A namespace).
13575
13576         * cs-parser.jay: A namespace also introduces a DeclarationFound.
13577         Fixes #41591
13578
13579 2003-04-18  Miguel de Icaza  <miguel@ximian.com>
13580
13581         * typemanager.cs (GetReferenceType, GetPointerType): In .NET each
13582         invocation to ModuleBuilder.GetType with the same values will
13583         return a new type instance, so we need to cache its return
13584         values. 
13585
13586         * expression.cs (Binary.ResolveOperator): Only allow the compare
13587         operators on enums if they are of the same type.
13588
13589         * ecore.cs (Expression.ImplicitReferenceConversion): handle target
13590         types of ValueType on their own case.  Before we were giving them
13591         the same treatment as objects.
13592
13593         * decl.cs (DeclSpace.IsValid): IsValid takes the short name and
13594         fullname.  Short name is used to compare against container name.
13595         Fullname is used to check against defined namespace names.
13596
13597         * class.cs (AddProperty, AddField, AddClass, AddStruct, AddEnum,
13598         AddDelegate, AddEvent): Pass new parameter to DeclSpace.IsValid
13599
13600         (Method.CheckBase): Call parent.
13601         (MemberBase.CheckBase): Check for protected members on sealed
13602         classes.
13603         (PropertyBase.CheckBase): Call parent.
13604         (Field.Define): Call parent.
13605
13606         * report.cs: Negative error codes are now mapped to 8000 - code,
13607         so that the display is render more nicely.
13608
13609         * typemanager.cs: Do not use try/catch, instead report a regular
13610         error. 
13611
13612         (GetPointerType, GetReferenceType): These methods provide
13613         mechanisms to obtain the T* and T& from a T.  We had the code
13614         previously scattered around the code base, and it also used
13615         TypeManager.LookupType that would go through plenty of caches.
13616         This one goes directly to the type source.
13617
13618         In some places we did the Type.GetType followed by
13619         ModuleBuilder.GetType, but not in others, so this unifies the
13620         processing as well.
13621
13622         * namespace.cs (VerifyUsing): Perform a non-lazy approach to using
13623         statements now that we have namespace information.
13624
13625         * typemanager.cs (IsNamespace): New method, returns whether the
13626         string presented is a namespace or not.
13627
13628         (ComputeNamespaces): New public entry point, computes the list of
13629         available namespaces, using the GetNamespaces API call in Mono, or
13630         the slower version in MS.NET.   
13631
13632         Now before we start the semantic analysis phase, we have a
13633         complete list of namespaces including everything that the user has
13634         provided.
13635
13636         Deleted old code to cache namespaces in .nsc files.
13637
13638 2003-04-17  Miguel de Icaza  <miguel@ximian.com>
13639
13640         * class.cs: (TypeContainer.DefineDefaultConstructor): Use the
13641         class/struct location definition Location for the implicit
13642         constructor location.
13643
13644         (Operator.Define): Use the location of the operator for the
13645         implicit Method definition.
13646
13647         (Constructor.Emit): use the constructor location for the implicit
13648         base initializer constructor.
13649
13650         * ecore.cs: Remove ITypeExpression.  This interface is now gone,
13651         and the Expression class now contains two new methods:
13652
13653         ResolveAsTypeStep and ResolveAsTypeTerminal.  This is used to
13654         isolate type lookup from the rest of the resolution process.
13655
13656         Since we use Expressions to hold type definitions due to the way
13657         we parse the input we have historically overloaded Resolve to
13658         perform the Type lookups if a special flag is passed.  Now this is
13659         eliminated and two methods take their place. 
13660
13661         The differences in the two methods between xStep and xTerminal is
13662         that xStep is involved in our current lookup system that uses
13663         SimpleNames to compose a name, while xTerminal is used just to
13664         catch the case where the simplename lookup failed.
13665
13666 2003-04-16  Miguel de Icaza  <miguel@ximian.com>
13667
13668         * expression.cs (ResolveMemberAccess): Remove redundant code.
13669         TypeExpr expressions are always born fully resolved.
13670
13671         * interface.cs (PopulateMethod): Do not lookup the types twice.
13672         We were doing it once during SemanticAnalysis and once during
13673         PopulateMethod.
13674
13675         * cs-parser.jay: Due to our hack in the grammar, things like A.B[]
13676         in local variable type definitions, were being returned as a
13677         SimpleName (we decomposed everything into a string), that is
13678         because primary_expression was being used instead of a type in the
13679         grammar (reduce/reduce conflicts).
13680
13681         The part that was wrong is that we converted the expression into a
13682         string (an oversimplification in one hand, compounded with primary
13683         expressions doing string concatenation).
13684
13685         So things like:
13686
13687         A.B.C [] x;
13688
13689         Would return "A.B.C[]" as a SimpleName.  This stopped things like
13690         using clauses from working on this particular context.  And a type
13691         was being matched directly against "A.B.C[]".
13692
13693         We now use the correct approach, and allow for ComposedCast to be
13694         part of the unary expression.  So the "A.B.C []" become a composed
13695         cast of "A.B.C" (as a nested group of MemberAccess with a
13696         SimpleName at the end) plus the rank composition "[]". 
13697
13698         Also fixes 35567
13699
13700 2003-04-10  Miguel de Icaza  <miguel@ximian.com>
13701
13702         * decl.cs (CheckAccessLevel): Implement the NestedPrivate rules
13703         for the access level checking.
13704
13705         * class.cs: Cosmetic changes.  Renamed `TypeContainer parent' to
13706         `TypeContainer container', because I kept getting confused when I
13707         was debugging this code.
13708
13709         * expression.cs (Indexers): Instead of tracking getters/setters,
13710         we now track them in parallel.  We create one arraylist less, but
13711         most importantly it is possible now for the LValue code to find a
13712         matching get for a set.
13713
13714         (IndexerAccess.DoResolveLValue): Update the code.
13715         GetIndexersForType has been modified already to extract all the
13716         indexers from a type.  The code assumed it did not.
13717
13718         Also make the code set the correct return type for the indexer.
13719         This was fixed a long time ago for properties, but was missing for
13720         indexers.  It used to be void_type.
13721
13722         (Binary.Emit): Test first for doubles instead of
13723         floats, as they are more common.
13724
13725         (Binary.EmitBranchable): Use the .un version of the branch opcodes
13726         when dealing with floats and the <=, >= operators.  This fixes bug
13727         #39314 
13728
13729         * statement.cs (Foreach.EmitArrayForeach): bug fix: The code used
13730         to load the array value by emitting a load on the foreach variable
13731         type.  This was incorrect.  
13732
13733         We now emit the code to load an element using the the array
13734         variable type, and then we emit the conversion operator.
13735
13736         Fixed #40176
13737
13738 2003-04-10  Zoltan Varga  <vargaz@freemail.hu>
13739
13740         * attribute.cs: Avoid allocation of ArrayLists in the common case.
13741
13742 2003-04-09  Miguel de Icaza  <miguel@ximian.com>
13743
13744         * class.cs (MethodSignature.InheritableMemberSignatureCompare):
13745         test for protection before we test for signatures. 
13746
13747         (MethodSignature.ToString): implement.
13748
13749         * expression.cs (Unary.TryReduceNegative): Add missing minus sign
13750         to the case where we reduced into a LongConstant.
13751
13752         * decl.cs (CheckAccessLevel): If the type is an array, we can not
13753         depend on whether the information is acurrate, because the
13754         Microsoft runtime will always claim that the array type is public,
13755         regardless of the real state.
13756
13757         If the type is a pointer, another problem happens: the type is
13758         reported as non-public in Microsoft.  
13759
13760         In both cases we have to call CheckAccessLevel recursively with
13761         the underlying type as the argument to be tested.
13762
13763 2003-04-08  Miguel de Icaza  <miguel@ximian.com>
13764
13765         * assign.cs (Assign.Emit): If we are dealing with a compound
13766         assignment expression, we should use the code path that stores the
13767         intermediate result in a temporary value.  This fixes #40903.
13768
13769         *expression.cs (Indirection.ToString): Provide ToString method for
13770         debugging. 
13771
13772 2003-04-08  Zoltan Varga  <vargaz@freemail.hu>
13773
13774         * class.cs: Null out fields holding references to Block objects so
13775         they can be garbage collected.
13776
13777         * expression.cs (OverloadResolve): Remove unused local.
13778
13779 2003-04-07  Martin Baulig  <martin@ximian.com>
13780
13781         * codegen.cs (EmitContext.CurrentFile): New public field.
13782         (EmitContext.Mark): Use the CurrentFile to check whether the
13783         location is in the correct file.
13784         (EmitContext.EmitTopBlock): Initialize CurrentFile here.
13785
13786 2003-04-07  Martin Baulig  <martin@ximian.com>
13787
13788         * ecore.cs (Expression.ResolveBoolean): Don't call ec.Mark().
13789
13790         * codegen.cs (EmitContext.EmitTopBlock): Don't call Mark() on the
13791         location.  [FIXME: The location argument which gets passed to this
13792         method is sometimes wrong!]
13793
13794 2003-04-07  Nick Drochak <ndrochak@gol.com>
13795
13796         * codegen.cs: Be more verbose when we can't find the symbol writer dll.
13797
13798 2003-04-07  Miguel de Icaza  <miguel@ximian.com>
13799
13800         * expression.cs (Indirection.EmitAssign): We were using the
13801         temporary, but returning immediately instead of continuing the
13802         EmitAssing flow.
13803
13804 2003-04-06  Martin Baulig  <martin@ximian.com>
13805
13806         * ecore.cs (SimpleName.SimpleNameResolve): Don't report an error
13807         if it's a nested child, but also deriving from the outer class.
13808         See test 190.cs.
13809
13810         * typemanager.cs (IsNestedChildOf): Make this work if it's a
13811         nested child, but also deriving from the outer class.  See
13812         test-190.cs.
13813         (FilterWithClosure): We may access private members of the outer
13814         class if we're a nested child and deriving from the outer class.
13815         (RealMemberLookup): Only set `closure_private_ok' if the
13816         `original_bf' contained BindingFlags.NonPublic.
13817
13818 2003-04-05  Martin Baulig  <martin@ximian.com>
13819
13820         * expression.cs (SizeOf.DoResolve): Use ResolveTypeExpr, so we can
13821         probe if its a type parameter, and if so, flag an error.
13822
13823         * decl.cs: Move here the SetParameterInfo code from class.cs.
13824         Handle IsGeneric here.
13825
13826         Handle a variety of errors in the parameter info definition.
13827
13828         * ecore.cs (SimpleName.DoResolveType): Handle look ups for generic
13829         type parameters here.
13830
13831         * cs-parser.jay (class_declaration): report errors for parameters
13832         here as well.
13833
13834 2003-01-21  Miguel de Icaza  <miguel@ximian.com>
13835
13836         * generic.cs: New file, contains support code for generics.
13837
13838         * cs-parser.jay: Remove OP_SHIFT_LEFT, OP_SHIFT_RIGHT,
13839         OP_SHIFT_LEFT_ASSIGN, OP_SHIFT_RIGHT_ASSIGN.
13840
13841         Update parser for the above removals.
13842
13843         * cs-tokenizer.cs: Do not handle <<= or >>= specially.  This is
13844         now taken care of in the parser.
13845
13846 2003-04-02  Miguel de Icaza  <miguel@ximian.com>
13847
13848         * class.cs (Event.Define): Do not allow abstract events to have
13849         initializers. 
13850
13851 2003-04-01  Miguel de Icaza  <miguel@ximian.com>
13852
13853         * cs-parser.jay: Add error productions for ADD/REMOVE missing a
13854         block in event declarations.
13855
13856         * ecore.cs (FieldExpr.AddressOf): If our instance expression is a
13857         value type, get its address.
13858
13859         * expression.cs (Is.Emit): For action `LeaveOnStack' we were
13860         leaving a class on the stack instead of a boolean value (int
13861         0/1).  Change the code so we compare against null, and then the
13862         result against zero.
13863
13864         * class.cs (TypeContainer.GetClassBases): We were checking for the
13865         parent class being sealed too late.
13866
13867         * expression.cs (Binary.Emit): For <= and >= when dealing with
13868         floating point values, use cgt.un and clt.un instead of cgt and
13869         clt alone.
13870
13871 2003-04-01  Zoltan Varga  <vargaz@freemail.hu>
13872
13873         * statement.cs: Apply the same optimization as MS: skip the 
13874         GetEnumerator returning an IEnumerator, and use the one returning a 
13875         CharEnumerator instead. This allows us to avoid the try-finally block 
13876         and the boxing.
13877
13878 2003-03-31  Gaurav Vaish <gvaish_mono@lycos.com>
13879
13880         * cs-parser.jay: Attributes cannot be applied to
13881                          namespaces. Fixes #40473
13882
13883 2003-03-31  Gonzalo Paniagua Javier <gonzalo@ximian.com>
13884
13885         * class.cs:
13886         (Add*): check if the name is valid using the full name for constants,
13887         fields, properties and events.
13888
13889 2003-03-28  Miguel de Icaza  <miguel@ximian.com>
13890
13891         * enum.cs (Enum.DefineType, Enum.IsValidEnumConstant): Also allow
13892         char constants to be part of the enumeration.
13893
13894         * expression.cs (Conditional.DoResolve): Add support for operator
13895         true. Implements the missing functionality from 14.12
13896
13897         * class.cs (TypeContainer.CheckPairedOperators): Report error for missmatch on
13898         operator true/false as required by the spec.
13899
13900         * expression.cs (Unary.ResolveOperator): In LogicalNot, do an
13901         implicit conversion to boolean.
13902
13903         * statement.cs (Statement.ResolveBoolean): A boolean expression is
13904         also one where the type implements `operator true'. 
13905
13906         * ecore.cs (Expression.GetOperatorTrue): New helper routine to
13907         get an expression that will invoke operator true based on an
13908         expression.  
13909
13910         (GetConversionOperators): Removed the hack that called op_True
13911         here.  
13912
13913         (Expression.ResolveBoolean): Move this from Statement.
13914
13915 2003-03-17  Miguel de Icaza  <miguel@ximian.com>
13916
13917         * ecore.cs (FieldExpr): do not allow initialization of initonly
13918         fields on derived classes
13919
13920 2003-03-13  Martin Baulig  <martin@ximian.com>
13921
13922         * statement.cs (Block.Emit): Call ig.BeginScope() and
13923         ig.EndScope() when compiling with debugging info; call
13924         LocalBuilder.SetLocalSymInfo _after_ opening the scope.
13925
13926 2003-03-08  Miguel de Icaza  <miguel@ximian.com>
13927
13928         * expression.cs (Indexers): Do not construct immediately, allow
13929         for new members to be appended as we go.  Fixes 38143
13930
13931 2003-03-07  Gonzalo Paniagua Javier <gonzalo@ximian.com>
13932
13933         * expression.cs: save/restore context when resolving an unchecked
13934         expression.
13935
13936 2003-03-05  Miguel de Icaza  <miguel@ximian.com>
13937
13938         * cfold.cs: Catch division by zero in modulus operator during
13939         constant folding.
13940
13941 2003-03-03  Miguel de Icaza  <miguel@ximian.com>
13942
13943         * interface.cs (Interface.DefineMembers): Avoid defining members
13944         twice. 
13945
13946 2003-02-27  Miguel de Icaza  <miguel@ximian.com>
13947
13948         * driver.cs: handle the +/- options for -noconfig
13949
13950         * statement.cs (Unckeched.Resolve): Also track the state of
13951         unchecked in the Resolve phase.
13952
13953 2003-02-27  Martin Baulig  <martin@ximian.com>
13954
13955         * ecore.cs (Expression.MemberLookup): Don't create a
13956         MethodGroupExpr for something which is not a method.  Fixes #38291.
13957
13958 2003-02-25  Miguel de Icaza  <miguel@ximian.com>
13959
13960         * class.cs (MemberBase.CheckParameters): Also check that the type
13961         is unmanaged if it is a pointer.
13962
13963         * expression.cs (SizeOf.Resolve): Add location information.
13964
13965         * statement.cs (Block.EmitMeta): Flag error (208) if a pointer to
13966         a managed type is declared.
13967
13968         * expression.cs (Invocation.VerifyArgumentsCompat): Check for the
13969         parameter modifiers as well.  Fixes bug 38606
13970
13971         * class.cs: Very sad.  Am backing out the speed up changes
13972         introduced by the ArrayList -> Array in the TypeContainer, as they
13973         were not actually that much faster, and introduced a bug (no error
13974         reports on duplicated methods).
13975
13976         * assign.cs (CompoundAssign.DoLResolve): Resolve the original
13977         source first, this will guarantee that we have a valid expression
13978         before calling in lower levels functions that will require a
13979         resolved object.  Then use this original_source in the
13980         target.ResolveLValue instead of the original source that was
13981         passed to us.
13982
13983         Another change.  Use target.Resolve instead of LValueResolve.
13984         Although we are resolving for LValues, we will let the Assign code
13985         take care of that (it will be called again from Resolve).  This
13986         basically allows code like this:
13987
13988         class X { X operator + (X x, object o) {} X this [int idx] { get; set; } }
13989         class Y { void A (X x) { x [0] += o; }
13990
13991         The problem was that the indexer was trying to resolve for
13992         set_Item (idx, object o) and never finding one.  The real set_Item
13993         was set_Item (idx, X).  By delaying the process we get the right
13994         semantics. 
13995
13996         Fixes bug 36505
13997
13998 2003-02-23  Martin Baulig  <martin@ximian.com>
13999
14000         * statement.cs (Block.Emit): Override this and set ec.CurrentBlock
14001         while calling DoEmit ().
14002
14003         * codegen.cs (EmitContext.Mark): Don't mark locations in other
14004         source files; if you use the #line directive inside a method, the
14005         compiler stops emitting line numbers for the debugger until it
14006         reaches the end of the method or another #line directive which
14007         restores the original file.
14008
14009 2003-02-23  Martin Baulig  <martin@ximian.com>
14010
14011         * statement.cs (FlowBranching.UsageVector.MergeChildren): Fix bug #37708.
14012
14013 2003-02-23  Martin Baulig  <martin@ximian.com>
14014
14015         * statement.cs (Block.AddChildVariableNames): We need to call this
14016         recursively, not just for our immediate children.
14017
14018 2003-02-23  Martin Baulig  <martin@ximian.com>
14019
14020         * class.cs (Event.Define): Always make the field private, like csc does.
14021
14022         * typemanager.cs (TypeManager.RealMemberLookup): Make events
14023         actually work, fixes bug #37521.
14024
14025 2003-02-23  Miguel de Icaza  <miguel@ximian.com>
14026
14027         * delegate.cs: When creating the various temporary "Parameters"
14028         classes, make sure that we call the ComputeAndDefineParameterTypes
14029         on those new parameters (just like we do with the formal ones), to
14030         allow them to be resolved in the context of the DeclSpace.
14031
14032         This fixes the bug that Dick observed in Bugzilla #38530.
14033
14034 2003-02-22  Miguel de Icaza  <miguel@ximian.com>
14035
14036         * expression.cs (ResolveMemberAccess): When resolving a constant,
14037         do not attempt to pull a constant if the value was not able to
14038         generate a valid constant.
14039
14040         * const.cs (LookupConstantValue): Do not report more errors than required.
14041
14042 2003-02-19  Gonzalo Paniagua Javier <gonzalo@ximian.com>
14043
14044         * expression.cs: fixes bug #38328.
14045
14046 2003-02-18  Miguel de Icaza  <miguel@ximian.com>
14047
14048         * class.cs: Changed all the various members that can be part of a
14049         class from being an ArrayList to be an Array of the right type.
14050         During the DefineType type_list, interface_list, delegate_list and
14051         enum_list are turned into types, interfaces, delegates and enums
14052         arrays.  
14053
14054         And during the member population, indexer_list, event_list,
14055         constant_list, field_list, instance_constructor_list, method_list,
14056         operator_list and property_list are turned into their real arrays.
14057
14058         Although we could probably perform this operation earlier, for
14059         good error reporting we need to keep the lists and remove the
14060         lists for longer than required.
14061
14062         This optimization was triggered by Paolo profiling the compiler
14063         speed on the output of `gen-sample-program.pl' perl script. 
14064
14065         * decl.cs (DeclSpace.ResolveType): Set the ContainerType, so we do
14066         not crash in methods like MemberLookupFailed that use this field.  
14067
14068         This problem arises when the compiler fails to resolve a type
14069         during interface type definition for example.
14070
14071 2003-02-18  Miguel de Icaza  <miguel@ximian.com>
14072
14073         * expression.cs (Indexers.GetIndexersForType): Interfaces do not
14074         inherit from System.Object, so we have to stop at null, not only
14075         when reaching System.Object.
14076
14077 2003-02-17  Miguel de Icaza  <miguel@ximian.com>
14078
14079         * expression.cs: (Indexers.GetIndexersForType): Martin's fix used
14080         DeclaredOnly because the parent indexer might have had a different
14081         name, but did not loop until the top of the hierarchy was reached.
14082
14083         The problem this one fixes is 35492: when a class implemented an
14084         indexer from an interface, we were getting the interface method
14085         (which was abstract) and we were flagging an error (can not invoke
14086         abstract method).
14087
14088         This also keeps bug 33089 functioning, and test-148 functioning.
14089
14090         * typemanager.cs (IsSpecialMethod): The correct way of figuring
14091         out if a method is special is to see if it is declared in a
14092         property or event, or whether it is one of the predefined operator
14093         names.   This should fix correctly #36804.
14094
14095 2003-02-15  Miguel de Icaza  <miguel@ximian.com>
14096
14097         The goal here is to remove the dependency on EmptyCast.Peel ().
14098         Killing it completely.
14099
14100         The problem is that currently in a number of places where
14101         constants are expected, we have to "probe" for an EmptyCast, and
14102         Peel, which is not the correct thing to do, as this will be
14103         repetitive and will likely lead to errors. 
14104
14105         The idea is to remove any EmptyCasts that are used in casts that
14106         can be reduced to constants, so we only have to cope with
14107         constants. 
14108
14109         This bug hunt was triggered by Bug 37363 and the desire to remove
14110         the duplicate pattern where we were "peeling" emptycasts to check
14111         whether they were constants.  Now constants will always be
14112         constants.
14113
14114         * ecore.cs: Use an enumconstant here instead of wrapping with
14115         EmptyCast.  
14116
14117         * expression.cs (Cast.TryReduce): Ah, the tricky EnumConstant was
14118         throwing me off.  By handling this we can get rid of a few hacks.
14119
14120         * statement.cs (Switch): Removed Peel() code.
14121
14122 2003-02-14  Miguel de Icaza  <miguel@ximian.com>
14123
14124         * class.cs: Location information for error 508
14125
14126         * expression.cs (New.DoResolve): Add a guard against double
14127         resolution of an expression.  
14128
14129         The New DoResolve might be called twice when initializing field
14130         expressions (see EmitFieldInitializers, the call to
14131         GetInitializerExpression will perform a resolve on the expression,
14132         and later the assign will trigger another resolution
14133
14134         This leads to bugs (#37014)
14135
14136         * delegate.cs: The signature for EndInvoke should contain any ref
14137         or out parameters as well.  We were not doing this in the past. 
14138
14139         * class.cs (Field.Define): Do not overwrite the type definition
14140         inside the `volatile' group.  Turns out that volatile enumerations
14141         were changing the type here to perform a validity test, which
14142         broke conversions. 
14143
14144 2003-02-12  Miguel de Icaza  <miguel@ximian.com>
14145
14146         * ecore.cs (FieldExpr.AddressOf): In the particular case of This
14147         and structs, we do not want to load the instance variable
14148
14149         (ImplicitReferenceConversion, ImplicitReferenceConversionExists):
14150         enum_type has to be handled like an object reference (implicit
14151         conversions exists from this to object), but the regular IsClass
14152         and IsValueType tests will never return true for this one.
14153
14154         Also we use TypeManager.IsValueType instead of type.IsValueType,
14155         just for consistency with the rest of the code (this is only
14156         needed if we ever use the construct exposed by test-180.cs inside
14157         corlib, which we dont today).
14158
14159 2003-02-12  Zoltan Varga  <vargaz@freemail.hu>
14160
14161         * attribute.cs (ApplyAttributes): apply all MethodImplAttributes, not
14162         just InternalCall.
14163
14164 2003-02-09  Martin Baulig  <martin@ximian.com>
14165
14166         * namespace.cs (Namespace..ctor): Added SourceFile argument.
14167         (Namespace.DefineNamespaces): New static public method; this is
14168         called when we're compiling with debugging to add all namespaces
14169         to the symbol file.
14170
14171         * tree.cs (Tree.RecordNamespace): Added SourceFile argument and
14172         pass it to the Namespace's .ctor.
14173
14174         * symbolwriter.cs (SymbolWriter.OpenMethod): Added TypeContainer
14175         and MethodBase arguments; pass the namespace ID to the symwriter;
14176         pass the MethodBase instead of the token to the symwriter.
14177         (SymbolWriter.DefineNamespace): New method to add a namespace to
14178         the symbol file.
14179
14180 2003-02-09  Martin Baulig  <martin@ximian.com>
14181
14182         * symbolwriter.cs: New file.  This is a wrapper around
14183         ISymbolWriter with a cleaner API.  We'll dynamically Invoke()
14184         methods here in near future.
14185
14186 2003-02-09  Martin Baulig  <martin@ximian.com>
14187
14188         * codegen.cs (EmitContext.Mark): Just pass the arguments to
14189         ILGenerator.MarkSequencePoint() which are actually used by the
14190         symbol writer.
14191
14192 2003-02-09  Martin Baulig  <martin@ximian.com>
14193
14194         * location.cs (SourceFile): New public sealed class.  This
14195         contains the name and an index which is used in the location's token.
14196         (Location): Reserve an appropriate number of bits in the token for
14197         the source file instead of walking over that list, this gives us a
14198         really huge performance improvement when compiling with debugging.
14199
14200         * driver.cs (Driver.parse, Driver.tokenize_file): Take a
14201         `SourceFile' argument instead of a string.
14202         (Driver.ProcessFile): Add all the files via Location.AddFile(),
14203         but don't parse/tokenize here, we need to generate the list of all
14204         source files before we do that.
14205         (Driver.ProcessFiles): New static function.  Parses/tokenizes all
14206         the files.
14207
14208         * cs-parser.jay (CSharpParser): Take a `SourceFile' argument
14209         instead of a string.
14210
14211         * cs-tokenizer.cs (Tokenizer): Take `SourceFile' argument instead
14212         of a string.
14213
14214 2003-02-09  Martin Baulig  <martin@ximian.com>
14215
14216         * cs-tokenizer.cs (Tokenizer.PreProcessLine): Also reset the
14217         filename on `#line default'.
14218
14219 Sat Feb 8 17:03:16 CET 2003 Paolo Molaro <lupus@ximian.com>
14220
14221         * statement.cs: don't clear the pinned var when the fixed statement
14222         returns from the method (fixes bug#37752).
14223
14224 Sat Feb 8 12:58:06 CET 2003 Paolo Molaro <lupus@ximian.com>
14225
14226         * typemanager.cs: fix from mathpup@mylinuxisp.com (Marcus Urban) 
14227         to IsValueType.
14228
14229 2003-02-07  Martin Baulig  <martin@ximian.com>
14230
14231         * driver.cs: Removed the `--debug-args' command line argument.
14232
14233         * codegen.cs (CodeGen.SaveSymbols): Removed, this is now done
14234         automatically by the AsssemblyBuilder.
14235         (CodeGen.InitializeSymbolWriter): We don't need to call any
14236         initialization function on the symbol writer anymore.  This method
14237         doesn't take any arguments.
14238
14239 2003-02-03  Miguel de Icaza  <miguel@ximian.com>
14240
14241         * driver.cs: (AddAssemblyAndDeps, LoadAssembly): Enter the types
14242         from referenced assemblies as well.
14243
14244 2003-02-02  Martin Baulig  <martin@ximian.com>
14245
14246         * class.cs (MethodData.Emit): Generate debugging info for external methods.
14247
14248 2003-02-02  Martin Baulig  <martin@ximian.com>
14249
14250         * class.cs (Constructor.Emit): Open the symbol writer before
14251         emitting the constructor initializer.
14252         (ConstructorInitializer.Emit): Call ec.Mark() to allow
14253         single-stepping through constructor initializers.
14254
14255 2003-01-30  Miguel de Icaza  <miguel@ximian.com>
14256
14257         * class.cs: Handle error 549: do not allow virtual methods in
14258         sealed classes. 
14259
14260 2003-02-01 Jackson Harper <jackson@latitudegeo.com>
14261
14262         * decl.cs: Check access levels when resolving types
14263
14264 2003-01-31 Jackson Harper <jackson@latitudegeo.com>
14265
14266         * statement.cs: Add parameters and locals set in catch blocks that might 
14267         return to set vector
14268
14269 2003-01-29  Miguel de Icaza  <miguel@ximian.com>
14270
14271         * class.cs (Operator): Set the SpecialName flags for operators.
14272
14273         * expression.cs (Invocation.DoResolve): Only block calls to
14274         accessors and operators on SpecialName methods.
14275
14276         (Cast.TryReduce): Handle conversions from char constants.
14277
14278
14279 Tue Jan 28 17:30:57 CET 2003 Paolo Molaro <lupus@ximian.com>
14280
14281         * statement.cs: small memory and time optimization in FlowBranching.
14282
14283 2003-01-28  Pedro Mart  <yoros@wanadoo.es>
14284
14285         * expression.cs (IndexerAccess.DoResolveLValue): Resolve the same
14286         problem that the last fix but in the other sid (Set).
14287
14288         * expression.cs (IndexerAccess.DoResolve): Fix a problem with a null
14289         access when there is no indexer in the hierarchy.
14290
14291 2003-01-27 Jackson Harper <jackson@latitudegeo.com>
14292
14293         * class.cs: Combine some if statements.
14294
14295 2003-01-27  Gonzalo Paniagua Javier <gonzalo@ximian.com>
14296
14297         * driver.cs: fixed bug #37187.
14298
14299 2003-01-27  Pedro Martinez Juliá  <yoros@wanadoo.es>
14300
14301         * expression.cs (IndexerAccess.DoResolve): Before trying to resolve
14302         any indexer, it's needed to build a list with all the indexers in the
14303         hierarchy (AllGetters), else we have problems. Fixes #35653.
14304
14305 2003-01-23  Miguel de Icaza  <miguel@ximian.com>
14306
14307         * class.cs (MethodData.Define): It is wrong for an interface
14308         implementation to be static in both cases: explicit and implicit.
14309         We were only handling this in one case.
14310
14311         Improve the if situation there to not have negations.
14312
14313         * class.cs (Field.Define): Turns out that we do not need to check
14314         the unsafe bit on field definition, only on usage.  Remove the test.
14315
14316 2003-01-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
14317
14318         * driver.cs: use assembly.Location instead of Codebase (the latest
14319         patch made mcs fail when using MS assemblies).
14320
14321 2003-01-21  Tim Haynes <thaynes@openlinksw.com>
14322
14323         * driver.cs: use DirectorySeparatorChar instead of a hardcoded "/" to
14324         get the path to *corlib.dll.
14325
14326 2003-01-21  Nick Drochak <ndrochak@gol.com>
14327
14328         * cs-tokenizer.cs:
14329         * pending.cs:
14330         * typemanager.cs: Remove compiler warnings
14331
14332 2003-01-20  Duncan Mak  <duncan@ximian.com>
14333
14334         * AssemblyInfo.cs: Bump the version number to 0.19.
14335
14336 2003-01-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
14337
14338         * cs-tokenizer.cs: little fixes to line numbering when #line is used.
14339
14340 2003-01-18  Zoltan Varga  <vargaz@freemail.hu>
14341
14342         * class.cs (Constructor::Emit): Emit debugging info for constructors.
14343
14344 2003-01-17  Miguel de Icaza  <miguel@ximian.com>
14345
14346         * cs-parser.jay: Small fix: we were not comparing the constructor
14347         name correctly.   Thanks to Zoltan for the initial pointer.
14348
14349 2003-01-16 Jackson Harper <jackson@latitudegeo.com>
14350
14351         * cs-tokenizer.cs: Set file name when specified with #line
14352
14353 2003-01-15  Miguel de Icaza  <miguel@ximian.com>
14354
14355         * cs-parser.jay: Only perform the constructor checks here if we
14356         are named like the class;  This will help provider a better
14357         error.  The constructor path is taken when a type definition is
14358         not found, but most likely the user forgot to add the type, so
14359         report that rather than the constructor error.
14360
14361 Tue Jan 14 10:36:49 CET 2003 Paolo Molaro <lupus@ximian.com>
14362
14363         * class.cs, rootcontext.cs: small changes to avoid unnecessary memory
14364         allocations.
14365
14366 2003-01-13 Jackson Harper <jackson@latitudegeo.com>
14367
14368         * cs-parser.jay: Add cleanup call.
14369
14370 2003-01-13  Duncan Mak  <duncan@ximian.com>
14371
14372         * cs-tokenizer.cs (Cleanup): Rename to 'cleanup' to make it more
14373         consistent with other methods.
14374
14375 2003-01-13 Jackson Harper <jackson@latitudegeo.com>
14376
14377         * cs-tokenizer.cs: Add Cleanup method, also fix #region error messages.
14378
14379 Sun Jan 12 19:58:42 CET 2003 Paolo Molaro <lupus@ximian.com>
14380
14381         * attribute.cs: only set GuidAttr to true when we have a
14382         GuidAttribute.
14383
14384 2003-01-09  Gonzalo Paniagua Javier <gonzalo@ximian.com>
14385
14386         * ecore.cs:
14387         * expression.cs:
14388         * typemanager.cs: fixes to allow mcs compile corlib with the new
14389         Type.IsSubclassOf fix.
14390
14391 2003-01-08  Miguel de Icaza  <miguel@ximian.com>
14392
14393         * expression.cs (LocalVariableReference.DoResolve): Classify a
14394         constant as a value, not as a variable.   Also, set the type for
14395         the variable.
14396
14397         * cs-parser.jay (fixed_statement): take a type instead of a
14398         pointer_type, so we can produce a better error message later.
14399
14400         * statement.cs (Fixed.Resolve): Flag types that are not pointers
14401         as an error.  
14402
14403         (For.DoEmit): Make inifinite loops have a
14404         non-conditional branch back.
14405
14406         (Fixed.DoEmit): First populate the pinned variables, then emit the
14407         statement, then clear the variables.  Before I was emitting the
14408         code once for each fixed piece.
14409
14410
14411 2003-01-08  Martin Baulig  <martin@ximian.com>
14412
14413         * statement.cs (FlowBranching.MergeChild): A break in a
14414         SWITCH_SECTION does not leave a loop.  Fixes #36155.
14415
14416 2003-01-08  Martin Baulig  <martin@ximian.com>
14417
14418         * statement.cs (FlowBranching.CheckOutParameters): `struct_params'
14419         lives in the same number space than `param_map'.  Fixes #36154.
14420
14421 2003-01-07  Miguel de Icaza  <miguel@ximian.com>
14422
14423         * cs-parser.jay (constructor_declaration): Set the
14424         Constructor.ModFlags before probing for it.  This makes the
14425         compiler report 514, 515 and 132 (the code was there, but got
14426         broken). 
14427
14428         * statement.cs (Goto.Resolve): Set `Returns' to ALWAYS.
14429         (GotoDefault.Resolve): Set `Returns' to ALWAYS.
14430         (GotoCase.Resolve): Set `Returns' to ALWAYS.
14431
14432 Tue Jan 7 18:32:24 CET 2003 Paolo Molaro <lupus@ximian.com>
14433
14434         * enum.cs: create the enum static fields using the enum type.
14435
14436 Tue Jan 7 18:23:44 CET 2003 Paolo Molaro <lupus@ximian.com>
14437
14438         * class.cs: don't try to create the ParamBuilder for the return
14439         type if it's not needed (and handle it breaking for the ms runtime
14440         anyway).
14441
14442 2003-01-06 Jackson Harper <jackson@latitudegeo.com>
14443
14444         * cs-tokenizer.cs: Add REGION flag to #region directives, and add checks to make sure that regions are being poped correctly
14445
14446 2002-12-29  Miguel de Icaza  <miguel@ximian.com>
14447
14448         * cs-tokenizer.cs (get_cmd_arg): Fixups to allow \r to terminate
14449         the command.   This showed up while compiling the JANET source
14450         code, which used \r as its only newline separator.
14451
14452 2002-12-28  Miguel de Icaza  <miguel@ximian.com>
14453
14454         * class.cs (Method.Define): If we are an operator (because it
14455         reuses our code), then set the SpecialName and HideBySig.  #36128
14456
14457 2002-12-22  Miguel de Icaza  <miguel@ximian.com>
14458
14459         * ecore.cs (FieldExpr.DoResolve): Instead of throwing an
14460         exception, report error 120 `object reference required'.
14461
14462         * driver.cs: Add --pause option, used during to measure the size
14463         of the process as it goes with --timestamp.
14464
14465         * expression.cs (Invocation.DoResolve): Do not allow methods with
14466         SpecialName to be invoked.
14467
14468 2002-12-21  Miguel de Icaza  <miguel@ximian.com>
14469
14470         * cs-tokenizer.cs: Small fix to the parser: compute the ascii
14471         number before adding it.
14472
14473 2002-12-21  Ravi Pratap  <ravi@ximian.com>
14474
14475         * ecore.cs (StandardImplicitConversion): When in an unsafe
14476         context, we allow conversion between void * to any other pointer
14477         type. This fixes bug #35973.
14478
14479 2002-12-20 Jackson Harper <jackson@latitudegeo.com>
14480
14481         * codegen.cs: Use Path.GetFileNameWithoutExtension so an exception
14482         is not thrown when extensionless outputs are used 
14483
14484 2002-12-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
14485
14486         * rootcontext.cs: fixed compilation of corlib.
14487
14488 2002-12-19  Miguel de Icaza  <miguel@ximian.com>
14489
14490         * attribute.cs (Attributes.Contains): Add new method.
14491
14492         * class.cs (MethodCore.LabelParameters): if the parameter is an
14493         `out' parameter, check that no attribute `[In]' has been passed.
14494
14495         * enum.cs: Handle the `value__' name in an enumeration.
14496
14497 2002-12-14  Jaroslaw Kowalski <jarek@atm.com.pl>
14498
14499         * decl.cs: Added special case to allow overrides on "protected
14500         internal" methods
14501
14502 2002-12-18  Ravi Pratap  <ravi@ximian.com>
14503
14504         * attribute.cs (Attributes.AddAttributeSection): Rename to this
14505         since it makes much more sense.
14506
14507         (Attributes.ctor): Don't require a Location parameter.
14508
14509         * rootcontext.cs (AddGlobalAttributeSection): Rename again.
14510
14511         * attribute.cs (ApplyAttributes): Remove extra Location parameters
14512         since we already have that information per attribute.
14513
14514         * everywhere : make appropriate changes.
14515
14516         * class.cs (LabelParameters): Write the code which actually
14517         applies attributes to the return type. We can't do this on the MS
14518         .NET runtime so we flag a warning in the case an exception is
14519         thrown.
14520
14521 2002-12-18  Miguel de Icaza  <miguel@ximian.com>
14522
14523         * const.cs: Handle implicit null conversions here too.
14524
14525 2002-12-17  Ravi Pratap  <ravi@ximian.com>
14526
14527         * class.cs (MethodCore.LabelParameters): Remove the extra
14528         Type [] parameter since it is completely unnecessary. Instead
14529         pass in the method's attributes so that we can extract
14530         the "return" attribute.
14531
14532 2002-12-17  Miguel de Icaza  <miguel@ximian.com>
14533
14534         * cs-parser.jay (parse): Use Report.Error to flag errors instead
14535         of ignoring it and letting the compile continue.
14536
14537         * typemanager.cs (ChangeType): use an extra argument to return an
14538         error condition instead of throwing an exception.
14539
14540 2002-12-15  Miguel de Icaza  <miguel@ximian.com>
14541
14542         * expression.cs (Unary.TryReduce): mimic the code for the regular
14543         code path.  Perform an implicit cast in the cases where we can
14544         implicitly convert to one of the integral types, and then reduce
14545         based on that constant.   This fixes bug #35483.
14546
14547 2002-12-14  Gonzalo Paniagua Javier <gonzalo@ximian.com>
14548
14549         * typemanager.cs: fixed cut & paste error in GetRemoveMethod.
14550
14551 2002-12-13  Gonzalo Paniagua Javier <gonzalo@ximian.com>
14552
14553         * namespace.cs: fixed bug #35489.
14554
14555 2002-12-12  Miguel de Icaza  <miguel@ximian.com>
14556
14557         * class.cs: Remove some dead code.
14558
14559         * cs-parser.jay: Estimate the number of methods needed
14560         (RootContext.MethodCount);
14561
14562         * cs-tokenizer.cs: Use char arrays for parsing identifiers and
14563         numbers instead of StringBuilders.
14564
14565         * support.cs (PtrHashtable): Add constructor with initial size;
14566         We can now reduce reallocations of the method table.
14567
14568 2002-12-10  Ravi Pratap  <ravi@ximian.com>
14569
14570         * attribute.cs (ApplyAttributes): Keep track of the emitted
14571         attributes on a per-target basis. This fixes bug #35413.
14572
14573 2002-12-10  Miguel de Icaza  <miguel@ximian.com>
14574
14575         * driver.cs (MainDriver): On rotor encoding 28591 does not exist,
14576         default to the Windows 1252 encoding.
14577
14578         (UnixParseOption): Support version, thanks to Alp for the missing
14579         pointer. 
14580
14581         * AssemblyInfo.cs: Add nice assembly information.
14582
14583         * cs-tokenizer.cs: Add fix from Felix to the #if/#else handler
14584         (bug 35169).
14585
14586         * cs-parser.jay: Allow a trailing comma before the close bracked
14587         in the attribute_section production.
14588
14589         * ecore.cs (FieldExpr.AddressOf): Until I figure out why the
14590         address of the instance was being taken, I will take this out,
14591         because we take the address of the object immediately here.
14592
14593 2002-12-09  Ravi Pratap  <ravi@ximian.com>
14594
14595         * typemanager.cs (AreMultipleAllowed): Take care of the most
14596         obvious case where attribute type is not in the current assembly -
14597         stupid me ;-)
14598
14599 2002-12-08  Miguel de Icaza  <miguel@ximian.com>
14600
14601         * ecore.cs (SimpleName.DoResolve): First perform lookups on using
14602         definitions, instead of doing that afterwards.  
14603
14604         Also we use a nice little hack, depending on the constructor, we
14605         know if we are a "composed" name or a simple name.  Hence, we
14606         avoid the IndexOf test, and we avoid 
14607
14608         * codegen.cs: Add code to assist in a bug reporter to track down
14609         the source of a compiler crash. 
14610
14611 2002-12-07  Ravi Pratap  <ravi@ximian.com>
14612
14613         * attribute.cs (Attribute.ApplyAttributes) : Keep track of which attribute
14614         types have been emitted for a given element and flag an error
14615         if something which does not have AllowMultiple set is used more
14616         than once.
14617
14618         * typemanager.cs (RegisterAttributeAllowMultiple): Keep track of
14619         attribute types and their corresponding AllowMultiple properties
14620
14621         (AreMultipleAllowed): Check the property for a given type.
14622
14623         * attribute.cs (Attribute.ApplyAttributes): Register the AllowMultiple
14624         property in the case we have a TypeContainer.
14625
14626         (Attributes.AddAttribute): Detect duplicates and just skip on
14627         adding them. This trivial fix catches a pretty gross error in our
14628         attribute emission - global attributes were being emitted twice!
14629
14630         Bugzilla bug #33187 is now fixed.
14631
14632 2002-12-06  Miguel de Icaza  <miguel@ximian.com>
14633
14634         * cs-tokenizer.cs (pp_expr): Properly recurse here (use pp_expr
14635         instead of pp_and).
14636
14637         * expression.cs (Binary.ResolveOperator): I can only use the
14638         Concat (string, string, string) and Concat (string, string,
14639         string, string) if the child is actually a concatenation of
14640         strings. 
14641
14642 2002-12-04  Miguel de Icaza  <miguel@ximian.com>
14643
14644         * cs-tokenizer.cs: Small fix, because decimal_digits is used in a
14645         context where we need a 2-character lookahead.
14646
14647         * pending.cs (PendingImplementation): Rework so we can keep track
14648         of interface types all the time, and flag those which were
14649         implemented by parents as optional.
14650
14651 2002-12-03  Miguel de Icaza  <miguel@ximian.com>
14652
14653         * expression.cs (Binary.ResolveOperator): Use
14654         String.Concat(string,string,string) or
14655         String.Concat(string,string,string,string) when possible. 
14656
14657         * typemanager: More helper methods.
14658
14659
14660 Tue Dec 3 19:32:04 CET 2002 Paolo Molaro <lupus@ximian.com>
14661
14662         * pending.cs: remove the bogus return from GetMissingInterfaces()
14663         (see the 2002-11-06 entry: the mono runtime is now fixed in cvs).
14664
14665 2002-12-02  Gonzalo Paniagua Javier <gonzalo@ximian.com>
14666
14667         * namespace.cs: avoid duplicated 'using xxx' being added to
14668         using_clauses. This prevents mcs from issuing and 'ambiguous type' error
14669         when we get more than one 'using' statement for the same namespace.
14670         Report a CS0105 warning for it.
14671
14672 2002-11-30  Miguel de Icaza  <miguel@ximian.com>
14673
14674         * cs-tokenizer.cs (consume_identifier): use read directly, instead
14675         of calling getChar/putback, uses internal knowledge of it.    
14676
14677         (xtoken): Reorder tokenizer so most common patterns are checked
14678         first.  This reduces the compilation time in another 5% (from 8.11s
14679         average to 7.73s for bootstrapping mcs on my Mobile p4/1.8ghz).
14680
14681         The parsing time is 22% of the compilation in mcs, and from that
14682         64% is spent on the tokenization process.  
14683
14684         I tried using a binary search for keywords, but this is slower
14685         than the hashtable.  Another option would be to do a couple of
14686         things:
14687
14688                 * Not use a StringBuilder, instead use an array of chars,
14689                   with a set value.  Notice that this way we could catch
14690                   the 645 error without having to do it *afterwards*.
14691
14692                 * We could write a hand-parser to avoid the hashtable
14693                   compares altogether.
14694
14695         The identifier consumption process takes 37% of the tokenization
14696         time.  Another 15% is spent on is_number.  56% of the time spent
14697         on is_number is spent on Int64.Parse:
14698
14699                 * We could probably choose based on the string length to
14700                   use Int32.Parse or Int64.Parse and avoid all the 64-bit
14701                   computations. 
14702
14703         Another 3% is spend on wrapping `xtoken' in the `token' function.
14704
14705         Handle 0xa0 as whitespace (#34752)
14706
14707 2002-11-26  Miguel de Icaza  <miguel@ximian.com>
14708
14709         * typemanager.cs (IsCLRType): New routine to tell whether a type
14710         is one of the builtin types.  
14711
14712         Maybe it needs to use TypeCodes to be faster.  Maybe we could use
14713         typecode in more places instead of doing pointer comparissions.
14714         We could leverage some knowledge about the way the typecodes are
14715         laid out.
14716
14717         New code to cache namespaces in assemblies, it is currently not
14718         invoked, to be used soon.
14719
14720         * decl.cs (DeclSpace.MakeFQN): Simple optimization.
14721
14722         * expression.cs (Binary.ResolveOperator): specially handle
14723         strings, and do not perform user-defined operator overloading for
14724         built-in types.
14725
14726 2002-11-24  Miguel de Icaza  <miguel@ximian.com>
14727
14728         * cs-tokenizer.cs: Avoid calling Char.IsDigit which is an
14729         internalcall as it is a pretty simple operation;  Avoid whenever
14730         possible to call Char.IsLetter.
14731
14732         (consume_identifier): Cut by half the number of
14733         hashtable calls by merging the is_keyword and GetKeyword behavior.
14734
14735         Do not short-circuit, because if we do, we
14736         report errors (ie, #if false && true would produce an invalid
14737         directive error);
14738
14739
14740 2002-11-24  Martin Baulig  <martin@ximian.com>
14741
14742         * expression.cs (Cast.TryReduce): If we're in checked syntax,
14743         check constant ranges and report a CS0221.  Fixes #33186.
14744
14745 2002-11-24  Martin Baulig  <martin@ximian.com>
14746
14747         * cs-parser.jay: Make this work for uninitialized variable
14748         declarations in the `for' initializer.  Fixes #32416.
14749
14750 2002-11-24  Martin Baulig  <martin@ximian.com>
14751
14752         * ecore.cs (Expression.ConvertExplicit): Make casting from/to
14753         System.Enum actually work.  Fixes bug #32269, added verify-6.cs.
14754
14755 2002-11-24  Martin Baulig  <martin@ximian.com>
14756
14757         * expression.cs (Binary.DoNumericPromotions): Added `check_user_conv'
14758         argument; if true, we also check for user-defined conversions.
14759         This is only needed if both arguments are of a user-defined type.
14760         Fixes #30443, added test-175.cs.
14761         (Binary.ForceConversion): Pass the location argument to ConvertImplicit.
14762
14763         * ecore.cs (Expression.ImplicitUserConversionExists): New method.
14764
14765 2002-11-24  Martin Baulig  <martin@ximian.com>
14766
14767         * expression.cs (ArrayAccess.GetStoreOpcode): New public static
14768         function to get the store opcode.
14769         (Invocation.EmitParams): Call ArrayAccess.GetStoreOpcode() and
14770         only emit the Ldelema if the store opcode is Stobj.  You must run
14771         both test-34 and test-167 to test this.  Fixes #34529.
14772
14773 2002-11-23  Martin Baulig  <martin@ximian.com>
14774
14775         * ecore.cs (Expression.MemberLookup): Added additional
14776         `qualifier_type' argument which is used when we're being called
14777         from MemberAccess.DoResolve() and null if we're called from a
14778         SimpleName lookup.
14779         (Expression.MemberLookupFailed): New method to report errors; this
14780         does the CS1540 check and reports the correct error message.
14781
14782         * typemanager.cs (MemberLookup): Added additional `qualifier_type'
14783         argument for the CS1540 check and redone the way how we're dealing
14784         with private members.  See the comment in the source code for details.
14785         (FilterWithClosure): Reverted this back to revision 1.197; renamed
14786         `closure_start_type' to `closure_qualifier_type' and check whether
14787         it's not null.  It was not this filter being broken, it was just
14788         being called with the wrong arguments.
14789
14790         * expression.cs (MemberAccess.DoResolve): use MemberLookupFinal()
14791         and pass it the correct `qualifier_type'; this also does the error
14792         handling for us.
14793
14794 2002-11-22  Miguel de Icaza  <miguel@ximian.com>
14795
14796         * expression.cs (Invocation.EmitParams): If the we are dealing
14797         with a non-built-in value type, load its address as well.
14798
14799         (ArrayCreation): Use a a pretty constant instead
14800         of the hardcoded value 2.   Use 6 instead of 2 for the number of
14801         static initializers.  
14802
14803         (ArrayCreation.EmitDynamicInitializers): Peel enumerations,
14804         because they are not really value types, just glorified integers. 
14805
14806         * driver.cs: Do not append .exe, the CSC compiler does not do it.
14807
14808         * ecore.cs: Remove redundant code for enumerations, make them use
14809         the same code path as everything else, fixes the casting issue
14810         with enumerations in Windows.Forms.
14811
14812         * attribute.cs: Do only cast to string if it is a string, the
14813         validation happens later.
14814
14815         * typemanager.cs: Temproary hack to avoid a bootstrap issue until
14816         people upgrade their corlibs.
14817
14818         * ecore.cs: Oops, enumerations were not following the entire code path
14819
14820 2002-11-21  Miguel de Icaza  <miguel@ximian.com>
14821
14822         * typemanager.cs (FilterWithClosure): Commented out the test for
14823         1540 in typemanager.cs, as it has problems when accessing
14824         protected methods from a parent class (see test-174.cs). 
14825
14826         * attribute.cs (Attribute.ValidateGuid): new method.
14827         (Attribute.Resolve): Use above.
14828
14829 2002-11-19  Miguel de Icaza  <miguel@ximian.com>
14830
14831         * enum.cs: In FindMembers, perform a recursive lookup for values. (34308)
14832
14833         * ecore.cs (SimpleName.SimpleNameResolve): Remove the special
14834         handling for enumerations, as we only needed the TypeContainer
14835         functionality to begin with (this is required for the fix below to
14836         work for enums that reference constants in a container class for
14837         example). 
14838
14839         * codegen.cs (EmitContext): Make TypeContainer a DeclSpace.
14840
14841         * enum.cs (Enum.Define): Use `this' instead of parent, so we have
14842         a valid TypeBuilder to perform lookups on.o
14843
14844         * class.cs (InheritableMemberSignatureCompare): Use true in the
14845         call to GetGetMethod and GetSetMethod, because we are comparing
14846         the signature, and we need to get the methods *even* if they are
14847         private. 
14848
14849         (PropertyBase.CheckBase): ditto.
14850
14851         * statement.cs (Switch.ResolveAndReduce, Block.EmitMeta,
14852         GotoCase.Resolve): Use Peel on EmpytCasts.
14853
14854         * ecore.cs (EmptyCast): drop child, add Peel method.
14855
14856 2002-11-17  Martin Baulig  <martin@ximian.com>
14857
14858         * ecore.cs (EmptyCast.Child): New public property.
14859
14860         * statement.cs (SwitchLabel.ResolveAndReduce): Check whether the
14861         label resolved to an EmptyCast.  Fixes #34162.
14862         (GotoCase.Resolve): Likewise.
14863         (Block.EmitMeta): Likewise.
14864
14865 2002-11-17  Martin Baulig  <martin@ximian.com>
14866
14867         * expression.cs (Invocation.BetterConversion): Prefer int over
14868         uint; short over ushort; long over ulong for integer literals.
14869         Use ImplicitConversionExists instead of StandardConversionExists
14870         since we also need to check for user-defined implicit conversions.
14871         Fixes #34165.  Added test-173.cs.
14872
14873 2002-11-16  Martin Baulig  <martin@ximian.com>
14874
14875         * expression.cs (Binary.EmitBranchable): Eliminate comparisions
14876         with the `true' and `false' literals.  Fixes #33151.
14877
14878 2002-11-16  Martin Baulig  <martin@ximian.com>
14879
14880         * typemanager.cs (RealMemberLookup): Reverted Miguel's patch from
14881         October 22nd; don't do the cs1540 check for static members.
14882
14883         * ecore.cs (PropertyExpr.ResolveAccessors): Rewrote this; we're
14884         now using our own filter here and doing the cs1540 check again.
14885
14886 2002-11-16  Martin Baulig  <martin@ximian.com>
14887
14888         * support.cs (InternalParameters): Don't crash if we don't have
14889         any fixed parameters.  Fixes #33532.
14890
14891 2002-11-16  Martin Baulig  <martin@ximian.com>
14892
14893         * decl.cs (MemberCache.AddMethods): Use BindingFlags.FlattenHierarchy
14894         when looking up static methods to make this work on Windows.
14895         Fixes #33773.
14896
14897 2002-11-16  Martin Baulig  <martin@ximian.com>
14898
14899         * ecore.cs (PropertyExpr.VerifyAssignable): Check whether we have
14900         a setter rather than using PropertyInfo.CanWrite.
14901
14902 2002-11-15  Nick Drochak  <ndrochak@gol.com>
14903
14904         * class.cs: Allow acces to block member by subclasses. Fixes build
14905         breaker.
14906
14907 2002-11-14  Martin Baulig  <martin@ximian.com>
14908
14909         * class.cs (Constructor.Emit): Added the extern/block check.
14910         Fixes bug #33678.
14911
14912 2002-11-14  Martin Baulig  <martin@ximian.com>
14913
14914         * expression.cs (IndexerAccess.DoResolve): Do a DeclaredOnly
14915         iteration while looking for indexers, this is needed because the
14916         indexer may have a different name in our base classes.  Fixed the
14917         error reporting (no indexers at all, not get accessor, no
14918         overloaded match).  Fixes bug #33089.
14919         (IndexerAccess.DoResolveLValue): Likewise.
14920
14921 2002-11-14  Martin Baulig  <martin@ximian.com>
14922
14923         * class.cs (PropertyBase.CheckBase): Make this work for multiple
14924         indexers.  Fixes the first part of bug #33089.
14925         (MethodSignature.InheritableMemberSignatureCompare): Added support
14926         for properties.
14927
14928 2002-11-13  Ravi Pratap  <ravi@ximian.com>
14929
14930         * attribute.cs (Attribute.Resolve): Catch the
14931         NullReferenceException and report it since it isn't supposed to
14932         happen. 
14933
14934 2002-11-12  Miguel de Icaza  <miguel@ximian.com>
14935
14936         * expression.cs (Binary.EmitBranchable): Also handle the cases for
14937         LogicalOr and LogicalAnd that can benefit from recursively
14938         handling EmitBranchable.  The code now should be nice for Paolo.
14939
14940 2002-11-08  Miguel de Icaza  <miguel@ximian.com>
14941
14942         * typemanager.cs (LookupType): Added a negative-hit hashtable for
14943         the Type lookups, as we perform quite a number of lookups on
14944         non-Types.  This can be removed once we can deterministically tell
14945         whether we have a type or a namespace in advance.
14946
14947         But this might require special hacks from our corlib.
14948
14949         * TODO: updated.
14950
14951         * ecore.cs (TryImplicitIntConversion): Handle conversions to float
14952         and double which avoids a conversion from an integer to a double.
14953
14954         * expression.cs: tiny optimization, avoid calling IsConstant,
14955         because it effectively performs the lookup twice.
14956
14957 2002-11-06  Miguel de Icaza  <miguel@ximian.com>
14958
14959         But a bogus return here to keep the semantics of the old code
14960         until the Mono runtime is fixed.
14961
14962         * pending.cs (GetMissingInterfaces): New method used to remove all
14963         the interfaces that are already implemented by our parent
14964         classes from the list of pending methods. 
14965
14966         * interface.cs: Add checks for calls after ResolveTypeExpr.
14967
14968 2002-11-05  Miguel de Icaza  <miguel@ximian.com>
14969
14970         * class.cs (Class.Emit): Report warning 67: event not used if the
14971         warning level is beyond 3.
14972
14973         * ecore.cs (Expression.ConvertExplicit): Missed a check for expr
14974         being a NullLiteral.
14975
14976         * cs-parser.jay: Fix, Gonzalo reverted the order of the rank
14977         specifiers. 
14978
14979         * class.cs (TypeContainer.GetClassBases): Cover a missing code
14980         path that might fail if a type can not be resolved.
14981
14982         * expression.cs (Binary.Emit): Emit unsigned versions of the
14983         operators. 
14984
14985         * driver.cs: use error 5.
14986
14987 2002-11-02  Gonzalo Paniagua Javier <gonzalo@gnome-db.org>
14988
14989         * cs-parser.jay: simplified a rule and 5 SR conflicts dissapeared.
14990
14991 2002-11-01  Miguel de Icaza  <miguel@ximian.com>
14992
14993         * cs-parser.jay (switch_section): A beautiful patch from Martin
14994         Baulig that fixed 33094.
14995
14996 2002-10-31  Miguel de Icaza  <miguel@ximian.com>
14997
14998         * ecore.cs (PropertyExpr.DoResolveLValue, PropertyExpr.DoResolve):
14999         Check whether the base is abstract and report an error if so.
15000
15001         * expression.cs (IndexerAccess.DoResolveLValue,
15002         IndexerAccess.DoResolve): ditto. 
15003
15004         (Invocation.DoResolve): ditto.
15005
15006         (Invocation.FullMethodDesc): Improve the report string.
15007
15008         * statement.cs (Block): Eliminate IsVariableDefined as it is
15009         basically just a wrapper for GetVariableInfo.
15010
15011         * ecore.cs (SimpleName): Use new 
15012
15013         * support.cs (ReflectionParamter.ParameterType): We unwrap the
15014         type, as we return the actual parameter ref/unref state on a
15015         different call.
15016
15017 2002-10-30  Miguel de Icaza  <miguel@ximian.com>
15018
15019         * support.cs: Return proper flags REF/OUT fixing the previous
15020         commit.  
15021
15022         * expression.cs: Reverted last patch, that was wrong.  Is_ref is
15023         not used to mean `ref' but `ref or out' in ParameterReference
15024
15025         * delegate.cs (FullDelegateDesc): use ParameterDesc to get the
15026         full type signature instead of calling TypeManger.CSharpName
15027         ourselves. 
15028
15029         * support.cs (InternalParameters.ParameterDesc): Do not compare
15030         directly to the modflags, because REF/OUT will actually be bitsets
15031         if set. 
15032
15033         * delegate.cs (VerifyMethod): Check also the modifiers.
15034
15035         * cs-tokenizer.cs: Fix bug where floating point values with an
15036         exponent where a sign was missing was ignored.
15037
15038         * driver.cs: Allow multiple assemblies to be specified in a single
15039         /r: argument
15040
15041 2002-10-28  Miguel de Icaza  <miguel@ximian.com>
15042
15043         * cs-parser.jay: Ugly.  We had to add a multiplicative_expression,
15044         because identifiers after a parenthesis would end up in this kind
15045         of production, and we needed to desamiguate it for having casts
15046         like:
15047
15048                 (UserDefinedType *) xxx
15049
15050 2002-10-24  Miguel de Icaza  <miguel@ximian.com>
15051
15052         * typemanager.cs (RealMemberLookup): when we deal with a subclass,
15053         we should set on the Bindingflags.NonPublic, but not turn on
15054         private_ok.  private_ok controls whether a Private member is
15055         returned (this is chekced on the filter routine), while the
15056         BindingFlags.NonPublic just controls whether private/protected
15057         will be allowed.   This fixes the problem part of the problem of
15058         private properties being allowed to be used in derived classes.
15059
15060         * expression.cs (BaseAccess): Provide an DoResolveLValue method,
15061         so we can call the children DoResolveLValue method (this will
15062         properly signal errors on lvalue assignments to base properties)
15063
15064         * ecore.cs (PropertyExpr.ResolveAccessors): If both setter and
15065         getter are null, and we have a property info, we know that this
15066         happened because the lookup failed, so we report an error 122 for
15067         protection level violation.
15068
15069         We also silently return if setter and getter are null in the
15070         resolve functions, this condition only happens if we have flagged
15071         the error before.  This is the other half of the problem. 
15072
15073         (PropertyExpr.ResolveAccessors): Turns out that PropertyInfo does
15074         not have accessibility information, that is why we were returning
15075         true in the filter function in typemanager.cs.
15076
15077         To properly report 122 (property is inaccessible because of its
15078         protection level) correctly, we report this error in ResolveAccess
15079         by failing if both the setter and the getter are lacking (ie, the
15080         lookup failed). 
15081
15082         DoResolve and DoLResolve have been modified to check for both
15083         setter/getter being null and returning silently, the reason being
15084         that I did not want to put the knowledge about this error in upper
15085         layers, like:
15086
15087         int old = Report.Errors;
15088         x = new PropertyExpr (...);
15089         if (old != Report.Errors)
15090                 return null;
15091         else
15092                 return x;
15093
15094         So the property expr is returned, but it is invalid, so the error
15095         will be flagged during the resolve process. 
15096
15097         * class.cs: Remove InheritablePropertySignatureCompare from the
15098         class, as we no longer depend on the property signature to compute
15099         whether it is possible to implement a method or not.
15100
15101         The reason is that calling PropertyInfo.GetGetMethod will return
15102         null (in .NET, in Mono it works, and we should change this), in
15103         cases where the Get Method does not exist in that particular
15104         class.
15105
15106         So this code:
15107
15108         class X { public virtual int A { get { return 1; } } }
15109         class Y : X { }
15110         class Z : Y { public override int A { get { return 2; } } }
15111
15112         Would fail in Z because the parent (Y) would not have the property
15113         defined.  So we avoid this completely now (because the alternative
15114         fix was ugly and slow), and we now depend exclusively on the
15115         method names.
15116
15117         (PropertyBase.CheckBase): Use a method-base mechanism to find our
15118         reference method, instead of using the property.
15119
15120         * typemanager.cs (GetPropertyGetter, GetPropertySetter): These
15121         routines are gone now.
15122
15123         * typemanager.cs (GetPropertyGetter, GetPropertySetter): swap the
15124         names, they were incorrectly named.
15125
15126         * cs-tokenizer.cs: Return are more gentle token on failure. 
15127
15128         * pending.cs (PendingImplementation.InterfaceMethod): This routine
15129         had an out-of-sync index variable, which caused it to remove from
15130         the list of pending methods the wrong method sometimes.
15131
15132 2002-10-22  Miguel de Icaza  <miguel@ximian.com>
15133
15134         * ecore.cs (PropertyExpr): Do not use PropertyInfo.CanRead,
15135         CanWrite, because those refer to this particular instance of the
15136         property, and do not take into account the fact that we can
15137         override single members of a property.
15138
15139         Constructor requires an EmitContext.  The resolution process does
15140         not happen here, but we need to compute the accessors before,
15141         because the resolution does not always happen for properties.
15142
15143         * typemanager.cs (RealMemberLookup): Set private_ok if we are a
15144         subclass, before we did not update this flag, but we did update
15145         bindingflags. 
15146
15147         (GetAccessors): Drop this routine, as it did not work in the
15148         presence of partially overwritten set/get methods. 
15149
15150         Notice that this broke the cs1540 detection, but that will require
15151         more thinking. 
15152
15153 2002-10-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
15154
15155         * class.cs:
15156         * codegen.cs:
15157         * driver.cs: issue a warning instead of an error if we don't support
15158         debugging for the platform. Also ignore a couple of errors that may
15159         arise when trying to write the symbols. Undo my previous patch.
15160
15161 2002-10-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
15162
15163         * driver.cs: ignore /debug switch except for Unix platforms.
15164
15165 2002-10-23  Nick Drochak  <ndrochak@gol.com>
15166
15167         * makefile: Remove mcs2.exe and mcs3.exe on 'make clean'
15168
15169 2002-10-21  Miguel de Icaza  <miguel@ximian.com>
15170
15171         * driver.cs: Do not make mcs-debug conditional, so we do not break
15172         builds that use it.
15173
15174         * statement.cs (UsageVector.MergeChildren): I would like Martin to
15175         review this patch.  But basically after all the children variables
15176         have been merged, the value of "Breaks" was not being set to
15177         new_breaks for Switch blocks.  I think that it should be set after
15178         it has executed.  Currently I set this to the value of new_breaks,
15179         but only if new_breaks is FlowReturn.ALWAYS, which is a bit
15180         conservative, but I do not understand this code very well.
15181
15182         I did not break anything in the build, so that is good ;-)
15183
15184         * cs-tokenizer.cs: Also allow \r in comments as a line separator.
15185
15186 2002-10-20  Mark Crichton  <crichton@gimp.org>
15187
15188         * cfold.cs: Fixed compile blocker.  Really fixed it this time.
15189
15190 2002-10-20  Nick Drochak  <ndrochak@gol.com>
15191
15192         * cfold.cs: Fixed compile blocker.
15193
15194 2002-10-20  Miguel de Icaza  <miguel@ximian.com>
15195
15196         * driver.cs: I was chekcing the key, not the file.
15197
15198 2002-10-19  Ravi Pratap  <ravi@ximian.com>
15199
15200         * ecore.cs (UserDefinedConversion): Get rid of the bogus error
15201         message that we were generating - we just need to silently return
15202         a null.
15203
15204 2002-10-19  Miguel de Icaza  <miguel@ximian.com>
15205
15206         * class.cs (Event.Define): Change my previous commit, as this
15207         breaks the debugger.  This is a temporary hack, as it seems like
15208         the compiler is generating events incorrectly to begin with.
15209
15210         * expression.cs (Binary.ResolveOperator): Added support for 
15211         "U operator - (E x, E y)"
15212
15213         * cfold.cs (BinaryFold): Added support for "U operator - (E x, E
15214         y)".
15215
15216         * ecore.cs (FieldExpr.AddressOf): We had a special code path for
15217         init-only variables, but this path did not take into account that
15218         there might be also instance readonly variables.  Correct this
15219         problem. 
15220
15221         This fixes bug 32253
15222
15223         * delegate.cs (NewDelegate.DoResolve): Catch creation of unsafe
15224         delegates as well.
15225
15226         * driver.cs: Change the extension for modules to `netmodule'
15227
15228         * cs-parser.jay: Improved slightly the location tracking for
15229         the debugger symbols.
15230
15231         * class.cs (Event.Define): Use Modifiers.FieldAttr on the
15232         modifiers that were specified instead of the hardcoded value
15233         (FamAndAssem).  This was basically ignoring the static modifier,
15234         and others.  Fixes 32429.
15235
15236         * statement.cs (Switch.SimpleSwitchEmit): Simplified the code, and
15237         fixed a bug in the process (32476)
15238
15239         * expression.cs (ArrayAccess.EmitAssign): Patch from
15240         hwang_rob@yahoo.ca that fixes bug 31834.3
15241
15242 2002-10-18  Miguel de Icaza  <miguel@ximian.com>
15243
15244         * driver.cs: Make the module extension .netmodule.
15245
15246 2002-10-16  Miguel de Icaza  <miguel@ximian.com>
15247
15248         * driver.cs: Report an error if the resource file is not found
15249         instead of crashing.
15250
15251         * ecore.cs (PropertyExpr.EmitAssign): Pass IsBase instead of
15252         false, like Emit does.
15253
15254 2002-10-16  Nick Drochak  <ndrochak@gol.com>
15255
15256         * typemanager.cs: Remove unused private member.  Also reported mcs
15257         bug to report this as a warning like csc.
15258
15259 2002-10-15  Martin Baulig  <martin@gnome.org>
15260
15261         * statement.cs (Statement.Emit): Made this a virtual method; emits
15262         the line number info and calls DoEmit().
15263         (Statement.DoEmit): New protected abstract method, formerly knows
15264         as Statement.Emit().
15265
15266         * codegen.cs (EmitContext.Mark): Check whether we have a symbol writer.
15267
15268 2002-10-11  Miguel de Icaza  <miguel@ximian.com>
15269
15270         * class.cs: Following the comment from 2002-09-26 to AddMethod, I
15271         have fixed a remaining problem: not every AddXXXX was adding a
15272         fully qualified name.  
15273
15274         Now everyone registers a fully qualified name in the DeclSpace as
15275         being defined instead of the partial name.  
15276
15277         Downsides: we are slower than we need to be due to the excess
15278         copies and the names being registered this way.  
15279
15280         The reason for this is that we currently depend (on the corlib
15281         bootstrap for instance) that types are fully qualified, because
15282         we dump all the types in the namespace, and we should really have
15283         types inserted into the proper namespace, so we can only store the
15284         basenames in the defined_names array.
15285
15286 2002-10-10  Martin Baulig  <martin@gnome.org>
15287
15288         * expression.cs (ArrayAccess.EmitStoreOpcode): Reverted the patch
15289         from bug #31834, see the bug report for a testcase which is
15290         miscompiled.
15291
15292 2002-10-10  Martin Baulig  <martin@gnome.org>
15293
15294         * codegen.cs (EmitContext.Breaks): Removed, we're now using the
15295         flow analysis code for this.
15296
15297         * statement.cs (Do, While, For): Tell the flow analysis code about
15298         infinite loops.
15299         (FlowBranching.UsageVector): Added support for infinite loops.
15300         (Block.Resolve): Moved the dead code elimination here and use flow
15301         analysis to do it.
15302
15303 2002-10-09  Miguel de Icaza  <miguel@ximian.com>
15304
15305         * class.cs (Field.Define): Catch cycles on struct type
15306         definitions. 
15307
15308         * typemanager.cs (IsUnmanagedtype): Do not recursively check
15309         fields if the fields are static.  We only need to check instance
15310         fields. 
15311
15312         * expression.cs (As.DoResolve): Test for reference type.
15313
15314         * statement.cs (Using.ResolveExpression): Use
15315         ConvertImplicitRequired, not ConvertImplicit which reports an
15316         error on failture
15317         (Using.ResolveLocalVariableDecls): ditto.
15318
15319         * expression.cs (Binary.ResolveOperator): Report errors in a few
15320         places where we had to.
15321
15322         * typemanager.cs (IsUnmanagedtype): Finish implementation.
15323
15324 2002-10-08  Miguel de Icaza  <miguel@ximian.com>
15325
15326         * expression.cs: Use StoreFromPtr instead of extracting the type
15327         and then trying to use Stelem.  Patch is from hwang_rob@yahoo.ca
15328
15329         * ecore.cs (ImplicitReferenceConversion): It is possible to assign
15330         an enumeration value to a System.Enum, but System.Enum is not a
15331         value type, but an class type, so we need to box.
15332
15333         (Expression.ConvertExplicit): One codepath could return
15334         errors but not flag them.  Fix this.  Fixes #31853
15335
15336         * parameter.cs (Resolve): Do not allow void as a parameter type.
15337
15338 2002-10-06  Martin Baulig  <martin@gnome.org>
15339
15340         * statemenc.cs (FlowBranching.SetParameterAssigned): Don't crash
15341         if it's a class type and not a struct.  Fixes #31815.
15342
15343 2002-10-06  Martin Baulig  <martin@gnome.org>
15344
15345         * statement.cs: Reworked the flow analysis code a bit to make it
15346         usable for dead code elimination.
15347
15348 2002-10-06  Gonzalo Paniagua Javier <gonzalo@ximian.com>
15349
15350         * cs-parser.jay: allow empty source files. Fixes bug #31781.
15351
15352 2002-10-04  Miguel de Icaza  <miguel@ximian.com>
15353
15354         * expression.cs (ComposedCast.DoResolveType): A quick workaround
15355         to fix the test 165, will investigate deeper.
15356
15357 2002-10-04  Martin Baulig  <martin@gnome.org>
15358
15359         * statement.cs (FlowBranching.UsageVector.MergeChildren): Make
15360         finally blocks actually work.
15361         (Try.Resolve): We don't need to create a sibling for `finally' if
15362         there is no finally block.
15363
15364 2002-10-04  Martin Baulig  <martin@gnome.org>
15365
15366         * class.cs (Constructor.Define): The default accessibility for a
15367         non-default constructor is private, not public.
15368
15369 2002-10-04  Miguel de Icaza  <miguel@ximian.com>
15370
15371         * class.cs (Constructor): Make AllowedModifiers public, add
15372         EXTERN.
15373
15374         * cs-parser.jay: Perform the modifiers test here, as the
15375         constructor for the Constructor class usually receives a zero
15376         because of the way we create it (first we create, later we
15377         customize, and we were never checking the modifiers).
15378
15379         * typemanager.cs (Typemanager.LookupTypeDirect): This new function
15380         is a version of LookupTypeReflection that includes the type-name
15381         cache.  This can be used as a fast path for functions that know
15382         the fully qualified name and are only calling into *.GetType() to
15383         obtain a composed type.
15384
15385         This is also used by TypeManager.LookupType during its type
15386         composition.
15387
15388         (LookupType): We now also track the real type name, as sometimes
15389         we can get a quey for the real type name from things like
15390         ComposedCast.  This fixes bug 31422.
15391
15392         * expression.cs (ComposedCast.Resolve): Since we are obtaining a
15393         complete type fullname, it does not have to go through the type
15394         resolution system to obtain the composed version of the type (for
15395         obtaining arrays or pointers).
15396
15397         (Conditional.Emit): Use the EmitBoolExpression to
15398         generate nicer code, as requested by Paolo.
15399
15400         (ArrayCreation.CheckIndices): Use the patch from
15401         hwang_rob@yahoo.ca to validate the array initializers. 
15402
15403 2002-10-03  Miguel de Icaza  <miguel@ximian.com>
15404
15405         * class.cs (ConstructorInitializer.Emit): simplify code by using
15406         Invocation.EmitCall, and at the same time, fix the bugs in calling
15407         parent constructors that took variable arguments. 
15408
15409         * ecore.cs (Expression.ConvertNumericExplicit,
15410         Expression.ImplicitNumericConversion): Remove the code that
15411         manually wrapped decimal (InternalTypeConstructor call is now gone
15412         as well).
15413
15414         * expression.cs (Cast.TryReduce): Also handle decimal types when
15415         trying to perform a constant fold on the type.
15416
15417         * typemanager.cs (IsUnmanagedtype): Partially implemented.
15418
15419         * parameter.cs: Removed ResolveAndDefine, as it was not needed, as
15420         that only turned off an error report, and did nothing else. 
15421
15422 2002-10-02  Miguel de Icaza  <miguel@ximian.com>
15423
15424         * driver.cs: Handle and ignore /fullpaths
15425
15426 2002-10-01  Miguel de Icaza  <miguel@ximian.com>
15427
15428         * expression.cs (Binary.ResolveOperator): Catch the case where
15429         DoNumericPromotions returns true, 
15430
15431         (Binary.DoNumericPromotions): Simplify the code, and the tests.
15432
15433 2002-09-27  Miguel de Icaza  <miguel@ximian.com>
15434
15435         * ecore.cs (EventExpr.Emit): Instead of emitting an exception,
15436         report error 70.
15437
15438 2002-09-26  Miguel de Icaza  <miguel@ximian.com>
15439
15440         * ecore.cs (ConvertNumericExplicit): It is not enough that the
15441         conversion exists, but it is also required that the conversion be
15442         performed.  This manifested in "(Type64Enum) 2".  
15443
15444         * class.cs (TypeManager.AddMethod): The fix is not to change
15445         AddEnum, because that one was using a fully qualified name (every
15446         DeclSpace derivative does), but to change the AddMethod routine
15447         that was using an un-namespaced name.  This now correctly reports
15448         the duplicated name.
15449
15450         Revert patch until I can properly fix it.  The issue
15451         is that we have a shared Type space across all namespaces
15452         currently, which is wrong.
15453
15454         Options include making the Namespace a DeclSpace, and merge
15455         current_namespace/current_container in the parser.
15456
15457 2002-09-25  Miguel de Icaza  <miguel@ximian.com>
15458
15459         * cs-parser.jay: Improve error reporting when we get a different
15460         kind of expression in local_variable_type and
15461         local_variable_pointer_type. 
15462
15463         Propagate this to avoid missleading errors being reported.
15464
15465         * ecore.cs (ImplicitReferenceConversion): treat
15466         TypeManager.value_type as a target just like object_type.   As
15467         code like this:
15468
15469         ValueType v = 1;
15470
15471         Is valid, and needs to result in the int 1 being boxed before it
15472         is assigned to the value type v.
15473
15474         * class.cs (TypeContainer.AddEnum): Use the basename, not the name
15475         to validate the enumeration name.
15476
15477         * expression.cs (ArrayAccess.EmitAssign): Mimic the same test from
15478         EmitDynamicInitializers for the criteria to use Ldelema.  Thanks
15479         to hwang_rob@yahoo.ca for finding the bug and providing a patch.
15480
15481         * ecore.cs (TryImplicitIntConversion): When doing an
15482         implicit-enumeration-conversion, check if the type is 64-bits and
15483         perform a conversion before passing to EnumConstant.
15484
15485 2002-09-23  Miguel de Icaza  <miguel@ximian.com>
15486
15487         * decl.cs (Error_AmbiguousTypeReference); New routine used to
15488         report ambiguous type references.  Unlike the MS version, we
15489         report what the ambiguity is.   Innovation at work ;-)
15490
15491         (DeclSpace.FindType): Require a location argument to
15492         display when we display an ambiguous error.
15493
15494         * ecore.cs: (SimpleName.DoResolveType): Pass location to FindType.
15495
15496         * interface.cs (GetInterfaceTypeByName): Pass location to FindType.
15497
15498         * expression.cs (EmitDynamicInitializers): Apply patch from
15499         hwang_rob@yahoo.ca that fixes the order in which we emit our
15500         initializers. 
15501
15502 2002-09-21  Martin Baulig  <martin@gnome.org>
15503
15504         * delegate.cs (Delegate.VerifyApplicability): Make this work if the
15505         delegate takes no arguments.
15506
15507 2002-09-20  Miguel de Icaza  <miguel@ximian.com>
15508
15509         * constant.cs: Use Conv_U8 instead of Conv_I8 when loading longs
15510         from integers.
15511
15512         * expression.cs: Extract the underlying type.
15513
15514         * ecore.cs (StoreFromPtr): Use TypeManager.IsEnumType instad of IsEnum
15515
15516         * decl.cs (FindType): Sorry about this, fixed the type lookup bug.
15517
15518 2002-09-19  Miguel de Icaza  <miguel@ximian.com>
15519
15520         * class.cs (TypeContainer.DefineType): We can not use the nice
15521         PackingSize with the size set to 1 DefineType method, because it
15522         will not allow us to define the interfaces that the struct
15523         implements.
15524
15525         This completes the fixing of bug 27287
15526
15527         * ecore.cs (Expresion.ImplicitReferenceConversion): `class-type S'
15528         means also structs.  This fixes part of the problem. 
15529         (Expresion.ImplicitReferenceConversionExists): ditto.
15530
15531         * decl.cs (DeclSparce.ResolveType): Only report the type-not-found
15532         error if there were no errors reported during the type lookup
15533         process, to avoid duplicates or redundant errors.  Without this
15534         you would get an ambiguous errors plus a type not found.  We have
15535         beaten the user enough with the first error.  
15536
15537         (DeclSparce.FindType): Emit a warning if we have an ambiguous
15538         reference. 
15539
15540         * ecore.cs (SimpleName.DoResolveType): If an error is emitted
15541         during the resolution process, stop the lookup, this avoids
15542         repeated error reports (same error twice).
15543
15544         * rootcontext.cs: Emit a warning if we have an ambiguous reference.
15545
15546         * typemanager.cs (LookupType): Redo the type lookup code to match
15547         the needs of System.Reflection.  
15548
15549         The issue is that System.Reflection requires references to nested
15550         types to begin with a "+" sign instead of a dot.  So toplevel
15551         types look like: "NameSpace.TopLevelClass", and nested ones look
15552         like "Namespace.TopLevelClass+Nested", with arbitrary nesting
15553         levels. 
15554
15555 2002-09-19  Martin Baulig  <martin@gnome.org>
15556
15557         * codegen.cs (EmitContext.EmitTopBlock): If control flow analysis
15558         says that a method always returns or always throws an exception,
15559         don't report the CS0161.
15560
15561         * statement.cs (FlowBranching.UsageVector.MergeChildren): Always
15562         set `Returns = new_returns'.
15563
15564 2002-09-19  Martin Baulig  <martin@gnome.org>
15565
15566         * expression.cs (MemberAccess.ResolveMemberAccess): When resolving
15567         to an enum constant, check for a CS0176.
15568
15569 2002-09-18  Miguel de Icaza  <miguel@ximian.com>
15570
15571         * class.cs (TypeContainer.CheckPairedOperators): Now we check
15572         for operators that must be in pairs and report errors.
15573
15574         * ecore.cs (SimpleName.DoResolveType): During the initial type
15575         resolution process, when we define types recursively, we must
15576         check first for types in our current scope before we perform
15577         lookups in the enclosing scopes.
15578
15579         * expression.cs (MakeByteBlob): Handle Decimal blobs.
15580
15581         (Invocation.VerifyArgumentsCompat): Call
15582         TypeManager.TypeToCoreType on the parameter_type.GetElementType.
15583         I thought we were supposed to always call this, but there are a
15584         few places in the code where we dont do it.
15585
15586 2002-09-17  Miguel de Icaza  <miguel@ximian.com>
15587
15588         * driver.cs: Add support in -linkres and -resource to specify the
15589         name of the identifier.
15590
15591 2002-09-16  Miguel de Icaza  <miguel@ximian.com>
15592
15593         * ecore.cs (StandardConversionExists): Sync with the conversion
15594         code: allow anything-* to void* conversions.
15595
15596         (FindMostSpecificSource): Use an Expression argument
15597         instead of a Type, because we might be handed over a Literal which
15598         gets a few more implicit conversions that plain types do not.  So
15599         this information was being lost.
15600
15601         Also, we drop the temporary type-holder expression when not
15602         required.
15603
15604 2002-09-17  Martin Baulig  <martin@gnome.org>
15605
15606         * class.cs (PropertyBase.CheckBase): Don't check the base class if
15607         this is an explicit interface implementation.
15608
15609 2002-09-17  Martin Baulig  <martin@gnome.org>
15610
15611         * class.cs (PropertyBase.CheckBase): Make this work for indexers with
15612         different `IndexerName' attributes.
15613
15614         * expression.cs (BaseIndexerAccess): Rewrote this class to use IndexerAccess.
15615         (IndexerAccess): Added special protected ctor for BaseIndexerAccess and
15616         virtual CommonResolve().
15617
15618 2002-09-16  Miguel de Icaza  <miguel@ximian.com>
15619
15620         * enum.cs (LookupEnumValue): Use the EnumConstant declared type,
15621         and convert that to the UnderlyingType.
15622
15623         * statement.cs (Foreach.Resolve): Indexers are just like variables
15624         or PropertyAccesses.
15625
15626         * cs-tokenizer.cs (consume_string): Track line numbers and columns
15627         inside quoted strings, we were not doing this before.
15628
15629 2002-09-16  Martin Baulig  <martin@gnome.org>
15630
15631         * ecore.cs (MethodGroupExpr.DoResolve): If we have an instance expression,
15632         resolve it.  This is needed for the definite assignment check of the
15633         instance expression, fixes bug #29846.
15634         (PropertyExpr.DoResolve, EventExpr.DoResolve): Likewise.
15635
15636 2002-09-16  Nick Drochak  <ndrochak@gol.com>
15637
15638         * parameter.cs: Fix compile error.  Cannot reference static member
15639         from an instance object.  Is this an mcs bug?
15640
15641 2002-09-14  Martin Baulig  <martin@gnome.org>
15642
15643         * decl.cs (MemberCache.SetupCacheForInterface): Don't add an interface
15644         multiple times.  Fixes bug #30295, added test-166.cs.
15645
15646 2002-09-14  Martin Baulig  <martin@gnome.org>
15647
15648         * statement.cs (Block.Emit): Don't emit unreachable code.
15649         (Switch.SimpleSwitchEmit, Switch.TableSwitchEmit): Check for missing
15650         `break' statements.
15651         (Goto.Emit, Continue.Emit): Set ec.Breaks = true.
15652
15653 2002-09-14  Martin Baulig  <martin@gnome.org>
15654
15655         * parameter.cs (Parameter.Attributes): Make this work if Modifier.ISBYREF
15656         is set.
15657
15658 2002-09-14  Martin Baulig  <martin@gnome.org>
15659
15660         * typemanager.cs (TypeManager.IsNestedChildOf): This must return false
15661         if `type == parent' since in this case `type.IsSubclassOf (parent)' will
15662         be false on the ms runtime.
15663
15664 2002-09-13  Martin Baulig  <martin@gnome.org>
15665
15666         * ecore.cs (SimpleName.SimpleNameResolve): Include the member name in
15667         the CS0038 error message.
15668
15669 2002-09-12  Miguel de Icaza  <miguel@ximian.com>
15670
15671         * expression.cs (CheckedExpr, UnCheckedExpr): If we have a
15672         constant inside, return it.
15673
15674 2002-09-12  Martin Baulig  <martin@gnome.org>
15675
15676         * cfold.cs (ConstantFold.DoConstantNumericPromotions): Check whether an
15677         implicit conversion can be done between enum types.
15678
15679         * enum.cs (Enum.LookupEnumValue): If the value is an EnumConstant,
15680         check whether an implicit conversion to the current enum's UnderlyingType
15681         exists and report an error if not.
15682
15683         * codegen.cs (CodeGen.Init): Delete the symbol file when compiling
15684         without debugging support.
15685
15686         * delegate.cs (Delegate.CloseDelegate): Removed, use CloseType instead.
15687         Fixes bug #30235.  Thanks to Ricardo Fernández Pascual.
15688
15689 2002-09-12  Martin Baulig  <martin@gnome.org>
15690
15691         * typemanager.cs (TypeManager.IsNestedChildOf): New method.
15692
15693         * ecore.cs (IMemberExpr.DeclaringType): New property.
15694         (SimpleName.SimpleNameResolve): Check whether we're accessing a
15695         nonstatic member of an outer type (CS0038).
15696
15697 2002-09-11  Miguel de Icaza  <miguel@ximian.com>
15698
15699         * driver.cs: Activate the using-error detector at warning level
15700         4 (at least for MS-compatible APIs).
15701
15702         * namespace.cs (VerifyUsing): Small buglett fix.
15703
15704         * pending.cs (PendingImplementation): pass the container pointer. 
15705
15706         * interface.cs (GetMethods): Allow for recursive definition.  Long
15707         term, I would like to move every type to support recursive
15708         definitions, not the current ordering mechanism that we have right
15709         now.
15710
15711         The situation is this: Attributes are handled before interfaces,
15712         so we can apply attributes to interfaces.  But some attributes
15713         implement interfaces, we will now handle the simple cases
15714         (recursive definitions will just get an error).  
15715
15716         * parameter.cs: Only invalidate types at the end if we fail to
15717         lookup all types.  
15718
15719 2002-09-09  Martin Baulig  <martin@gnome.org>
15720
15721         * ecore.cs (PropertyExpr.Emit): Also check for
15722         TypeManager.system_int_array_get_length so this'll also work when
15723         compiling corlib.  Fixes #30003.
15724
15725 2002-09-09  Martin Baulig  <martin@gnome.org>
15726
15727         * expression.cs (ArrayCreation.MakeByteBlob): Added support for enums
15728         and throw an exception if we can't get the type's size.  Fixed #30040,
15729         added test-165.cs.
15730
15731 2002-09-09  Martin Baulig  <martin@gnome.org>
15732
15733         * ecore.cs (PropertyExpr.DoResolve): Added check for static properies.
15734
15735         * expression.cs (SizeOf.DoResolve): Sizeof is only allowed in unsafe
15736         context.  Fixes bug #30027.
15737
15738         * delegate.cs (NewDelegate.Emit): Use OpCodes.Ldvirtftn for
15739         virtual functions.  Fixes bug #30043, added test-164.cs.
15740
15741 2002-09-08  Ravi Pratap  <ravi@ximian.com>
15742
15743         * attribute.cs : Fix a small NullRef crash thanks to my stupidity.
15744
15745 2002-09-08  Nick Drochak  <ndrochak@gol.com>
15746
15747         * driver.cs: Use an object to get the windows codepage since it's not a
15748         static property.
15749
15750 2002-09-08  Miguel de Icaza  <miguel@ximian.com>
15751
15752         * statement.cs (For.Emit): for infinite loops (test == null)
15753         return whether there is a break inside, not always "true".
15754
15755         * namespace.cs (UsingEntry): New struct to hold the name of the
15756         using definition, the location where it is defined, and whether it
15757         has been used in a successful type lookup.
15758
15759         * rootcontext.cs (NamespaceLookup): Use UsingEntries instead of
15760         strings.
15761
15762         * decl.cs: ditto.
15763
15764 2002-09-06  Ravi Pratap  <ravi@ximian.com>
15765
15766         * attribute.cs : Fix incorrect code which relied on catching
15767         a NullReferenceException to detect a null being passed in
15768         where an object was expected.
15769
15770 2002-09-06  Miguel de Icaza  <miguel@ximian.com>
15771
15772         * statement.cs (Try): flag the catch variable as assigned
15773
15774         * expression.cs (Cast): Simplified by using ResolveType instead of
15775         manually resolving.
15776
15777         * statement.cs (Catch): Fix bug by using ResolveType.
15778
15779 2002-09-06  Ravi Pratap  <ravi@ximian.com>
15780
15781         * expression.cs (BetterConversion): Special case for when we have
15782         a NullLiteral as the argument and we have to choose between string
15783         and object types - we choose string the way csc does.
15784
15785         * attribute.cs (Attribute.Resolve): Catch the
15786         NullReferenceException and report error #182 since the Mono
15787         runtime no more has the bug and having this exception raised means
15788         we tried to select a constructor which takes an object and is
15789         passed a null.
15790
15791 2002-09-05  Ravi Pratap  <ravi@ximian.com>
15792
15793         * expression.cs (Invocation.OverloadResolve): Flag a nicer error
15794         message (1502, 1503) when we can't locate a method after overload
15795         resolution. This is much more informative and closes the bug
15796         Miguel reported.
15797
15798         * interface.cs (PopulateMethod): Return if there are no argument
15799         types. Fixes a NullReferenceException bug.
15800
15801         * attribute.cs (Attribute.Resolve): Ensure we allow TypeOf
15802         expressions too. Previously we were checking only in one place for
15803         positional arguments leaving out named arguments.
15804
15805         * ecore.cs (ImplicitNumericConversion): Conversion from underlying
15806         type to the enum type is not allowed. Remove code corresponding to
15807         that.
15808
15809         (ConvertNumericExplicit): Allow explicit conversions from
15810         the underlying type to enum type. This precisely follows the spec
15811         and closes a bug filed by Gonzalo.
15812
15813 2002-09-04  Gonzalo Paniagua Javier <gonzalo@ximian.com>
15814
15815         * compiler.csproj:
15816         * compiler.csproj.user: patch from Adam Chester (achester@bigpond.com).
15817
15818 2002-09-03  Miguel de Icaza  <miguel@ximian.com>
15819
15820         * statement.cs (SwitchLabel.ResolveAndReduce): In the string case,
15821         it was important that we stored the right value after the
15822         reduction in `converted'.
15823
15824 2002-09-04  Martin Baulig  <martin@gnome.org>
15825
15826         * location.cs (Location.SymbolDocument): Use full pathnames for the
15827         source files.
15828
15829 2002-08-30  Miguel de Icaza  <miguel@ximian.com>
15830
15831         * expression.cs (ComposedCast): Use DeclSparce.ResolveType instead
15832         of the expression resolve mechanism, because that will catch the
15833         SimpleName error failures.
15834
15835         (Conditional): If we can not resolve the
15836         expression, return, do not crash.
15837
15838 2002-08-29  Gonzalo Paniagua Javier <gonzalo@ximian.com>
15839
15840         * cs-tokenizer.cs:
15841         (location): display token name instead of its number.
15842
15843 2002-08-28  Martin Baulig  <martin@gnome.org>
15844
15845         * expression.cs (Binary.ResolveOperator): Don't silently return
15846         but return an error if an operator cannot be applied between two
15847         enum types.
15848
15849 2002-08-28  Martin Baulig  <martin@gnome.org>
15850
15851         * class.cs (Constructor.Define): Set the permission attributes
15852         correctly instead of making all constructors public.
15853
15854 2002-08-28  Martin Baulig  <martin@gnome.org>
15855
15856         * ecore.cs (Expression.DoResolve): Do a TypeManager.MemberLook
15857         for private members before reporting a CS0103; if we find anything,
15858         it's a CS0122.
15859
15860 2002-08-28  Martin Baulig  <martin@gnome.org>
15861
15862         * typemanager.cs (TypeManager.FilterWithClosure): It's not enough
15863         to check whether `closure_start_type == closure_invocation_type',
15864         we also need to check whether `m.DeclaringType == closure_invocation_type'
15865         before bypassing the permission checks.  We might be accessing
15866         protected/private members from the base class.
15867         (TypeManager.RealMemberLookup): Only set private_ok if private
15868         members were requested via BindingFlags.NonPublic.
15869
15870         * ecore.cs (MethodGroupExpr.IsExplicitImpl): New property.
15871
15872         * expression.cs (MemberAccess.ResolveMemberAccess): Set
15873         MethodGroupExpr.IsExplicitImpl if appropriate.
15874         (Invocation.DoResolve): Don't report the CS0120 for explicit
15875         interface implementations.
15876
15877 2002-08-27  Martin Baulig  <martin@gnome.org>
15878
15879         * expression.cs (Invocation.DoResolve): If this is a static
15880         method and we don't have an InstanceExpression, we must report
15881         a CS0120.
15882
15883 2002-08-25  Martin Baulig  <martin@gnome.org>
15884
15885         * expression.cs (Binary.ResolveOperator): Don't allow `!=' and
15886         `==' between a valuetype and an object.
15887
15888 2002-08-25  Miguel de Icaza  <miguel@ximian.com>
15889
15890         * ecore.cs (TypeExpr): Provide a ToString method.
15891
15892 2002-08-24  Martin Baulig  <martin@gnome.org>
15893
15894         * codegen.cs (CodeGen.InitMonoSymbolWriter): The symbol file is
15895         now called proggie.dbg and it's a binary file.
15896
15897 2002-08-23  Martin Baulig  <martin@gnome.org>
15898
15899         * decl.cs (MemberCache.AddMethods): Ignore varargs methods.
15900
15901 2002-08-23  Martin Baulig  <martin@gnome.org>
15902
15903         * struct.cs (MyStructInfo.ctor): Make this work with empty
15904         structs; it's not allowed to use foreach() on null.
15905
15906 2002-08-23  Martin Baulig  <martin@gnome.org>
15907
15908         * codegen.cs (CodeGen.InitMonoSymbolWriter): Tell the symbol
15909         writer the full pathname of the generated assembly.
15910
15911 2002-08-23  Martin Baulig  <martin@gnome.org>
15912
15913         * statements.cs (FlowBranching.UsageVector.MergeChildren):
15914         A `finally' block never returns or breaks; improved handling of
15915         unreachable code.
15916
15917 2002-08-23  Martin Baulig  <martin@gnome.org>
15918
15919         * statement.cs (Throw.Resolve): Allow `throw null'.
15920
15921 2002-08-23  Martin Baulig  <martin@gnome.org>
15922
15923         * expression.cs (MemberAccess.ResolveMemberAccess): If this is an
15924         EventExpr, don't do a DeclaredOnly MemberLookup, but check whether
15925         `ee.EventInfo.DeclaringType == ec.ContainerType'.  The
15926         MemberLookup would return a wrong event if this is an explicit
15927         interface implementation and the class has an event with the same
15928         name.
15929
15930 2002-08-23  Martin Baulig  <martin@gnome.org>
15931
15932         * statement.cs (Block.AddChildVariableNames): New public method.
15933         (Block.AddChildVariableName): Likewise.
15934         (Block.IsVariableNameUsedInChildBlock): Likewise.
15935         (Block.AddVariable): Check whether a variable name has already
15936         been used in a child block.
15937
15938         * cs-parser.jay (declare_local_variables): Mark all variable names
15939         from the current block as being used in a child block in the
15940         implicit block.
15941
15942 2002-08-23  Martin Baulig  <martin@gnome.org>
15943
15944         * codegen.cs (CodeGen.InitializeSymbolWriter): Abort if we can't
15945         find the symbol writer.
15946
15947         * driver.cs: csc also allows the arguments to /define being
15948         separated by commas, not only by semicolons.
15949
15950 2002-08-23  Martin Baulig  <martin@gnome.org>
15951
15952         * interface.cs (Interface.GetMembers): Added static check for events.
15953
15954 2002-08-15  Martin Baulig  <martin@gnome.org>
15955
15956         * class.cs (MethodData.EmitDestructor): In the Expression.MemberLookup
15957         call, use ec.ContainerType.BaseType as queried_type and invocation_type.
15958
15959         * ecore.cs (Expression.MemberLookup): Added documentation and explained
15960         why the MethodData.EmitDestructor() change was necessary.
15961
15962 2002-08-20  Martin Baulig  <martin@gnome.org>
15963
15964         * class.cs (TypeContainer.FindMembers): Added static check for events.
15965
15966         * decl.cs (MemberCache.AddMembers): Handle events like normal members.
15967
15968         * typemanager.cs (TypeHandle.GetMembers): When queried for events only,
15969         use Type.GetEvents(), not Type.FindMembers().
15970
15971 2002-08-20  Martin Baulig  <martin@gnome.org>
15972
15973         * decl.cs (MemberCache): Added a special method cache which will
15974         be used for method-only searched.  This ensures that a method
15975         search will return a MethodInfo with the correct ReflectedType for
15976         inherited methods.      
15977
15978 2002-08-20  Martin Baulig  <martin@gnome.org>
15979
15980         * decl.cs (DeclSpace.FindMembers): Made this public.
15981
15982 2002-08-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
15983
15984         * delegate.cs: fixed build on windows.
15985         [FIXME:  Filed as bug #29150: MCS must report these errors.]
15986
15987 2002-08-19  Ravi Pratap  <ravi@ximian.com>
15988
15989         * ecore.cs (StandardConversionExists): Return a false
15990         if we are trying to convert the void type to anything else
15991         since that is not allowed.
15992
15993         * delegate.cs (DelegateInvocation.DoResolve): Ensure that
15994         we flag error 70 in the event an event is trying to be accessed
15995         directly from outside the declaring type.
15996
15997 2002-08-20  Martin Baulig  <martin@gnome.org>
15998
15999         * typemanager.cs, decl.cs: Moved MemberList, IMemberContainer and
16000         MemberCache from typemanager.cs to decl.cs.
16001
16002 2002-08-19  Martin Baulig  <martin@gnome.org>
16003
16004         * class.cs (TypeContainer): Implement IMemberContainer.
16005         (TypeContainer.DefineMembers): Create the MemberCache.
16006         (TypeContainer.FindMembers): Do better BindingFlags checking; only
16007         return public members if BindingFlags.Public was given, check
16008         whether members are static.
16009
16010 2002-08-16  Martin Baulig  <martin@gnome.org>
16011
16012         * decl.cs (DeclSpace.Define): Splitted this in Define and
16013         DefineMembers.  DefineMembers is called first and initializes the
16014         MemberCache.
16015
16016         * rootcontext.cs (RootContext.DefineMembers): New function.  Calls
16017         DefineMembers() on all our DeclSpaces.
16018
16019         * class.cs (TypeContainer.Define): Moved all code to DefineMembers(),
16020         but call DefineMembers() on all nested interfaces.  We call their
16021         Define() in our new Define() function.
16022
16023         * interface.cs (Interface): Implement IMemberContainer.
16024         (Interface.Define): Moved all code except the attribute stuf to
16025         DefineMembers().
16026         (Interface.DefineMembers): Initialize the member cache.
16027
16028         * typemanager.cs (IMemberFinder): Removed this interface, we don't
16029         need this anymore since we can use MemberCache.FindMembers directly.
16030
16031 2002-08-19  Martin Baulig  <martin@gnome.org>
16032
16033         * typemanager.cs (MemberCache): When creating the cache for an
16034         interface type, add all inherited members.
16035         (TypeManager.MemberLookup_FindMembers): Changed `ref bool searching'
16036         to `out bool used_cache' and documented it.
16037         (TypeManager.MemberLookup): If we already used the cache in the first
16038         iteration, we don't need to do the interfaces check.
16039
16040 2002-08-19  Martin Baulig  <martin@gnome.org>
16041
16042         * decl.cs (DeclSpace.FindMembers): New abstract method.  Moved this
16043         here from IMemberFinder and don't implement this interface anymore.
16044         (DeclSpace.MemberCache): Moved here from IMemberFinder.
16045
16046         * typemanager.cs (IMemberFinder): This interface is now only used by
16047         classes which actually support the member cache.
16048         (TypeManager.builder_to_member_finder): Renamed to builder_to_declspace
16049         since we only put DeclSpaces into this Hashtable.
16050         (MemberLookup_FindMembers): Use `builder_to_declspace' if the type is
16051         a dynamic type and TypeHandle.GetTypeHandle() otherwise.
16052
16053 2002-08-16  Martin Baulig  <martin@gnome.org>
16054
16055         * typemanager.cs (ICachingMemberFinder): Removed.
16056         (IMemberFinder.MemberCache): New property.
16057         (TypeManager.FindMembers): Merged this with RealFindMembers().
16058         This function will never be called from TypeManager.MemberLookup()
16059         so we can't use the cache here, just the IMemberFinder.
16060         (TypeManager.MemberLookup_FindMembers): Check whether the
16061         IMemberFinder has a MemberCache and call the cache's FindMembers
16062         function.
16063         (MemberCache): Rewrote larger parts of this yet another time and
16064         cleaned it up a bit.
16065
16066 2002-08-15  Miguel de Icaza  <miguel@ximian.com>
16067
16068         * driver.cs (LoadArgs): Support quoting.
16069
16070         (Usage): Show the CSC-like command line arguments.
16071
16072         Improved a few error messages.
16073
16074 2002-08-15  Martin Baulig  <martin@gnome.org>
16075
16076         * typemanager.cs (IMemberContainer.Type): New property.
16077         (IMemberContainer.IsInterface): New property.
16078
16079         The following changes are conditional to BROKEN_RUNTIME, which is
16080         defined at the top of the file.
16081
16082         * typemanager.cs (MemberCache.MemberCache): Don't add the base
16083         class'es members, but add all members from TypeHandle.ObjectType
16084         if we're an interface.
16085         (MemberCache.AddMembers): Set the Declared flag if member.DeclaringType
16086         is the current type.
16087         (MemberCache.CacheEntry.Container): Removed this field.
16088         (TypeHandle.GetMembers): Include inherited members.
16089
16090 2002-08-14  Gonzalo Paniagua Javier <gonzalo@ximian.com>
16091
16092         * typemanager.cs: fixed compilation and added a comment on a field that
16093         is never used.
16094
16095 2002-08-15  Martin Baulig  <martin@gnome.org>
16096
16097         * class.cs (ConstructorInitializer.Resolve): In the
16098         Expression.MemberLookup call, use the queried_type as
16099         invocation_type.
16100
16101         * typemanager.cs (IMemberContainer.GetMembers): Removed the `bool
16102         declared' attribute, it's always true.
16103         (IMemberContainer.Parent, IMemberContainer.Name): New properties.
16104         (TypeManager.MemberLookup_FindMembers): [FIXME FIXME FIXME] Added
16105         temporary wrapper for FindMembers which tells MemberLookup whether
16106         members from the base classes are included in the return value.
16107         This will go away soon.
16108         (TypeManager.MemberLookup): Use this temporary hack here; once the
16109         new MemberCache is completed, we don't need to do the DeclaredOnly
16110         looping here anymore since the MemberCache will take care of this.
16111         (TypeManager.IsSubclassOrNestedChildOf): Allow `type == parent'.
16112         (MemberCache): When creating the MemberCache for a class, get
16113         members from the current class and all its base classes.
16114         (MemberCache.CacheEntry.Container): New field.  This is a
16115         temporary hack until the Mono runtime is fixed to distinguish
16116         between ReflectedType and DeclaringType.  It allows us to use MCS
16117         with both the MS runtime and the unfixed Mono runtime without
16118         problems and without accecting performance.
16119         (MemberCache.SearchMembers): The DeclaredOnly looping from
16120         TypeManager.MemberLookup is now done here.      
16121
16122 2002-08-14  Martin Baulig  <martin@gnome.org>
16123
16124         * statement.cs (MyStructInfo.MyStructInfo): Don't call
16125         Type.GetFields on dynamic types but get the fields from the
16126         corresponding TypeContainer.
16127         (MyStructInfo.GetStructInfo): Added check for enum types.
16128
16129         * typemanager.cs (MemberList.IsSynchronized): Implemented.
16130         (MemberList.SyncRoot): Implemented.
16131         (TypeManager.FilterWithClosure): No need to check permissions if
16132         closure_start_type == closure_invocation_type, don't crash if
16133         closure_invocation_type is null.
16134
16135 2002-08-13  Martin Baulig  <martin@gnome.org>
16136
16137         Rewrote TypeContainer.FindMembers to use a member cache.  This
16138         gives us a speed increase of about 35% for the self-hosting MCS
16139         build and of about 15-20% for the class libs (both on GNU/Linux).
16140
16141         * report.cs (Timer): New class to get enhanced profiling.  This
16142         whole class is "TIMER" conditional since it remarkably slows down
16143         compilation speed.
16144
16145         * class.cs (MemberList): New class.  This is an IList wrapper
16146         which we're now using instead of passing MemberInfo[]'s around to
16147         avoid copying this array unnecessarily.
16148         (IMemberFinder.FindMember): Return a MemberList, not a MemberInfo [].
16149         (ICachingMemberFinder, IMemberContainer): New interface.
16150         (TypeManager.FilterWithClosure): If `criteria' is null, the name
16151         has already been checked, otherwise use it for the name comparision.
16152         (TypeManager.FindMembers): Renamed to RealMemberFinder and
16153         provided wrapper which tries to use ICachingMemberFinder.FindMembers
16154         if possible.  Returns a MemberList, not a MemberInfo [].
16155         (TypeHandle): New class, implements IMemberContainer.  We create
16156         one instance of this class per type, it contains a MemberCache
16157         which is used to do the member lookups.
16158         (MemberCache): New class.  Each instance of this class contains
16159         all members of a type and a name-based hash table.
16160         (MemberCache.FindMembers): This is our new member lookup
16161         function.  First, it looks up all members of the requested name in
16162         the hash table.  Then, it walks this list and sorts out all
16163         applicable members and returns them.
16164
16165 2002-08-13  Martin Baulig  <martin@gnome.org>
16166
16167         In addition to a nice code cleanup, this gives us a performance
16168         increase of about 1.4% on GNU/Linux - not much, but it's already
16169         half a second for the self-hosting MCS compilation.
16170
16171         * typemanager.cs (IMemberFinder): New interface.  It is used by
16172         TypeManager.FindMembers to call FindMembers on a TypeContainer,
16173         Enum, Delegate or Interface.
16174         (TypeManager.finder_to_member_finder): New PtrHashtable.
16175         (TypeManager.finder_to_container): Removed.
16176         (TypeManager.finder_to_delegate): Removed.
16177         (TypeManager.finder_to_interface): Removed.
16178         (TypeManager.finder_to_enum): Removed.
16179
16180         * interface.cs (Interface): Implement IMemberFinder.
16181
16182         * delegate.cs (Delegate): Implement IMemberFinder.
16183
16184         * enum.cs (Enum): Implement IMemberFinder.
16185
16186         * class.cs (TypeContainer): Implement IMemberFinder.
16187
16188 2002-08-12  Martin Baulig  <martin@gnome.org>
16189
16190         * ecore.cs (TypeExpr.DoResolveType): Mark this as virtual.
16191
16192 2002-08-12  Martin Baulig  <martin@gnome.org>
16193
16194         * ecore.cs (ITypeExpression): New interface for expressions which
16195         resolve to a type.
16196         (TypeExpression): Renamed to TypeLookupExpression.
16197         (Expression.DoResolve): If we're doing a types-only lookup, the
16198         expression must implement the ITypeExpression interface and we
16199         call DoResolveType() on it.
16200         (SimpleName): Implement the new ITypeExpression interface.
16201         (SimpleName.SimpleNameResolve): Removed the ec.OnlyLookupTypes
16202         hack, the situation that we're only looking up types can't happen
16203         anymore when this method is called.  Moved the type lookup code to
16204         DoResolveType() and call it.
16205         (SimpleName.DoResolveType): This ITypeExpression interface method
16206         is now doing the types-only lookup.
16207         (TypeExpr, TypeLookupExpression): Implement ITypeExpression.
16208         (ResolveFlags): Added MaskExprClass.
16209
16210         * expression.cs (MemberAccess): Implement the ITypeExpression
16211         interface.
16212         (MemberAccess.DoResolve): Added support for a types-only lookup
16213         when we're called via ITypeExpression.DoResolveType().
16214         (ComposedCast): Implement the ITypeExpression interface.
16215
16216         * codegen.cs (EmitContext.OnlyLookupTypes): Removed.  Call
16217         Expression.Resolve() with ResolveFlags.Type instead.
16218
16219 2002-08-12  Martin Baulig  <martin@gnome.org>
16220
16221         * interface.cs (Interface.Define): Apply attributes.
16222
16223         * attribute.cs (Attribute.ApplyAttributes): Added support for
16224         interface attributes.
16225
16226 2002-08-11  Martin Baulig  <martin@gnome.org>
16227
16228         * statement.cs (Block.Emit): Only check the "this" variable if we
16229         do not always throw an exception.
16230
16231         * ecore.cs (PropertyExpr.DoResolveLValue): Implemented, check
16232         whether the property has a set accessor.
16233
16234 2002-08-11  Martin Baulig  <martin@gnome.org>
16235
16236         Added control flow analysis support for structs.
16237
16238         * ecore.cs (ResolveFlags): Added `DisableFlowAnalysis' to resolve
16239         with control flow analysis turned off.
16240         (IVariable): New interface.
16241         (SimpleName.SimpleNameResolve): If MemberAccess.ResolveMemberAccess
16242         returns an IMemberExpr, call DoResolve/DoResolveLValue on it.
16243         (FieldExpr.DoResolve): Resolve the instance expression with flow
16244         analysis turned off and do the definite assignment check after the
16245         resolving when we know what the expression will resolve to.
16246
16247         * expression.cs (LocalVariableReference, ParameterReference):
16248         Implement the new IVariable interface, only call the flow analysis
16249         code if ec.DoFlowAnalysis is true.
16250         (This): Added constructor which takes a Block argument.  Implement
16251         the new IVariable interface.
16252         (MemberAccess.DoResolve, MemberAccess.DoResolveLValue): Call
16253         DoResolve/DoResolveLValue on the result of ResolveMemberLookup().
16254         This does the definite assignment checks for struct members.
16255
16256         * class.cs (Constructor.Emit): If this is a non-static `struct'
16257         constructor which doesn't have any initializer, call
16258         Block.AddThisVariable() to tell the flow analysis code that all
16259         struct elements must be initialized before control returns from
16260         the constructor.
16261
16262         * statement.cs (MyStructInfo): New public class.
16263         (UsageVector.this [VariableInfo vi]): Added `int field_idx'
16264         argument to this indexer.  If non-zero, check an individual struct
16265         member, not the whole struct.
16266         (FlowBranching.CheckOutParameters): Check struct members.
16267         (FlowBranching.IsVariableAssigned, SetVariableAssigned): Added
16268         overloaded versions of these methods which take an additional
16269         `int field_idx' argument to check struct members.
16270         (FlowBranching.IsParameterAssigned, SetParameterAssigned): Added
16271         overloaded versions of these methods which take an additional
16272         `string field_name' argument to check struct member.s
16273         (VariableInfo): Implement the IVariable interface.
16274         (VariableInfo.StructInfo): New public property.  Returns the
16275         MyStructInfo instance of the variable if it's a struct or null.
16276         (Block.AddThisVariable): New public method.  This is called from
16277         Constructor.Emit() for non-static `struct' constructor which do
16278         not have any initializer.  It creates a special variable for the
16279         "this" instance variable which will be checked by the flow
16280         analysis code to ensure that all of the struct's fields are
16281         initialized before control returns from the constructor.
16282         (UsageVector): Added support for struct members.  If a
16283         variable/parameter is a struct with N members, we reserve a slot
16284         in the usage vector for each member.  A struct is considered fully
16285         initialized if either the struct itself (slot 0) or all its
16286         members are initialized.
16287
16288 2002-08-08  Martin Baulig  <martin@gnome.org>
16289
16290         * driver.cs (Driver.MainDriver): Only report an error CS5001
16291         if there were no compilation errors.
16292
16293         * codegen.cs (EmitContext.EmitContext): Use the DeclSpace's
16294         `UnsafeContext' property to determine whether the parent is in
16295         unsafe context rather than checking the parent's ModFlags:
16296         classes nested in an unsafe class are unsafe as well.
16297
16298 2002-08-08  Martin Baulig  <martin@gnome.org>
16299
16300         * statement.cs (UsageVector.MergeChildren): Distinguish between
16301         `Breaks' and `Returns' everywhere, don't set `Breaks' anymore if
16302         we return.  Added test17() and test18() to test-154.cs.
16303
16304 2002-08-08  Martin Baulig  <martin@gnome.org>
16305
16306         * typemanager.cs (TypeManager.FilterWithClosure): If we have
16307         Family access, make sure the invoking type isn't a subclass of the
16308         queried type (that'd be a CS1540).
16309
16310         * ecore.cs (Expression.MemberLookup): Added overloaded version of
16311         this method which takes an additional `Type invocation_type'.
16312
16313         * expression.cs (BaseAccess.DoResolve): Use the base type as
16314         invocation and query type.
16315         (MemberAccess.DoResolve): If the lookup failed and we're about to
16316         report a CS0122, try a lookup with the ec.ContainerType - if this
16317         succeeds, we must report a CS1540.
16318
16319 2002-08-08  Martin Baulig  <martin@gnome.org>
16320
16321         * ecore.cs (IMemberExpr): Added `bool IsInstance' property.
16322         (MethodGroupExpr): Implement the IMemberExpr interface.
16323
16324         * expression (MemberAccess.ResolveMemberAccess): No need to have
16325         any special code for MethodGroupExprs anymore, they're now
16326         IMemberExprs.   
16327
16328 2002-08-08  Martin Baulig  <martin@gnome.org>
16329
16330         * typemanager.cs (TypeManager.FilterWithClosure): Check Assembly,
16331         Family, FamANDAssem and FamORAssem permissions.
16332         (TypeManager.IsSubclassOrNestedChildOf): New public method.
16333
16334 2002-08-08  Martin Baulig  <martin@gnome.org>
16335
16336         * statement.cs (FlowBranchingType): Added LOOP_BLOCK.
16337         (UsageVector.MergeChildren): `break' breaks unless we're in a switch
16338         or loop block.
16339
16340 Thu Aug 8 10:28:07 CEST 2002 Paolo Molaro <lupus@ximian.com>
16341
16342         * driver.cs: implemented /resource option to embed managed resources.
16343
16344 2002-08-07  Martin Baulig  <martin@gnome.org>
16345
16346         * class.cs (FieldBase.Initializer): Renamed to `init' and made private.
16347         (FieldBase.HasFieldInitializer): New public property.
16348         (FieldBase.GetInitializerExpression): New public method.  Resolves and
16349         returns the field initializer and makes sure it is only resolved once.
16350         (TypeContainer.EmitFieldInitializers): Call
16351         FieldBase.GetInitializerExpression to get the initializer, this ensures
16352         that it isn't resolved multiple times.
16353
16354         * codegen.cs (EmitContext): Added `bool IsFieldInitialier'.  This tells
16355         the resolving process (SimpleName/MemberLookup) that we're currently
16356         emitting a field initializer (which must not access any instance members,
16357         this is an error CS0236).
16358
16359         * ecore.cs (SimpleName.Error_ObjectRefRequired): Added EmitContext
16360         argument, if the `IsFieldInitializer' flag is set, we must report and
16361         error CS0236 and not an error CS0120.   
16362
16363 2002-08-07  Martin Baulig  <martin@gnome.org>
16364
16365         * ecore.cs (IMemberExpr): New public interface.
16366         (FieldExpr, PropertyExpr, EventExpr): Implement IMemberExpr.
16367         (SimpleName.SimpleNameResolve): Call MemberAccess.ResolveMemberAccess
16368         if the expression is an IMemberExpr.
16369
16370         * expression.cs (MemberAccess.ResolveMemberAccess): Allow `left'
16371         to be null, implicitly default to `this' if we're non-static in
16372         this case.  Simplified the code a lot by using the new IMemberExpr
16373         interface.  Also fixed bug #28176 here.
16374
16375 2002-08-06  Martin Baulig  <martin@gnome.org>
16376
16377         * cs-parser.jay (SimpleLookup): Removed.  We need to create
16378         ParameterReferences during semantic analysis so that we can do a
16379         type-only search when resolving Cast, TypeOf and SizeOf.
16380         (block): Pass the `current_local_parameters' to the Block's
16381         constructor.
16382
16383         * class.cs (ConstructorInitializer): Added `Parameters parameters'
16384         argument to the constructor.
16385         (ConstructorInitializer.Resolve): Create a temporary implicit
16386         block with the parameters.
16387
16388         * ecore.cs (SimpleName.SimpleNameResolve): Resolve parameter
16389         references here if we aren't doing a type-only search.
16390
16391         * statement.cs (Block): Added constructor which takes a
16392         `Parameters parameters' argument.
16393         (Block.Parameters): New public property.
16394
16395         * support.cs (InternalParameters.Parameters): Renamed `parameters'
16396         to `Parameters' and made it public readonly.
16397
16398 2002-08-06  Martin Baulig  <martin@gnome.org>
16399
16400         * ecore.cs (Expression.Warning): Made this public as well.
16401
16402         * report.cs (Report.Debug): Print the contents of collections.
16403
16404 2002-08-06  Martin Baulig  <martin@gnome.org>
16405
16406         * ecore.cs (Expression.ResolveFlags): New [Flags] enum.  This is
16407         used to tell Resolve() which kinds of expressions it may return.
16408         (Expression.Resolve): Added overloaded version of this method which
16409         takes a `ResolveFlags flags' argument.  This can be used to tell
16410         Resolve() which kinds of expressions it may return.  Reports a
16411         CS0118 on error.
16412         (Expression.ResolveWithSimpleName): Removed, use Resolve() with
16413         ResolveFlags.SimpleName.
16414         (Expression.Error118): Added overloaded version of this method which
16415         takes a `ResolveFlags flags' argument.  It uses the flags to determine
16416         which kinds of expressions are allowed.
16417
16418         * expression.cs (Argument.ResolveMethodGroup): New public method.
16419         Resolves an argument, but allows a MethodGroup to be returned.
16420         This is used when invoking a delegate.
16421
16422         * TODO: Updated a bit.
16423
16424 2002-08-06  Gonzalo Paniagua Javier <gonzalo@ximian.com>
16425
16426         Fixed compilation with csc.
16427
16428         * ecore.cs: Expression.Error made public. Is this correct? Should
16429         Warning be made public too?
16430
16431         * expression.cs: use ea.Location instead of ea.loc.
16432         [FIXME:  Filed as bug #28607: MCS must report these errors.]
16433
16434 2002-08-06  Martin Baulig  <martin@gnome.org>
16435
16436         * ecore.cs (Expression.loc): Moved the location here instead of
16437         duplicating it in all derived classes.
16438         (Expression.Location): New public property.
16439         (Expression.Error, Expression.Warning): Made them non-static and
16440         removed the location argument.
16441         (Expression.Warning): Added overloaded version which takes an
16442         `int level' argument.
16443         (Expression.Error118): Make this non-static and removed the
16444         expression and location arguments.
16445         (TypeExpr): Added location argument to the constructor.
16446
16447         * expression.cs (StaticCallExpr): Added location argument to
16448         the constructor.
16449         (Indirection, PointerArithmetic): Likewise.
16450         (CheckedExpr, UnCheckedExpr): Likewise.
16451         (ArrayAccess, IndexerAccess, UserCast, ArrayPtr): Likewise.
16452         (StringPtr): Likewise.
16453
16454
16455 2002-08-05  Martin Baulig  <martin@gnome.org>
16456
16457         * expression.cs (BaseAccess.DoResolve): Actually report errors.
16458
16459         * assign.cs (Assign.DoResolve): Check whether the source
16460         expression is a value or variable.
16461
16462         * statement.cs (Try.Resolve): Set ec.InTry/InCatch/InFinally
16463         while resolving the corresponding blocks.
16464
16465         * interface.cs (Interface.GetInterfaceTypeByName): Actually report
16466         an error, don't silently return null.
16467
16468         * statement.cs (Block.AddVariable): Do the error reporting here
16469         and distinguish between CS0128 and CS0136.
16470         (Block.DoResolve): Report all unused labels (warning CS0164).
16471         (LabeledStatement): Pass the location to the constructor.
16472         (LabeledStatement.HasBeenReferenced): New property.
16473         (LabeledStatement.Resolve): Set it to true here.
16474
16475         * statement.cs (Return.Emit): Return success even after reporting
16476         a type mismatch error (CS0126 or CS0127), this is what csc does and
16477         it avoids confusing the users with any consecutive errors.
16478
16479 2002-08-05  Martin Baulig  <martin@gnome.org>
16480
16481         * enum.cs (Enum.LookupEnumValue): Catch circular definitions.
16482
16483         * const.cs (Const.LookupConstantValue): Catch circular definitions.
16484
16485         * expression.cs (MemberAccess.DoResolve): Silently return if an
16486         error has already been reported.
16487
16488         * ecore.cs (Expression.MemberLookupFinal): Silently return if an
16489         error has already been reported.
16490
16491 2002-08-05  Martin Baulig  <martin@gnome.org>
16492
16493         * statement.cs (UsageVector): Only initialize the `parameters'
16494         vector if we actually have any "out" parameters.
16495
16496 2002-08-05  Martin Baulig  <martin@gnome.org>
16497
16498         * expression.cs (Binary.ResolveOperator): When combining delegates,
16499         they must have the same type.
16500
16501 2002-08-05  Martin Baulig  <martin@gnome.org>
16502
16503         * typemanager.cs (TypeManager.GetArgumentTypes): Don't call
16504         PropertyInfo.GetIndexParameters() on dynamic types, this doesn't
16505         work with the ms runtime and we also don't need it: if we're a
16506         PropertyBuilder and not in the `indexer_arguments' hash, then we
16507         are a property and not an indexer.
16508
16509         * class.cs (TypeContainer.AsAccessible): Use Type.IsArray,
16510         Type.IsPointer and Type.IsByRef instead of Type.HasElementType
16511         since the latter one doesn't work with the ms runtime.
16512
16513 2002-08-03  Martin Baulig  <martin@gnome.org>
16514
16515         Fixed bugs #27998 and #22735.
16516
16517         * class.cs (Method.IsOperator): New public field.
16518         (Method.CheckBase): Report CS0111 if there's already a method
16519         with the same parameters in the current class.  Report CS0508 when
16520         attempting to change the return type of an inherited method.
16521         (MethodData.Emit): Report CS0179 if a method doesn't have a body
16522         and it's not marked abstract or extern.
16523         (PropertyBase): New abstract base class for Property and Indexer.
16524         (PropertyBase.CheckBase): Moved here from Property and made it work
16525         for indexers.
16526         (PropertyBase.Emit): Moved here from Property.Emit, Indexer.Emit is
16527         the same so we can reuse it there.
16528         (Property, Indexer): Derive from PropertyBase.
16529         (MethodSignature.inheritable_property_signature_filter): New delegate
16530         to find properties and indexers.
16531
16532         * decl.cs (MemberCore.CheckMethodAgainstBase): Added `string name'
16533         argument and improved error reporting.
16534
16535         * parameter.cs (Parameters.GetEmptyReadOnlyParameters): Renamed to
16536         EmptyReadOnlyParameters and made it a property.
16537
16538         * typemanager.cs (TypeManager.GetArgumentTypes): Added overloaded
16539         version of this method which takes a `PropertyInfo indexer'.
16540         (TypeManager.RegisterIndexer): New method.
16541
16542         * class.cs: Added myself as author of this file :-)
16543
16544 2002-08-03  Gonzalo Paniagua Javier <gonzalo@ximian.com>
16545
16546         * class.cs: fixed compilation on windoze.
16547
16548 2002-08-03  Martin Baulig  <martin@gnome.org>
16549
16550         * interface.cs (Interface.GetInterfaceBases): Check whether all
16551         base interfaces are at least as accessible than the current one.
16552
16553         * class.cs (TypeContainer.GetClassBases): Check whether base types
16554         are at least as accessible than the current type.
16555         (TypeContainer.AsAccessible): Implemented and made non-static.
16556         (MemberBase.CheckParameters): Report errors if the accessibility
16557         checks fail.
16558
16559         * delegate.cs (Delegate.Delegate): The default visibility is
16560         internal for top-level types and private for nested types.
16561         (Delegate.Define): Report errors if the accessibility checks fail.
16562
16563         * enum.cs (Enum.Enum): The default visibility is internal for
16564         top-level types and private for nested types.
16565         (Enum.DefineType): Compute the correct visibility.
16566
16567         * modifiers.cs (Modifiers.TypeAttr): Added a version of this
16568         function which takes a `bool is_toplevel' instead of a TypeContainer.
16569
16570         * typemanager.cs (TypeManager.IsBuiltinType): `void' is also a
16571         builtin type.
16572
16573 2002-08-02  Martin Baulig  <martin@gnome.org>
16574
16575         * expression.cs (LocalVariableReferenc): Added constructor which
16576         takes additional `VariableInfo vi' and `bool is_readonly' arguments.
16577         (LocalVariableReference.IsReadOnly): New property.
16578         (LocalVariableReference.DoResolveLValue): Report a CS1604 if the
16579         variable is readonly, use our own readonly flag to do this; you can
16580         use the new constructor to get a writable reference to a read-only
16581         variable.
16582
16583         * cs-parser.jay (foreach_statement, using_statement): Get a writable
16584         reference to the local variable.
16585
16586 2002-08-01  Miguel de Icaza  <miguel@ximian.com>
16587
16588         * rootcontext.cs (ResolveCore): Also include System.Exception
16589
16590         * statement.cs (Block.Emit): Do not emit the dead-code warnings if
16591         we reach an EmptyStatement.
16592
16593         (Catch.DoResolve, Throw.DoResolve): Throwing the System.Exception
16594         is also fine.
16595
16596         * expression.cs (Binary.ResolveOperator): Check error result in
16597         two places.
16598
16599         use brtrue/brfalse directly and avoid compares to null.
16600
16601 2002-08-02  Martin Baulig  <martin@gnome.org>
16602
16603         * class.cs (TypeContainer.Define): Define all nested interfaces here.
16604         Fixes bug #28407, added test-155.cs.
16605
16606 2002-08-01  Martin Baulig  <martin@gnome.org>
16607
16608         * class.cs (Event.EmitDefaultMethod): Make this work with static
16609         events.  Fixes #28311, added verify-3.cs.
16610
16611 2002-08-01  Martin Baulig  <martin@gnome.org>
16612
16613         * statement.cs (ForeachHelperMethods): Added `enumerator_type' and
16614         `is_disposable' fields.
16615         (Foreach.GetEnumeratorFilter): Set `hm.enumerator_type' and
16616         `hm.is_disposable' if we're using the collection pattern.
16617         (Foreach.EmitCollectionForeach): Use the correct type for the
16618         enumerator's local variable, only emit the try/finally block if
16619         necessary (fixes #27713).
16620
16621 2002-08-01  Martin Baulig  <martin@gnome.org>
16622
16623         * ecore.cs (Expression.report118): Renamed to Error118 and made
16624         it public static.
16625
16626         * statement.cs (Throw.Resolve): Check whether the expression is of
16627         the correct type (CS0118) and whether the type derives from
16628         System.Exception (CS0155).
16629         (Catch.Resolve): New method.  Do the type lookup here and check
16630         whether it derives from System.Exception (CS0155).
16631         (Catch.CatchType, Catch.IsGeneral): New public properties.
16632
16633         * typemanager.cs (TypeManager.exception_type): Added.
16634
16635 2002-07-31  Miguel de Icaza  <miguel@ximian.com>
16636
16637         * driver.cs: Updated About function.
16638
16639 2002-07-31  Martin Baulig  <martin@gnome.org>
16640
16641         Implemented Control Flow Analysis.
16642
16643         * codegen.cs (EmitContext.DoFlowAnalysis): New public variable.
16644         (EmitContext.CurrentBranching): Added.
16645         (EmitContext.StartFlowBranching): Added.
16646         (EmitContext.EndFlowBranching): Added.
16647         (EmitContext.KillFlowBranching): Added.
16648         (EmitContext.IsVariableAssigned): Added.
16649         (EmitContext.SetVariableAssigned): Added.
16650         (EmitContext.IsParameterAssigned): Added.
16651         (EmitContext.SetParameterAssigned): Added.
16652         (EmitContext.EmitTopBlock): Added `InternalParameters ip' argument.
16653         Added control flow analysis stuff here.
16654
16655         * expression.cs (Unary.DoResolve): If the operator is Oper.AddressOf,
16656         resolve the expression as lvalue.
16657         (LocalVariableReference.DoResolve): Check whether the variable has
16658         already been assigned.
16659         (ParameterReference.DoResolveLValue): Override lvalue resolve to mark
16660         the parameter as assigned here.
16661         (ParameterReference.DoResolve): Check whether the parameter has already
16662         been assigned.
16663         (Argument.Resolve): If it's a `ref' or `out' argument, resolve the
16664         expression as lvalue.
16665
16666         * statement.cs (FlowBranching): New class for the flow analysis code.
16667         (Goto): Resolve the label in Resolve, not in Emit; added flow analysis.
16668         (LabeledStatement.IsDefined): New public property.
16669         (LabeledStatement.AddUsageVector): New public method to tell flow
16670         analyis that the label may be reached via a forward jump.
16671         (GotoCase): Lookup and resolve the label in Resolve, not in Emit; added
16672         flow analysis.
16673         (VariableInfo.Number): New public field.  This is used by flow analysis
16674         to number all locals of a block.
16675         (Block.CountVariables): New public property.  This is the number of
16676         local variables in this block (including the locals from all parent
16677         blocks).
16678         (Block.EmitMeta): Number all the variables.
16679
16680         * statement.cs: Added flow analysis support to all classes.
16681
16682 2002-07-31  Martin Baulig  <martin@gnome.org>
16683
16684         * driver.cs: Added "--mcs-debug" argument if MCS_DEBUG is defined.
16685         To get debugging messages, compile mcs with /define:MCS_DEBUG and
16686         then use this argument.
16687
16688         * report.cs (Report.Debug): Renamed to conditional to "MCS_DEBUG".
16689
16690         * makefile.gnu (MCS_FLAGS): Include $(MCS_DEFINES), the user may
16691         use this to specify /define options.
16692
16693 2002-07-29  Martin Baulig  <martin@gnome.org>
16694
16695         * statement.cs (Fixed): Moved all code that does variable lookups
16696         and resolvings from Emit to Resolve.
16697
16698         * statement.cs (For): Moved all code that does variable lookups
16699         and resolvings from Emit to Resolve.
16700
16701         * statement.cs (Using): Moved all code that does variable lookups
16702         and resolvings from Emit to Resolve.
16703
16704 2002-07-29  Martin Baulig  <martin@gnome.org>
16705
16706         * attribute.cs (Attribute.Resolve): Explicitly catch a
16707         System.NullReferenceException when creating the
16708         CustromAttributeBuilder and report a different warning message.
16709
16710 2002-07-29  Martin Baulig  <martin@gnome.org>
16711
16712         * support.cs (ParameterData.ParameterName): Added method to
16713         get the name of a parameter.
16714
16715         * typemanager.cs (TypeManager.IsValueType): New public method.
16716
16717 2002-07-29  Martin Baulig  <martin@gnome.org>
16718
16719         * parameter.cs (Parameter.Modifier): Added `ISBYREF = 8'.  This
16720         is a flag which specifies that it's either ref or out.
16721         (Parameter.GetParameterInfo (DeclSpace, int, out bool)): Changed
16722         the out parameter to `out Parameter.Modifier mod', also set the
16723         Parameter.Modifier.ISBYREF flag on it if it's either ref or out.
16724
16725         * support.cs (InternalParameters.ParameterModifier): Distinguish
16726         between Parameter.Modifier.OUT and Parameter.Modifier.REF, set the
16727         Parameter.Modifier.ISBYREF flag if it's either ref or out.
16728
16729         * expression.cs (Argument.GetParameterModifier): Distinguish
16730         between Parameter.Modifier.OUT and Parameter.Modifier.REF, set the
16731         Parameter.Modifier.ISBYREF flag if it's either ref or out.
16732
16733 2002-07-29  Martin Baulig  <martin@gnome.org>
16734
16735         * expression.cs (ParameterReference.ParameterReference): Added
16736         `Location loc' argument to the constructor.
16737
16738         * cs-parser.jay: Pass location to ParameterReference.
16739
16740 2002-07-28  Miguel de Icaza  <miguel@ximian.com>
16741
16742         * statement.cs (Try): Initialize the location.
16743
16744         * cs-parser.jay: pass location to Try.
16745
16746         * expression.cs (Unary.Reduce): Change the prototype to return
16747         whether a constant fold could be performed or not.  The result is
16748         returned in an out parameters.  In the case of Indirection and
16749         AddressOf, we want to perform the full tests.
16750
16751 2002-07-26  Miguel de Icaza  <miguel@ximian.com>
16752
16753         * statement.cs (Statement.Emit): Flag dead code.
16754
16755 2002-07-27  Andrew Birkett  <andy@nobugs.org>
16756
16757         * expression.cs (Unary.Reduce): Handle AddressOf and Indirection.
16758
16759 2002-07-27  Martin Baulig  <martin@gnome.org>
16760
16761         * class.cs (MethodData.Define): Put back call to
16762         TypeManager.AddMethod(), accidentally commented this out.
16763
16764         * report.cs (Debug): New public method to print debugging information,
16765         this is `[Conditional ("DEBUG")]'.
16766
16767 2002-07-26  Martin Baulig  <martin@gnome.org>
16768
16769         * cs-parser.jay (CSharpParser): Added `Stack switch_stack'.
16770         (switch_statement): Push the current_block to the switch_stack and
16771         pop it again when we're done with the switch.
16772         (switch_section): The new block is a child of the current_block.
16773         Fixes bug #24007, added test-152.cs.
16774
16775 2002-07-27  Martin Baulig  <martin@gnome.org>
16776
16777         * expression.cs (Invocation.EmitArguments): When calling a varargs
16778         function with only its fixed arguments, we need to pass an empty
16779         array.
16780
16781 2002-07-27  Martin Baulig  <martin@gnome.org>
16782
16783         Mono 0.13 has been released.
16784
16785 2002-07-25  Miguel de Icaza  <miguel@ximian.com>
16786
16787         * driver.cs: Rename --resource to --linkres, because that is what
16788         we do currently, we dont support --resource yet.
16789
16790         * cs-tokenizer.cs: Fix test for reporting endif mismatches.
16791
16792 2002-07-25  Martin Baulig  <martin@gnome.org>
16793
16794         * class.cs (MethodData): New public class.  This is a `method builder'
16795         class for a method or one accessor of a Property/Indexer/Event.
16796         (MethodData.GetMethodFlags): Moved here from MemberBase.
16797         (MethodData.ApplyAttributes): Likewise.
16798         (MethodData.ApplyObsoleteAttribute): Likewise.
16799         (MethodData.ApplyConditionalAttribute): Likewise.
16800         (MethodData.ApplyDllImportAttribute): Likewise.
16801         (MethodData.CheckAbstractAndExternal): Likewise.
16802         (MethodData.Define): Formerly knows as MemberBase.DefineMethod().
16803         (MethodData.Emit): Formerly known as Method.Emit().
16804         (MemberBase): Moved everything which was specific to a single
16805         accessor/method to MethodData.
16806         (Method): Create a new MethodData and call Define() and Emit() on it.
16807         (Property, Indexer, Event): Create a new MethodData objects for each
16808         accessor and call Define() and Emit() on them.
16809
16810 2002-07-25  Martin Baulig  <martin@gnome.org>
16811
16812         Made MethodCore derive from MemberBase to reuse the code from there.
16813         MemberBase now also checks for attributes.
16814
16815         * class.cs (MethodCore): Derive from MemberBase, not MemberCore.
16816         (MemberBase.GetMethodFlags): Moved here from class Method and marked
16817         as virtual.
16818         (MemberBase.DefineAccessor): Renamed to DefineMethod(), added
16819         `CallingConventions cc' and `Attributes opt_attrs' arguments.
16820         (MemberBase.ApplyAttributes): New virtual method; applies the
16821         attributes to a method or accessor.
16822         (MemberBase.ApplyObsoleteAttribute): New protected virtual method.
16823         (MemberBase.ApplyConditionalAttribute): Likewise.
16824         (MemberBase.ApplyDllImportAttribute): Likewise.
16825         (MemberBase.CheckAbstractAndExternal): Likewise.
16826         (MethodCore.ParameterTypes): This is now a property instead of a
16827         method, it's initialized from DoDefineParameters().
16828         (MethodCore.ParameterInfo): Removed the set accessor.
16829         (MethodCore.DoDefineParameters): New protected virtual method to
16830         initialize ParameterTypes and ParameterInfo.
16831         (Method.GetReturnType): We can now simply return the MemberType.
16832         (Method.GetMethodFlags): Override the MemberBase version and add
16833         the conditional flags.
16834         (Method.CheckBase): Moved some code from Define() here, call
16835         DoDefineParameters() here.
16836         (Method.Define): Use DoDefine() and DefineMethod() from MemberBase
16837         here to avoid some larger code duplication.
16838         (Property.Emit, Indexer.Emit): Call CheckAbstractAndExternal() to
16839         ensure that abstract and external accessors don't declare a body.
16840
16841         * attribute.cs (Attribute.GetValidPieces): Make this actually work:
16842         `System.Attribute.GetCustomAttributes (attr.Type)' does a recursive
16843         lookup in the attribute's parent classes, so we need to abort as soon
16844         as we found the first match.
16845         (Attribute.Obsolete_GetObsoleteMessage): Return the empty string if
16846         the attribute has no arguments.
16847
16848         * typemanager.cs (TypeManager.AddMethod): Now takes a MemberBase instead
16849         of a Method.
16850
16851 2002-07-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
16852
16853         * cs-parser.jay: reverted previous patch.
16854
16855 2002-07-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
16856
16857         * cs-parser.jay: fixed bug #22119.
16858
16859 2002-07-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
16860
16861         * attribute.cs: fixed compilation. The error was:
16862         "attribute.cs(571,17): error CS0177: The out parameter 'is_error' must 
16863         be assigned to before control leaves the current method."
16864         [FIXME:  Filed as bug #28186: MCS must report this error.]
16865
16866 2002-07-25  Martin Baulig  <martin@gnome.org>
16867
16868         * attribute.cs (Attribute.Conditional_GetConditionName): New static
16869         method to pull the condition name ouf of a Conditional attribute.
16870         (Attribute.Obsolete_GetObsoleteMessage): New static method to pull
16871         the obsolete message and error flag out of an Obsolete attribute.
16872
16873         * class.cs (Method.GetMethodFlags): New public method to get the
16874         TypeManager.MethodFlags for this method.
16875         (Method.ApplyConditionalAttribute, Method.ApplyObsoleteAttribute): New
16876         private methods.
16877         (Method.Define): Get and apply the Obsolete and Conditional attributes;
16878         if we're overriding a virtual function, set the new private variable
16879         `parent_method'; call the new TypeManager.AddMethod().
16880
16881         * typemanager.cs (TypeManager.AddMethod): New static method.  Stores
16882         the MethodBuilder and the Method in a PtrHashtable.
16883         (TypeManager.builder_to_method): Added for this purpose.
16884         (TypeManager.MethodFlags): Added IsObsoleteError.
16885         (TypeManager.GetMethodFlags): Added `Location loc' argument.  Lookup
16886         Obsolete and Conditional arguments in MethodBuilders.  If we discover
16887         an Obsolete attribute, emit an appropriate warning 618 / error 619 with
16888         the message from the attribute.
16889
16890 2002-07-24  Martin Baulig  <martin@gnome.org>
16891
16892         * cs-tokenizer.cs: Eat up trailing whitespaces and one-line comments in
16893         preprocessor directives, ensure that the argument to #define/#undef is
16894         exactly one identifier and that it's actually an identifier.
16895
16896         Some weeks ago I did a `#define DEBUG 1' myself and wondered why this
16897         did not work ....
16898
16899 2002-07-24  Martin Baulig  <martin@gnome.org>
16900
16901         * statement.cs (Foreach.ForeachHelperMethods): Added `Type element_type',
16902         initialize it to TypeManager.object_type in the constructor.
16903         (Foreach.GetEnumeratorFilter): Set `hm.element_type' to the return type
16904         of the `hm.get_current' method if we're using the collection pattern.
16905         (Foreach.EmitCollectionForeach): Use `hm.element_type' as the source type
16906         for the explicit conversion to make it work when we're using the collection
16907         pattern and the `Current' property has a different return type than `object'.
16908         Fixes #27713.
16909
16910 2002-07-24  Martin Baulig  <martin@gnome.org>
16911
16912         * delegate.cs (Delegate.VerifyMethod): Simply return null if the method
16913         does not match, but don't report any errors.  This method is called in
16914         order for all methods in a MethodGroupExpr until a matching method is
16915         found, so we don't want to bail out if the first method doesn't match.
16916         (NewDelegate.DoResolve): If none of the methods in the MethodGroupExpr
16917         matches, report the 123.  Fixes #28070.
16918
16919 2002-07-24  Martin Baulig  <martin@gnome.org>
16920
16921         * expression.cs (ArrayAccess.EmitStoreOpcode): Moved the
16922         TypeManager.TypeToCoreType() to the top of the method so the
16923         following equality checks will work.  Fixes #28107.
16924
16925 2002-07-24  Martin Baulig  <martin@gnome.org>
16926
16927         * cfold.cs (ConstantFold.DoConstantNumericPromotions): "If either
16928         operand is of type uint, and the other operand is of type sbyte,
16929         short or int, the operands are converted to type long." -
16930         Actually do what this comment already told us.  Fixes bug #28106,
16931         added test-150.cs.
16932
16933 2002-07-24  Martin Baulig  <martin@gnome.org>
16934
16935         * class.cs (MethodBase): New abstract class.  This is now a base
16936         class for Property, Indexer and Event to avoid some code duplication
16937         in their Define() and DefineMethods() methods.
16938         (MethodBase.DoDefine, MethodBase.DefineAccessor): Provide virtual
16939         generic methods for Define() and DefineMethods().
16940         (FieldBase): Derive from MemberBase, not MemberCore.
16941         (Property): Derive from MemberBase, not MemberCore.
16942         (Property.DefineMethod): Moved all the code from this method to the
16943         new MethodBase.DefineAccessor(), just call it with appropriate
16944         argumetnts.
16945         (Property.Define): Call the new Property.DoDefine(), this does some
16946         sanity checks and we don't need to duplicate the code everywhere.
16947         (Event): Derive from MemberBase, not MemberCore.
16948         (Event.Define): Use the new MethodBase.DefineAccessor() to define the
16949         accessors, this will also make them work with interface events.
16950         (Indexer): Derive from MemberBase, not MemberCore.
16951         (Indexer.DefineMethod): Removed, call MethodBase.DefineAccessor() insstead.
16952         (Indexer.Define): Use the new MethodBase functions.
16953
16954         * interface.cs (InterfaceEvent.InterfaceEvent): Added `Location loc'
16955         argument to the constructor.
16956         (Interface.FindMembers): Added support for interface events.
16957         (Interface.PopluateEvent): Implemented.
16958
16959         Added test-149.cs for this.  This also fixes bugs #26067 and #24256.
16960
16961 2002-07-22  Miguel de Icaza  <miguel@ximian.com>
16962
16963         * class.cs (TypeContainer.AddMethod): Adding methods do not use IsValid,
16964         but this is required to check for a method name being the same as
16965         the containing class.  
16966
16967         Handle this now.
16968
16969 2002-07-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
16970
16971         * interface.cs: initialize variable.
16972
16973 2002-07-23  Martin Baulig  <martin@gnome.org>
16974
16975         Implemented the IndexerName attribute in interfaces.
16976
16977         * class.cs (TypeContainer.DefineIndexers): Don't set the indexer
16978         name if this is an explicit interface implementation.
16979         (Indexer.InterfaceIndexerName): New public variable.  If we're
16980         implementing an interface indexer, this is the IndexerName in that
16981         interface.  Otherwise, it's the IndexerName.
16982         (Indexer.DefineMethod): If we're implementing interface indexer,
16983         set InterfaceIndexerName.  Use the new Pending.IsInterfaceIndexer
16984         and Pending.ImplementIndexer methods.
16985         (Indexer.Define): Also define the PropertyBuilder if we're
16986         implementing an interface indexer and this is neither an explicit
16987         interface implementation nor do the IndexerName match the one in
16988         the interface.
16989
16990         * pending.cs (TypeAndMethods): Added `MethodInfo [] need_proxy'.
16991         If a method is defined here, then we always need to create a proxy
16992         for it.  This is used when implementing interface indexers.
16993         (Pending.IsInterfaceIndexer): New public method.
16994         (Pending.ImplementIndexer): New public method.
16995         (Pending.InterfaceMethod): Added `MethodInfo need_proxy' argument.
16996         This is used when implementing interface indexers to define a proxy
16997         if necessary.
16998         (Pending.VerifyPendingMethods): Look in the `need_proxy' array and
16999         define a proxy if necessary.
17000
17001         * interface.cs (Interface.IndexerName): New public variable.
17002         (Interface.PopulateIndexer): Set the IndexerName.
17003         (Interface.DefineIndexers): New private method.  Populate all the
17004         indexers and make sure their IndexerNames match.
17005
17006         * typemanager.cs (IndexerPropertyName): Added support for interface
17007         indexers.
17008
17009 2002-07-22  Martin Baulig  <martin@gnome.org>
17010
17011         * codegen.cs (EmitContext.HasReturnLabel): New public variable.
17012         (EmitContext.EmitTopBlock): Always mark the ReturnLabel and emit a
17013         ret if HasReturnLabel.
17014         (EmitContext.TryCatchLevel, LoopBeginTryCatchLevel): New public
17015         variables.
17016
17017         * statement.cs (Do.Emit, While.Emit, For.Emit, Foreach.Emit): Save
17018         and set the ec.LoopBeginTryCatchLevel.
17019         (Try.Emit): Increment the ec.TryCatchLevel while emitting the block.
17020         (Continue.Emit): If the ec.LoopBeginTryCatchLevel is smaller than
17021         the current ec.TryCatchLevel, the branch goes out of an exception
17022         block.  In this case, we need to use Leave and not Br.
17023
17024 2002-07-22  Martin Baulig  <martin@gnome.org>
17025
17026         * statement.cs (Try.Emit): Emit an explicit ret after the end of the
17027         block unless the block does not always return or it is contained in
17028         another try { ... } catch { ... } block.  Fixes bug #26506.
17029         Added verify-1.cs to the test suite.
17030
17031 2002-07-22  Martin Baulig  <martin@gnome.org>
17032
17033         * statement.cs (Switch.TableSwitchEmit): If we don't have a default,
17034         then we do not always return.  Fixes bug #24985.
17035
17036 2002-07-22  Martin Baulig  <martin@gnome.org>
17037
17038         * expression.cs (Invocation.OverloadedResolve): Do the BetterFunction()
17039         lookup on a per-class level; ie. walk up the class hierarchy until we
17040         found at least one applicable method, then choose the best among them.
17041         Fixes bug #24463 and test-29.cs.
17042
17043 2002-07-22  Martin Baulig  <martin@gnome.org>
17044
17045         * typemanager.cs (TypeManager.ArrayContainsMethod): Don't check the
17046         return types of the methods.  The return type is not part of the
17047         signature and we must not check it to make the `new' modifier work.
17048         Fixes bug #27999, also added test-147.cs.
17049         (TypeManager.TypeToCoreType): Added TypeManager.type_type.
17050
17051         * expression.cs (Invocation.DoResolve): Call TypeManager.TypeToCoreType()
17052         on the method's return type.
17053
17054 2002-07-21  Martin Baulig  <martin@gnome.org>
17055
17056         * assign.cs: Make this work if the rightmost source is a constant and
17057         we need to do an implicit type conversion.  Also adding a few more tests
17058         to test-38.cs which should have caught this.
17059
17060         * makefile.gnu: Disable debugging, there's already the mcs-mono2.exe
17061         target in the makefile for this.  The makefile.gnu is primarily intended
17062         for end-users who don't want to debug the compiler.
17063
17064 2002-07-21  Martin Baulig  <martin@gnome.org>
17065
17066         * assign.cs: Improved the Assign class so it can now handle embedded
17067         assignments (X = Y = Z = something).  As a side-effect this'll now also
17068         consume less local variables.  test-38.cs now passes with MCS, added
17069         a few new test cases to that test.
17070
17071 2002-07-20  Martin Baulig  <martin@gnome.org>
17072
17073         * expression.cs (Binary.EmitBranchable): Emit correct unsigned branch
17074         instructions.  Fixes bug #27977, also added test-146.cs.
17075
17076 2002-07-19  Gonzalo Paniagua Javier <gonzalo@ximian.com>
17077
17078         * cs-tokenizer.cs: fixed getHex ().
17079
17080 2002-07-19  Martin Baulig  <martin@gnome.org>
17081
17082         * expression.cs (Invocation.EmitParams): Use TypeManager.LookupType(),
17083         not Type.GetType() to lookup the array type.  This is needed when
17084         we're constructing an array of a user-defined type.
17085         (ArrayAccess.EmitDynamicInitializers): Only emit the Ldelema for
17086         single-dimensional arrays, but also for single-dimensial arrays of
17087         type decimal.
17088
17089 2002-07-19  Martin Baulig  <martin@gnome.org>
17090
17091         * expression.cs (New.DoEmit): Create a new LocalTemporary each time
17092         this function is called, it's not allowed to share LocalBuilders
17093         among ILGenerators.
17094
17095 2002-07-19  Martin Baulig  <martin@gnome.org>
17096
17097         * expression.cs (Argument.Resolve): Report an error 118 when trying
17098         to pass a type as argument.
17099
17100 2002-07-18  Martin Baulig  <martin@gnome.org>
17101
17102         * ecore.cs (Expression.ImplicitNumericConversion): Don't emit a
17103         Conv_R_Un for the signed `long' type.
17104
17105 2002-07-15  Miguel de Icaza  <miguel@ximian.com>
17106
17107         * expression.cs (MemberAccess.DoResolve): Do not reuse the field
17108         `expr' for the temporary result, as that will fail if we do
17109         multiple resolves on the same expression.
17110
17111 2002-07-05  Miguel de Icaza  <miguel@ximian.com>
17112
17113         * ecore.cs (SimpleNameResolve): Use ec.DeclSpace instead of
17114         ec.TypeContainer for looking up aliases. 
17115
17116         * class.cs (TypeContainer): Remove LookupAlias from here.
17117
17118         * decl.cs (DeclSpace); Move here.
17119
17120 2002-07-01  Miguel de Icaza  <miguel@ximian.com>
17121
17122         * class.cs (FindMembers): Only call filter if the constructor
17123         bulider is not null.
17124
17125         Also handle delegates in `NestedTypes' now.  Now we will perform
17126         type lookups using the standard resolution process.  This also
17127         fixes a bug.
17128
17129         * decl.cs (DeclSpace.ResolveType): New type resolution routine.
17130         This uses Expressions (the limited kind that can be parsed by the
17131         tree) instead of strings.
17132
17133         * expression.cs (ComposedCast.ToString): Implement, used to flag
17134         errors since now we have to render expressions.
17135
17136         (ArrayCreation): Kill FormElementType.  Use ComposedCasts in
17137         FormArrayType. 
17138
17139         * ecore.cs (SimpleName.ToString): ditto.
17140
17141         * cs-parser.jay: Instead of using strings to assemble types, use
17142         Expressions to assemble the type (using SimpleName, ComposedCast,
17143         MemberAccess).  This should fix the type lookups in declarations,
17144         because we were using a different code path for this.
17145
17146         * statement.cs (Block.Resolve): Continue processing statements
17147         even when there is an error.
17148
17149 2002-07-17  Miguel de Icaza  <miguel@ximian.com>
17150
17151         * class.cs (Event.Define): Also remove the `remove' method from
17152         the list of pending items.
17153
17154         * expression.cs (ParameterReference): Use ldarg.N (0..3) to
17155         generate more compact code. 
17156
17157 2002-07-17  Martin Baulig  <martin@gnome.org>
17158
17159         * const.cs (Const.LookupConstantValue): Add support for constant
17160         `unchecked' and `checked' expressions.
17161         Also adding test case test-140.cs for this.
17162
17163 2002-07-17  Martin Baulig  <martin@gnome.org>
17164
17165         * statement.cs (Foreach.GetEnumeratorFilter): When compiling corlib,
17166         check whether mi.ReturnType implements the IEnumerator interface; the
17167         `==' and the IsAssignableFrom() will fail in this situation.
17168
17169 2002-07-16  Ravi Pratap  <ravi@ximian.com>
17170
17171         * ecore.cs (SimpleName.SimpleNameResolve) : Apply Gonzalo's fix 
17172         here too.
17173
17174 2002-07-16  Gonzalo Paniagua Javier <gonzalo@ximian.com>
17175
17176         * expression.cs: fixed bug #27811.
17177
17178 2002-07-14  Miguel de Icaza  <miguel@ximian.com>
17179
17180         * expression.cs (ParameterReference.AddressOf): Patch from Paolo
17181         Molaro: when we are a ref, the value already contains a pointer
17182         value, do not take the address of it.
17183
17184 2002-07-14 Rafael Teixeira <rafaelteixeirabr@hotmail.com>
17185         * removed mb-parser.jay and mb-tokenizer.cs
17186
17187 Sat Jul 13 19:38:03 CEST 2002 Paolo Molaro <lupus@ximian.com>
17188
17189         * expression.cs: check against the building corlib void type.
17190
17191 Sat Jul 13 19:35:58 CEST 2002 Paolo Molaro <lupus@ximian.com>
17192
17193         * ecore.cs: fix for valuetype static readonly fields: when 
17194         initializing them, we need their address, not the address of a copy.
17195
17196 Sat Jul 13 17:32:53 CEST 2002 Paolo Molaro <lupus@ximian.com>
17197
17198         * typemanager.cs: register also enum_type in corlib.
17199
17200 Sat Jul 13 15:59:47 CEST 2002 Paolo Molaro <lupus@ximian.com>
17201
17202         * class.cs: allow calling this (but not base) initializers in structs.
17203
17204 Sat Jul 13 15:12:06 CEST 2002 Paolo Molaro <lupus@ximian.com>
17205
17206         * ecore.cs: make sure we compare against the building base types
17207         in GetTypeSize ().
17208
17209 Sat Jul 13 15:10:32 CEST 2002 Paolo Molaro <lupus@ximian.com>
17210
17211         * typemanager.cs: fix TypeToCoreType() to handle void and object
17212         (corlib gets no more typerefs after this change).
17213
17214 2002-07-12  Miguel de Icaza  <miguel@ximian.com>
17215
17216         * expression.cs (ArrayCreation.EmitArrayArguments): use
17217         Conv.Ovf.U4 for unsigned and Conv.Ovf.I4 for signed.
17218
17219         (ArrayAccess.LoadArrayAndArguments): Use Conv_Ovf_I and
17220         Conv_Ovf_I_Un for the array arguments.  Even if C# allows longs as
17221         array indexes, the runtime actually forbids them.
17222
17223         * ecore.cs (ExpressionToArrayArgument): Move the conversion code
17224         for array arguments here.
17225
17226         * expression.cs (EmitLoadOpcode): System.Char is a U2, use that
17227         instead of the default for ValueTypes.
17228
17229         (New.DoEmit): Use IsValueType instead of
17230         IsSubclassOf (value_type)
17231         (New.DoResolve): ditto.
17232         (Invocation.EmitCall): ditto.
17233
17234         * assign.cs (Assign): ditto.
17235
17236         * statement.cs (Unsafe): Ok, so I got the semantics wrong.
17237         Statements *are* currently doing part of their resolution during
17238         Emit.  
17239
17240         Expressions do always resolve during resolve, but statements are
17241         only required to propagate resolution to their children.
17242
17243 2002-07-11  Miguel de Icaza  <miguel@ximian.com>
17244
17245         * driver.cs (CSCParseOption): Finish the /r: and /lib: support.
17246
17247         (LoadAssembly): Do not add the dll if it is already specified
17248
17249         (MainDriver): Add the System directory to the link path at the end,
17250         after all the other -L arguments. 
17251
17252         * expression.cs (ArrayAccess.EmitLoadOpcode): I was using the
17253         wrong opcode for loading bytes and bools (ldelem.i1 instead of
17254         ldelem.u1) and using the opposite for sbytes.
17255
17256         This fixes Digger, and we can finally run it.
17257
17258         * driver.cs (UnixParseOption): Move the option parsing here.  
17259         (CSCParseOption): Implement CSC-like parsing of options.
17260
17261         We now support both modes of operation, the old Unix way, and the
17262         new CSC-like way.  This should help those who wanted to make cross
17263         platform makefiles.
17264
17265         The only thing broken is that /r:, /reference: and /lib: are not
17266         implemented, because I want to make those have the same semantics
17267         as the CSC compiler has, and kill once and for all the confussion
17268         around this.   Will be doing this tomorrow.
17269
17270         * statement.cs (Unsafe.Resolve): The state is checked during
17271         resolve, not emit, so we have to set the flags for IsUnsfe here.
17272
17273 2002-07-10  Miguel de Icaza  <miguel@ximian.com>
17274
17275         * expression.cs (MemberAccess.ResolveMemberAccess): Since we can
17276         not catch the Error_ObjectRefRequired in SimpleName (as it is
17277         possible to have a class/instance variable name that later gets
17278         deambiguated), we have to check this here.      
17279
17280 2002-07-10  Ravi Pratap  <ravi@ximian.com>
17281
17282         * class.cs (TypeContainer.GetFieldFromEvent): Move away from here,
17283         make static and put into Expression.
17284
17285         (Event.Define): Register the private field of the event with the 
17286         TypeManager so that GetFieldFromEvent can get at it.
17287
17288         (TypeManager.RegisterPrivateFieldOfEvent): Implement to
17289         keep track of the private field associated with an event which
17290         has no accessors.
17291
17292         (TypeManager.GetPrivateFieldOfEvent): Implement to get at the
17293         private field.
17294
17295         * ecore.cs (GetFieldFromEvent): RE-write to use the above methods.
17296
17297 2002-07-10  Miguel de Icaza  <miguel@ximian.com>
17298
17299         * expression.cs (Binary.EmitBranchable): this routine emits the
17300         Binary expression in a branchable context.  This basically means:
17301         we need to branch somewhere, not just get the value on the stack.
17302
17303         This works together with Statement.EmitBoolExpression.
17304
17305         * statement.cs (Statement.EmitBoolExpression): Use
17306         EmitBranchable. 
17307
17308 2002-07-09  Miguel de Icaza  <miguel@ximian.com>
17309
17310         * statement.cs (For): Reduce the number of jumps in loops.
17311
17312         (For): Implement loop inversion for the For statement.
17313
17314         (Break): We can be breaking out of a Try/Catch controlled section
17315         (foreach might have an implicit try/catch clause), so we need to
17316         use Leave instead of Br.
17317
17318         * ecore.cs (FieldExpr.AddressOf): Fix for test-139 (augmented
17319         now).  If the instace expression supports IMemoryLocation, we use
17320         the AddressOf method from the IMemoryLocation to extract the
17321         address instead of emitting the instance.
17322
17323         This showed up with `This', as we were emitting the instance
17324         always (Emit) instead of the Address of This.  Particularly
17325         interesting when This is a value type, as we dont want the Emit
17326         effect (which was to load the object).
17327
17328 2002-07-08  Miguel de Icaza  <miguel@ximian.com>
17329
17330         * attribute.cs: Pass the entry point to the DefinePInvokeMethod
17331
17332         * statement.cs (Checked): Set the CheckedState during the resolve
17333         process too, as the ConvCast operations track the checked state on
17334         the resolve process, and not emit.
17335
17336         * cs-parser.jay (namespace_member_declaration): Flag that we have
17337         found a declaration when we do.  This is used to flag error 1529
17338
17339         * driver.cs: Report ok when we display the help only.
17340
17341 2002-07-06  Andrew Birkett  <adb@tardis.ed.ac.uk>
17342
17343         * cs-tokenizer.cs (xtoken): Improve handling of string literals.
17344
17345 2002-07-04  Miguel de Icaza  <miguel@ximian.com>
17346
17347         * cs-tokenizer.cs (define): We also have to track locally the
17348         defines.  AllDefines is just used for the Conditional Attribute,
17349         but we also need the local defines for the current source code. 
17350
17351 2002-07-03  Miguel de Icaza  <miguel@ximian.com>
17352
17353         * statement.cs (While, For, Do): These loops can exit through a
17354         Break statement, use this information to tell whether the
17355         statement is the last piece of code.
17356
17357         (Break): Flag that we break.
17358
17359         * codegen.cs (EmitContexts): New `Breaks' state variable.
17360
17361 2002-07-03  Martin Baulig  <martin@gnome.org>
17362
17363         * class.cs (TypeContainer.MethodModifiersValid): Allow override
17364         modifiers in method declarations in structs.  Otherwise, you won't
17365         be able to override things like Object.Equals().
17366
17367 2002-07-02  Miguel de Icaza  <miguel@ximian.com>
17368
17369         * class.cs (Method, Property, Indexer): Do not allow the public
17370         modifier to be used in explicit interface implementations.
17371
17372         (TypeContainer.MethodModifiersValid): Catch virtual, abstract and
17373         override modifiers in method declarations in structs
17374
17375 2002-07-02   Andrew Birkett <adb@tardis.ed.ac.uk>
17376
17377         * cs-tokenizer.cs (adjust_int, adjust_real): Do not abort on
17378         integer or real overflow, report an error
17379
17380 2002-07-02  Martin Baulig  <martin@gnome.org>
17381
17382         * typemanager.cs (TypeManager.InitCoreTypes): When compiling
17383         corlib, dynamically call AssemblyBuilder.SetCorlibTypeBuilders()
17384         to tell the runtime about our newly created System.Object and
17385         System.ValueType types.
17386
17387 2002-07-02  Miguel de Icaza  <miguel@ximian.com>
17388
17389         * expression.cs (This): Use Stobj/Ldobj when we are a member of a
17390         struct instead of Ldarg/Starg.
17391
17392 2002-07-02  Martin Baulig  <martin@gnome.org>
17393
17394         * expression.cs (Indirection.Indirection): Call
17395         TypeManager.TypeToCoreType() on `expr.Type.GetElementType ()'.
17396
17397 2002-07-02  Martin Baulig  <martin@gnome.org>
17398
17399         * expression.cs (ArrayAccess.EmitStoreOpcode): If the type is a
17400         ValueType, call TypeManager.TypeToCoreType() on it.
17401         (Invocations.EmitParams): Call TypeManager.TypeToCoreType() on
17402         the OpCodes.Newarr argument.
17403
17404 2002-07-02  Martin Baulig  <martin@gnome.org>
17405
17406         * expression.cs (Invocation.EmitCall): When compiling corlib,
17407         replace all calls to the system's System.Array type to calls to
17408         the newly created one.
17409
17410         * typemanager.cs (TypeManager.InitCodeHelpers): Added a few more
17411         System.Array methods.
17412         (TypeManager.InitCoreTypes): When compiling corlib, get the methods
17413         from the system's System.Array type which must be replaced.
17414
17415 Tue Jul 2 19:05:05 CEST 2002 Paolo Molaro <lupus@ximian.com>
17416
17417         * typemanager.cs: load unverifiable_code_ctor so we can build
17418         corlib using the correct type. Avoid using GetTypeCode() with
17419         TypeBuilders.
17420         * rootcontext.cs: uses TypeManager.unverifiable_code_ctor and
17421         TypeManager.object_type to allow building corlib.
17422
17423 Tue Jul 2 19:03:19 CEST 2002 Paolo Molaro <lupus@ximian.com>
17424
17425         * ecore.cs: handle System.Enum separately in LoadFromPtr().
17426
17427 2002-07-01  Martin Baulig  <martin@gnome.org>
17428
17429         * class.cs: Make the last change actually work, we need to check
17430         whether `ifaces != null' to avoid a crash.
17431
17432 Mon Jul 1 16:15:03 CEST 2002 Paolo Molaro <lupus@ximian.com>
17433
17434         * class.cs: when we build structs without fields that implement
17435         interfaces, we need to add the interfaces separately, since there is
17436         no API to both set the size and add the interfaces at type creation
17437         time.
17438
17439 Mon Jul 1 14:50:47 CEST 2002 Paolo Molaro <lupus@ximian.com>
17440
17441         * expression.cs: the dimension arguments to the array constructors
17442         need to be converted if they are a long.
17443
17444 Mon Jul 1 12:26:12 CEST 2002 Paolo Molaro <lupus@ximian.com>
17445
17446         * class.cs: don't emit ldarg.0 if there is no parent constructor
17447         (fixes showstopper for corlib).
17448
17449 2002-06-29  Martin Baulig  <martin@gnome.org>
17450
17451         MCS now compiles corlib on GNU/Linux :-)
17452
17453         * attribute.cs (Attribute.ApplyAttributes): Treat Accessors like Method,
17454         ie. check for MethodImplOptions.InternalCall.
17455
17456         * class.cs (TypeContainer.DefineType): When compiling corlib, both parent
17457         and TypeManager.attribute_type are null, so we must explicitly check
17458         whether parent is not null to find out whether it's an attribute type.
17459         (Property.Emit): Always call Attribute.ApplyAttributes() on the GetBuilder
17460         and SetBuilder, not only if the property is neither abstract nor external.
17461         This is necessary to set the MethodImplOptions on the accessor methods.
17462         (Indexer.Emit): Call Attribute.ApplyAttributes() on the GetBuilder and
17463         SetBuilder, see Property.Emit().
17464
17465         * rootcontext.cs (RootContext.PopulateTypes): When compiling corlib, don't
17466         populate "System.Object", "System.ValueType" and "System.Attribute" since
17467         they've already been populated from BootCorlib_PopulateCoreTypes().
17468
17469 2002-06-29  Martin Baulig  <martin@gnome.org>
17470
17471         * ecore.cs (Expression.ImplicitReferenceConversionExists): If expr
17472         is the NullLiteral, we also need to make sure that target_type is not
17473         an enum type.   
17474
17475 2002-06-29  Martin Baulig  <martin@gnome.org>
17476
17477         * rootcontext.cs (RootContext.ResolveCore): We must initialize
17478         `TypeManager.multicast_delegate_type' and `TypeManager.delegate_type'
17479         before calling BootstrapCorlib_ResolveDelegate ().
17480
17481 2002-06-27  Gonzalo Paniagua Javier <gonzalo@ximian.com>
17482
17483         * statement.cs: fixed build-breaker. All tests passed ok.
17484
17485 2002-06-27  Martin Baulig  <martin@gnome.org>
17486
17487         * typemanager.cs (TypeManager.VerifyUnManaged): Added explicit check
17488         for System.Decimal when compiling corlib.
17489
17490 2002-06-27  Martin Baulig  <martin@gnome.org>
17491
17492         * statement.cs (Switch.TableSwitchEmit): Make this work with empty
17493         switch blocks which contain nothing but a default clause.
17494
17495 2002-06-26  Andrew  <adb@tardis.ed.ac.uk>
17496
17497        * ../errors/cs1501-3.cs: Added new test for struct ctr typechecks.
17498
17499 2002-06-27  Martin Baulig  <martin@gnome.org>
17500
17501         * ecore.cs (PropertyExpr.PropertyExpr): Call
17502         TypeManager.TypeToCoreType() on the `pi.PropertyType'.
17503
17504         * typemanager.cs (TypeManager.TypeToCoreType): Return if the type
17505         is already a TypeBuilder.
17506
17507 2002-06-27  Martin Baulig  <martin@gnome.org>
17508
17509         * ecore.cs (Expression.ImplicitReferenceConversionExists): Use
17510         `target_type == TypeManager.array_type', not IsAssignableFrom() in
17511         the "from an array-type to System.Array" case.  This makes it work
17512         when compiling corlib.
17513
17514 2002-06-27  Martin Baulig  <martin@gnome.org>
17515
17516         * ecore.cs (Expression.SimpleNameResolve): If the expression is a
17517         non-static PropertyExpr, set its InstanceExpression.  This makes
17518         the `ICollection.Count' property work in System/Array.cs.
17519
17520 2002-06-25  Andrew Birkett  <adb@tardis.ed.ac.uk>
17521
17522         * driver.cs: Made error handling more consistent.  Errors now
17523         tracked by Report class, so many methods which used to return int
17524         now return void.  Main() now prints success/failure and 
17525         errors/warnings message.
17526
17527         Renamed '--probe' compiler argument to '--expect-error'.  Removed
17528         the magic number return values (123 and 124).  Now, if the
17529         expected error occurs, the compiler exits with success (exit value
17530         0).  If the compilation completes without seeing that particular
17531         error, the compiler exits with failure (exit value 1).  The
17532         makefile in mcs/errors has been changed to handle the new behaviour.
17533
17534         * report.cs: Made 'expected error' number a property and renamed
17535         it from 'Probe' to 'ExpectedError'.
17536
17537         * genericparser.cs: Removed error handling support, since it is
17538         now all done by Report class.
17539
17540         * cs-parser.jay, mb-parser.jay: Errors are tracked by Report
17541         class, so parse() no longer returns an int.
17542
17543         * namespace.cs: Use Report.Error instead of GenericParser.error
17544
17545 2002-06-22  Miguel de Icaza  <miguel@ximian.com>
17546
17547         * class.cs (TypeContainer.AddMethod, TypeContainer.AddIndexer,
17548         TypeContainer.AddOperator): At the front of the list put the
17549         explicit implementations, so they get resolved/defined first. 
17550
17551 2002-06-21  Miguel de Icaza  <miguel@ximian.com>
17552
17553         * class.cs (TypeContainer.VerifyImplements): Verifies that a given
17554         interface type is implemented by this TypeContainer.  Used during
17555         explicit interface implementation.
17556
17557         (Property.Define, Indexer.Define, Method.Define): Validate that
17558         the given interface in the explicit implementation is one of the
17559         base classes for the containing type.
17560
17561         Also if we are explicitly implementing an interface, but there is
17562         no match in the pending implementation table, report an error.
17563
17564         (Property.Define): Only define the property if we are
17565         not explicitly implementing a property from an interface.  Use the
17566         correct name also for those properties (the same CSC uses,
17567         although that is really not needed).
17568
17569         (Property.Emit): Do not emit attributes for explicitly implemented
17570         properties, as there is no TypeBuilder.
17571
17572         (Indexer.Emit): ditto.
17573
17574         Hiding then means that we do not really *implement* a pending
17575         implementation, which makes code fail.
17576
17577 2002-06-22  Martin Baulig  <martin@gnome.org>
17578
17579         * ecore.cs (Expression.Constantify): Call TypeManager.TypeToCoreType() on
17580         the return value of Object.GetType().  [FIXME: we need to do this whenever
17581         we get a type back from the reflection library].
17582
17583 Fri Jun 21 13:37:57 CEST 2002 Paolo Molaro <lupus@ximian.com>
17584
17585         * typemanager.cs: make ExpandInterfaces() slip duplicated interfaces.
17586
17587 2002-06-20  Miguel de Icaza  <miguel@ximian.com>
17588
17589         * attribute.cs: Return null if we can not look up the type.
17590
17591         * class.cs (TypeContainer.GetClassBases): Use ExpandInterfaces on
17592         the interface types found.
17593
17594         * interface.cs (Interface.GetInterfaceBases): Use ExpandInterfaces on the
17595         interface types found.
17596
17597         * typemanager.cs (GetInterfaces): Make this routine returns alll
17598         the interfaces and work around the lame differences between
17599         System.Type and System.Reflection.Emit.TypeBuilder in the results
17600         result for GetInterfaces.
17601
17602         (ExpandInterfaces): Given an array of interface types, expand and
17603         eliminate repeated ocurrences of an interface.  This expands in
17604         context like: IA; IB : IA; IC : IA, IB; the interface "IC" to
17605         be IA, IB, IC.
17606
17607 2002-06-21  Martin Baulig  <martin@gnome.org>
17608
17609         * typemanager.cs (TypeManager.EnumToUnderlying): It's now safe to call this function
17610         on System.Enum.
17611
17612 2002-06-21  Martin Baulig  <martin@gnome.org>
17613
17614         * typemanager.cs (TypeManager.TypeToCoreType): New function.  When compiling corlib
17615         and called with one of the core types, return the corresponding typebuilder for
17616         that type.
17617
17618         * expression.cs (ArrayAccess.DoResolve): Call TypeManager.TypeToCoreType() on the
17619         element type.
17620
17621 2002-06-21  Martin Baulig  <martin@gnome.org>
17622
17623         * ecore.cs (Expression.ExplicitReferenceConversionExists): Use
17624         `target_type.IsArray' instead of `target_type.IsSubclassOf (TypeManager.array_type)'.
17625         (Expression.ConvertReferenceExplicit): Likewise.
17626
17627         * expression.cs (ElementAccess.DoResolve): Likewise.
17628         (ElementAccess.DoResolveLValue): Likewise.
17629
17630 2002-06-10  Martin Baulig  <martin@gnome.org>
17631
17632         * interface.cs (Interface.PopulateIndexer): When creating the setter, we need to
17633         add the "value" parameter to the parameter list.
17634
17635         * statement.cs (Fixed.Emit): Pass the return value of the child block's Emit()
17636         to our caller.
17637
17638 2002-06-19  Miguel de Icaza  <miguel@ximian.com>
17639
17640         * expression.cs (ArrayCreation.ExpressionToArrayArgument): Convert
17641         the argument to an int, uint, long or ulong, per the spec.  Also
17642         catch negative constants in array creation.
17643
17644 Thu Jun 20 17:56:48 CEST 2002 Paolo Molaro <lupus@ximian.com>
17645
17646         * class.cs: do not allow the same interface to appear twice in
17647         the definition list.
17648
17649 Wed Jun 19 22:33:37 CEST 2002 Paolo Molaro <lupus@ximian.com>
17650
17651         * ecore.cs: don't use ldlen with System.Array.
17652
17653 Wed Jun 19 20:57:40 CEST 2002 Paolo Molaro <lupus@ximian.com>
17654
17655         * ecore.cs: stobj requires a type argument. Handle indirect stores on enums.
17656
17657 Wed Jun 19 20:17:59 CEST 2002 Paolo Molaro <lupus@ximian.com>
17658
17659         * modifiers.cs: produce correct field attributes for protected
17660         internal. Easy fix so miguel can work on ther harder stuff:-)
17661
17662 2002-06-18  Miguel de Icaza  <miguel@ximian.com>
17663
17664         * pending.cs: New file.  Move the code from class.cs here.
17665         Support clearning the pending flag for all methods (when not doing
17666         explicit interface implementation).
17667
17668 Tue Jun 18 10:36:22 CEST 2002 Paolo Molaro <lupus@ximian.com>
17669
17670         * rootcontext.cs: added a couple more types needed to bootstrap.
17671
17672 2002-06-17  Miguel de Icaza  <miguel@ximian.com>
17673
17674         * typemanager.cs (GetConstructor): Use DeclaredOnly to look the
17675         constructor in the type, instead of any constructor in the type
17676         hierarchy.  Thanks to Paolo for finding this bug (it showed up as
17677         a bug in the Mono runtime when applying the params attribute). 
17678
17679 2002-06-16  Rafael Teixeira  <rafaelteixeirabr@hotmail.com>
17680         * changed namespace.cs to use "GenericParser.error(...)" instead of "CSharpParser.error(...)"
17681
17682 2002-06-14  Rachel Hestilow  <hestilow@ximian.com>
17683
17684         * expression.cs (Unary.ResolveOperator): Use TypeManager
17685         to resolve the type.
17686
17687 2002-06-13  Ravi Pratap  <ravi@ximian.com>
17688
17689         * cs-parser.jay (enum_member_declaration): Pass in the attributes
17690         attached.
17691
17692         * enum.cs (AddEnumMember): Add support to store the attributes associated 
17693         with each member too.
17694
17695         * attribute.cs (CheckAttribute, ApplyAttributes): Update to handle
17696         field builders too - this takes care of the enum member case.
17697
17698 2002-06-10  Rachel Hestilow  <hestilow@ximian.com>
17699
17700         * typemanager.cs (TypeManager.VerifyUnManaged): Allow
17701         address-of operator on both value types and pointers.
17702
17703 2002-06-10  Martin Baulig  <martin@gnome.org>
17704
17705         * interface.cs (Interface.PopulateIndexer): Add the indexer's
17706         PropertyBuilder to the `property_builders' list.
17707
17708         * expression.cs (Indexers.GetIndexersForTypeOrInterface): New private method.
17709         (Indexers.GetIndexersForType): Call GetIndexersForTypeOrInterface() on the
17710         `lookup_type' and all its interfaces.  Unfortunately, Type.FindMembers() won't
17711         find any indexers which are inherited from an interface.
17712
17713 2002-06-09  Martin Baulig  <martin@gnome.org>
17714
17715         * const.cs (Const.LookupConstantValue): Convert `Expr' to a literal of
17716         the same type as the constant if necessary.  There's also a test-130.cs
17717         for this.
17718
17719         * enum.cs (Enum.ChangeEnumType): Moved to typemanager.cs and made public.
17720
17721         * typemanager.cs (TypeManager.ChangeType): Previously known as
17722         Enum.ChangeEnumType().
17723
17724 2002-06-09  Martin Baulig  <martin@gnome.org>
17725
17726         * expression.cs (Cast.TryReduce): Added support for consts.
17727
17728 2002-06-08  Ravi Pratap  <ravi@ximian.com>
17729
17730         * class.cs (Accessor): Hold attributes information so we can pass
17731         it along.
17732
17733         * cs-parser.jay (get_accessor_declaration, set_accessor_declaration):
17734         Modify to pass in attributes attached to the methods.
17735
17736         (add_accessor_declaration, remove_accessor_declaration): Ditto.
17737
17738         * attribute.cs (ApplyAttributes, CheckAttribute): Update accordingly
17739         to handle the Accessor kind :-)
17740
17741         * class.cs (Property.Emit, Event.Emit): Apply attributes to the accessors
17742
17743 2002-06-08  Martin Baulig  <martin@gnome.org>
17744
17745         * expression.cs (Unary.TryReduceNegative): Added support for
17746         ULongConstants.
17747
17748 2002-06-08  Martin Baulig  <martin@gnome.org>
17749
17750         * enum.cs (Enum.LookupEnumValue): Don't report an error if the
17751         name can't be found in the `defined_names' - the caller will do a
17752         MemberLookup in this case and thus find methods in System.Enum
17753         such as Enum.IsDefined().
17754
17755 2002-06-08  Martin Baulig  <martin@gnome.org>
17756
17757         * enum.cs (Enum.ChangeEnumType): This is a custom version of
17758         Convert.ChangeType() which works with TypeBuilder created types.
17759         (Enum.LookupEnumValue, Enum.Define): Use it here.
17760
17761         * class.cs (TypeContainer.RegisterRequiredImplementations): Added
17762         `TypeBuilder.BaseType != null' check.
17763         (TypeContainer.FindMembers): Only lookup parent members if we
17764         actually have a parent.
17765         (Method.EmitDestructor): Added `ec.ContainerType.BaseType != null' check.
17766         (ConstructorInitializer.Resolve): Likewise.
17767
17768         * interface.cs (Interface.FindMembers): Added
17769         `TypeBuilder.BaseType != null' check.
17770
17771         * rootcontext.cs (RootContext.ResolveCore): Added
17772         "System.Runtime.CompilerServices.IndexerNameAttribute" to
17773         classes_second_stage.
17774
17775         * typemanager.cs (TypeManager.InitCoreTypes): Don't initialize
17776         debug_type and trace_type when compiling with --nostdlib.       
17777
17778 2002-06-07  Martin Baulig  <martin@gnome.org>
17779
17780         * class.cs (TypeContainer): Added `have_nonstatic_fields' field.
17781         (AddField): Set it to true when adding a non-static field.
17782         (DefineType): Use `have_nonstatic_fields' to find out whether we
17783         have non-static fields, not `Fields != null'.
17784
17785 2002-06-02  Miguel de Icaza  <miguel@ximian.com>
17786
17787         * ecore.cs (SimpleNameResolve): Removed simple bug (we were
17788         dereferencing a null on the static-field code path)
17789
17790 2002-05-30  Martin Baulig  <martin@gnome.org>
17791
17792         * codegen.cs (InitMonoSymbolWriter): Added `string[] args' argument
17793         to take command line arguments.  Use reflection to call the new
17794         custom `Initialize' function on the symbol writer and pass it the
17795         command line arguments.
17796
17797         * driver.cs (--debug-args): New command line argument to pass command
17798         line arguments to the symbol writer.
17799
17800 2002-05-28  Miguel de Icaza  <miguel@ximian.com>
17801
17802         * assign.cs (DoResolve): Forgot to do the implicit conversion to
17803         the target type for indexers and properties.  Thanks to Joe for
17804         catching this.
17805
17806 2002-05-27  Miguel de Icaza  <miguel@ximian.com>
17807
17808         * typemanager.cs (MethodFlags): returns the method flags
17809         (Obsolete/ShouldIgnore) that control warning emission and whether
17810         the invocation should be made, or ignored. 
17811
17812         * expression.cs (Invocation.Emit): Remove previous hack, we should
17813         not do this on matching a base type, we should do this based on an attribute
17814
17815         Only emit calls to System.Diagnostics.Debug and
17816         System.Diagnostics.Trace if the TRACE and DEBUG defines are passed
17817         on the command line.
17818
17819         * rootcontext.cs: Global settings for tracing and debugging.
17820
17821         * cs-tokenizer.cs (define): New utility function to track
17822         defines.   Set the global settings for TRACE and DEBUG if found.
17823
17824 2002-05-25  Ravi Pratap  <ravi@ximian.com>
17825
17826         * interface.cs (Populate*): Pass in the TypeContainer as well as
17827         the DeclSpace as parameters so that we can create EmitContexts and
17828         then use that to apply attributes etc.
17829
17830         (PopulateMethod, PopulateEvent, PopulateProperty)
17831         (PopulateIndexer): Apply attributes everywhere.
17832
17833         * attribute.cs (CheckAttribute): Include InterfaceMethod, InterfaceEvent
17834         etc.
17835
17836         (ApplyAttributes): Update accordingly.
17837
17838         We now apply interface attributes for all members too.
17839
17840 2002-05-26  Miguel de Icaza  <miguel@ximian.com>
17841
17842         * class.cs (Indexer.Define); Correctly check if we are explicit
17843         implementation (instead of checking the Name for a ".", we
17844         directly look up if the InterfaceType was specified).
17845
17846         Delay the creation of the PropertyBuilder.
17847
17848         Only create the PropertyBuilder if we are not an explicit
17849         interface implementation.   This means that explicit interface
17850         implementation members do not participate in regular function
17851         lookups, and hence fixes another major ambiguity problem in
17852         overload resolution (that was the visible effect).
17853
17854         (DefineMethod): Return whether we are doing an interface
17855         implementation. 
17856
17857         * typemanager.cs: Temporary hack until we get attributes in
17858         interfaces (Ravi is working on that) and we get IndexerName
17859         support in interfaces.
17860
17861         * interface.cs: Register the indexers as properties.
17862
17863         * attribute.cs (Attribute.Resolve): Catch the error, and emit a
17864         warning, I have verified that this is a bug in the .NET runtime
17865         (JavaScript suffers of the same problem).
17866
17867         * typemanager.cs (MemberLookup): When looking up members for
17868         interfaces, the parent of an interface is the implicit
17869         System.Object (so we succeed in searches of Object methods in an
17870         interface method invocation.  Example:  IEnumerable x;  x.ToString
17871         ()) 
17872
17873 2002-05-25  Miguel de Icaza  <miguel@ximian.com>
17874
17875         * class.cs (Event): Events should also register if they do
17876         implement the methods that an interface requires.
17877
17878         * typemanager.cs (MemberLookup); use the new GetInterfaces
17879         method. 
17880
17881         (GetInterfaces): The code used to lookup interfaces for a type is
17882         used in more than one place, factor it here. 
17883
17884         * driver.cs: Track the errors at the bottom of the file, we kept
17885         on going.
17886
17887         * delegate.cs (NewDelegate.Emit): We have to emit a null as the
17888         instance if the method we are calling is static!
17889
17890 2002-05-24  Miguel de Icaza  <miguel@ximian.com>
17891
17892         * attribute.cs (ApplyAttributes): Make this function filter out
17893         the IndexerName attribute (as that attribute in reality is never
17894         applied) and return the string constant for the IndexerName
17895         attribute. 
17896
17897         * class.cs (TypeContainer.Emit): Validate that all the indexers
17898         have the same IndexerName attribute, and if so, set the
17899         DefaultName attribute on the class. 
17900
17901         * typemanager.cs: The return value might contain other stuff (not
17902         only methods).  For instance, consider a method with an "Item"
17903         property and an Item method.
17904
17905         * class.cs: If there is a problem with the parameter types,
17906         return. 
17907
17908 2002-05-24  Ravi Pratap  <ravi@ximian.com>
17909
17910         * ecore.cs (ImplicitConversionExists): Wrapper function which also
17911         looks at user defined conversion after making a call to 
17912         StandardConversionExists - we need this for overload resolution.
17913
17914         * expression.cs : Update accordingly the various method calls.
17915
17916         This fixes 2 bugs filed against implicit user defined conversions 
17917
17918 2002-05-22  Miguel de Icaza  <miguel@ximian.com>
17919
17920         * statement.cs: Track the result of the assignment.
17921
17922 2002-05-21  Miguel de Icaza  <miguel@ximian.com>
17923
17924         * expression.cs (MemberAccess): Improved error reporting for
17925         inaccessible members.
17926
17927 2002-05-22  Martin Baulig  <martin@gnome.org>
17928
17929         * makefile (mcs-mono2.exe): New target.  This is mcs compiled with
17930         itself with debugging support.
17931
17932 2002-05-22  Martin Baulig  <martin@gnome.org>
17933
17934         * typemanager.cs ("System.Runtime.InteropServices.StructLayoutAttribute"):
17935         Removed, this isn't needed anymore.
17936
17937 2002-05-20  Martin Baulig  <martin@gnome.org>
17938
17939         * typemanager.cs (InitEnumUnderlyingTypes): "System.Char" can't
17940         be underlying type for an enum.
17941
17942 2002-05-20  Miguel de Icaza  <miguel@ximian.com>
17943
17944         * typemanager.cs (InitEnumUnderlyingTypes): New helper function
17945         that splits out the loading of just the core types.
17946
17947         * rootcontext.cs (ResolveCore): Split the struct resolution in
17948         two, so we can load the enumeration underlying types before any
17949         enums are used.
17950
17951         * expression.cs (Is): Bandaid until we fix properly Switch (see
17952         bug #24985 for details).
17953
17954         * typemanager.cs (ImplementsInterface): The hashtable will contain
17955         a null if there are no interfaces implemented.
17956
17957 2002-05-18  Miguel de Icaza  <miguel@ximian.com>
17958
17959         * cs-parser.jay (indexer_declarator): It is fine to have array
17960         parameters
17961
17962 2002-05-17  Miguel de Icaza  <miguel@ximian.com>
17963
17964         * typemanager.cs: (RegisterBuilder): New function used to register
17965         TypeBuilders that implement interfaces.  Since
17966         TypeBuilder.GetInterfaces (as usual) does not work with lame
17967         Reflection.Emit. 
17968         (AddUserType): register interfaces.
17969
17970         (ImplementsInterface): Use the builder_to_ifaces hash if we are
17971         dealing with TypeBuilder.  Also, arrays are showing up as
17972         SymbolTypes, which are not TypeBuilders, but whose GetInterfaces
17973         methods can not be invoked on them!
17974
17975         * ecore.cs (ExplicitReferenceConversionExists): Made public.
17976         (ImplicitReferenceConversionExists): Split out from
17977         StandardConversionExists. 
17978
17979         * expression.cs (As): We were only implementing one of the three
17980         cases for the as operator.  We now implement them all.
17981         (Is): Implement the various other cases for Is as well.
17982
17983         * typemanager.cs (CACHE): New define used to control if we want or
17984         not the FindMembers cache.  Seems to have a negative impact on
17985         performance currently
17986
17987         (MemberLookup): Nested types have full acess to
17988         enclosing type members
17989
17990         Remove code that coped with instance/static returns for events, we
17991         now catch this in RealFindMembers.
17992
17993         (RealFindMembers): only perform static lookup if the instance
17994         lookup did not return a type or an event.  
17995
17996 2002-05-17  Miguel de Icaza  <miguel@ximian.com>
17997
17998         * assign.cs (CompoundAssign): We pass more semantic information
17999         now to Compound Assignments than we did before: now we have all
18000         the information at hand, and now we resolve the target *before* we
18001         do the expression expansion, which allows the "CacheValue" method
18002         to have the effect we intended (before, a [x] += 1 would generate
18003         two differen ArrayAccess expressions from the ElementAccess,
18004         during the resolution process).
18005
18006         (CompoundAssign.DoResolve): Resolve target and original_source here.
18007
18008 2002-05-16  Miguel de Icaza  <miguel@ximian.com>
18009
18010         * expression.cs (ArrayAccess): dropped debugging information. 
18011
18012         * typemanager.cs: Small bug fix: I was always returning i_members,
18013         instead of one of i_members or s_members (depending on which had
18014         the content).
18015
18016         * assign.cs (IAssignMethod.CacheTemporaries): New method.  This
18017         method is invoked before any code generation takes place, and it
18018         is a mechanism to inform that the expression will be invoked more
18019         than once, and that the method should use temporary values to
18020         avoid having side effects
18021
18022         (Assign.Emit): Call CacheTemporaries in the IAssignMethod.
18023
18024         * ecore.cs (Expression.CacheTemporaries): Provide empty default
18025         implementation.
18026
18027         * expression.cs (Indirection, ArrayAccess): Add support for
18028         CacheTemporaries in these two bad boys. 
18029
18030         * ecore.cs (LoadFromPtr): figure out on our own if we need to use
18031         ldobj or ldind_ref.  
18032         (StoreFromPtr): Handle stobj as well.
18033
18034         * expression.cs (UnaryMutator): Share more code.
18035
18036         * typemanager.cs (FindMembers): Thanks to Paolo for tracking this
18037         down: I was not tracking the Filter function as well, which
18038         was affecting the results of the cache.
18039
18040 2002-05-15  Miguel de Icaza  <miguel@ximian.com>
18041
18042         * attribute.cs: Remove the hack to handle the CharSet property on
18043         StructLayouts. 
18044
18045 2002-05-14  Miguel de Icaza  <miguel@ximian.com>
18046
18047         * attribute.cs (DoResolve): More uglyness, we now only try to
18048         resolve the attribute partially, to extract the CharSet
18049         information (only if we are a StructLayout attribute).  Otherwise 
18050
18051         (GetExtraTypeInfo): Add some code to conditionally kill in the
18052         future this.   I am more and more convinced that the .NET
18053         framework has special code to handle the attribute setting on
18054         certain elements.
18055
18056         * expression.cs (IsParamsMethodApplicable): Revert my previous
18057         foreach change here, it was wrong.
18058
18059 2002-05-13  Miguel de Icaza  <miguel@ximian.com>
18060
18061         * cs-tokenizer.cs: (pp_primary): Eat the ')' at the end.
18062         (pp_expr): do not abort on unknown input, just return.
18063         (eval): abort if there are pending chars.
18064
18065         * attribute.cs (Attribute.Resolve): Positional parameters are
18066         optional.  Deal with that case.
18067
18068         * class.cs (DefineType): Call Attribute.GetExtraTypeInfo to fetch
18069         the Ansi/Unicode/Auto information for the type.
18070
18071         (TypeContainer.DefineType): instantiate the EmitContext here, as
18072         we will be using it during the type definition (to resolve
18073         attributes) and during the emit phase.
18074
18075         * attribute.cs (Attribute.GetExtraTypeInfo): This routine is used
18076         to pull type information out of the attributes
18077
18078         (Attribute.Resolve): track the constructor builder, and allow for
18079         multiple invocations (structs and classes will use this).
18080
18081         * ecore.cs (MemberLookupFinal): new version with all the
18082         parameters customizable.
18083
18084         * expression.cs (New.DoResolve): Use MemberLookupFinal to locate
18085         constructors.  Return if the result value is null (as the error
18086         would have been flagged already by MemberLookupFinal)
18087
18088         Do not allow instances of abstract classes or interfaces to be
18089         created.
18090
18091         * class.cs: (MethodSignature.InheritableMemberSignatureCompare):
18092         We have to compare the assembly property here when dealing with
18093         FamANDAssem and Assembly access modifiers, because we might be
18094         creating an assembly from *modules* (that means that we are not
18095         getting TypeBuilders for types defined in other modules that are
18096         part of this assembly).
18097
18098         (Method.Emit): If the method is marked abstract and has a body,
18099         emit an error. 
18100
18101         (TypeContainer.DefineMembers): If both the defined member and the
18102         parent name match are methods, then do not emit any warnings: let
18103         the Method.Define routine take care of flagging warnings.  But if
18104         there is a mismatch (method overrides something else, or method is
18105         overriwritten by something, then emit warning).
18106
18107         (MethodSignature.MemberSignatureCompare): If the sig.ret_type is
18108         set to null, this means `do not check for the return type on the
18109         signature'. 
18110
18111         (Method.Define): set the return type for the method signature to
18112         null, so that we get methods with the same name and parameters and
18113         different return types.  This is used to flag warning 114 (you are
18114         hiding a method, and you probably want to use the new/override
18115         keywords instead).
18116
18117         * typemanager.cs (MemberLookup): Implemented proper access
18118         control, closing a long standing set of bug reports.  The problem
18119         was that the Framework only has two bits: Public and NonPublic,
18120         and NonPublic includes private and protected methods, but we need
18121         to enforce the FamANDAssem, FamOrAssem and Family. 
18122
18123 2002-05-11  Miguel de Icaza  <miguel@ximian.com>
18124
18125         * statement.cs (GotoCase): Return true: Ammounts to giving up
18126         knowledge on whether we return or not, and letting the other case
18127         be responsible for it.
18128
18129 2002-05-10  Miguel de Icaza  <miguel@ximian.com>
18130
18131         * driver.cs: Do not load directories for each file processed, only
18132         do it if there is a pattern.
18133
18134         * ecore.cs: Report readonly assigns here as well, as we might have
18135         been resolved only by MemberAccess.
18136
18137         (SimpleName.SimpleNameResolve): Also be useful for LValue
18138         resolution.   We need this to propagate assign to local readonly variables
18139
18140         * typemanager.cs: Use a ptrhashtable for the criteria, because we
18141         do not want to reuse potential criteria memory.
18142
18143         * class.cs (MyEventBuilder): Set reflected_type;
18144
18145         * ecore.cs (Constantify): Added support for constifying bools.
18146
18147         (RootContext.LookupType): Added a cache for values looked up in
18148         the declaration space.
18149
18150         * typemanager.cs (FindMembers): Now is a front-end to
18151         RealFindMembers, and provides a two-level hashtable-based cache to
18152         the request.  
18153
18154         15% performance improvement: from 22.5 to 19.2 seconds.
18155
18156         * expression.cs (IsParamsMethodApplicable): use foreach.
18157         (Invocation.DoResolve): ditto.
18158         (New.DoResolve): ditto.
18159         (ArrayCreation.DoResolve): ditto.
18160
18161         * ecore.cs (FindMostEncompassingType): use foreach.
18162
18163         * delegate.cs (NewDelegate.DoResolve): Use foreach
18164
18165         * ecore.cs (Expression.FindMostSpecificSource): Use foreach.
18166         (RemoveMethods): use foreach.
18167
18168         * expression.cs (Invocation.MakeUnionSet): Optimization: Use two
18169         nested foreach statements instead of for, and also break out of
18170         the inner loop once a match is found.
18171
18172         (Invocation.OverloadResolve): Use foreach, simplify the code. 
18173
18174 2002-05-08  Miguel de Icaza  <miguel@ximian.com>
18175
18176         * cfold.cs (BinaryFold): During an enumeration evaluation context,
18177         we actually unwrap the expression to allow for extra information
18178         to be extracted. 
18179
18180         * expression.cs: Use Shr_Un on unsigned operations. 
18181
18182 2002-05-08  Ravi Pratap  <ravi@ximian.com>
18183
18184         * ecore.cs (FindMostEncompass*): Fix trivial bug where the set of 
18185         applicable operators was not being considered correctly. This closes
18186         the bug Miguel reported.
18187
18188 Wed May 8 16:40:50 CEST 2002 Paolo Molaro <lupus@ximian.com>
18189
18190         * attribute.cs: check that the type derives from System.Attribute
18191         and report the correct error in that case (moved the duplicate code to
18192         its own method, too).
18193
18194 Wed May 8 11:50:31 CEST 2002 Paolo Molaro <lupus@ximian.com>
18195
18196         * attribute.cs: lookup attribute type name as the spec says: first the
18197         bare attribute name and then name + "Attribute" (nant compiles with
18198         mcs after this fix).
18199
18200 2002-05-07  Miguel de Icaza  <miguel@ximian.com>
18201
18202         * expression.cs (Unary.TryReduceNegative): Ah!  Tricky!  Tricky!
18203         Because of the way we parse things, we should try to see if a
18204         UIntConstant can fit in an integer.
18205
18206 2002-05-07  Ravi Pratap  <ravi@ximian.com>
18207
18208         * ecore.cs (GetConversionOperators): Do not pick up op_True operators
18209         when we are in an explicit context.
18210
18211         (ConvertReferenceExplicit): When converting from Iface type S to Class
18212         T make sure the rules are implemented as an OR.
18213
18214         * parameter.cs (ParameterType): Make it a property for now although the
18215         purpose really isn't anything immediate.
18216
18217         * expression.cs (Is*Applicable): Do better checking on the parameter type
18218         of a ref/out parameter. The ones from the system assemblies are already 
18219         marked with the correct type so we don't need to do any correction.
18220
18221         * ecore.cs (StandardConversionExists): Conversion from Interface types to 
18222         the object type is standard too so include that.
18223
18224 2002-05-06  Miguel de Icaza  <miguel@ximian.com>
18225
18226         * ecore.cs (StandardConversionExists): Augment with missing code:
18227         deal with IntConstant, LongConstants and Enumerations.
18228
18229         * assign.cs: Report the error, instead of failing silently
18230
18231         * rootcontext.cs (AddGlobalAttributes): Track attributes on the
18232         typecontainer that they are declared, because the
18233         typecontainer/namespace will have the list of using clauses that
18234         need to be applied.
18235
18236         Assembly Attributes were escaping the normal registration
18237         mechanism. 
18238
18239         (EmitCode): Apply attributes within an EmitContext that represents
18240         the container they were declared on.
18241
18242         * cs-parser.jay: Track bases for structs.  How did I get this wrong?
18243
18244 2002-05-06  Ravi Pratap  <ravi@ximian.com>
18245
18246         * ecore.cs (FindMostEncompassingType, FindMostEncompassedType):
18247         Revamp completely - make much cleaner as we now operate only
18248         on a set of Types.
18249
18250         (FindMostSpecificSource, FindMostSpecificTarget): New methods
18251         to implement the logic detailed in the spec more correctly.
18252
18253         (UserDefinedConversion): Update accordingly.
18254
18255 2002-05-06  Miguel de Icaza  <miguel@ximian.com>
18256
18257         * statement.cs: Return flow analysis information up.
18258
18259         * cs-tokenizer.cs (adjust_real): Share code between LITERAL_DOUBLE
18260         and the default.
18261
18262         (token): Do not consume an extra character before calling
18263         decimal_digits.
18264
18265 2002-05-06  Piers Haken <piersh@friskit.com>
18266
18267         * cs-parser.jay: add 'override' attribute to System.Object.Finalize
18268
18269 2002-05-06  Miguel de Icaza  <miguel@ximian.com>
18270
18271         * class.cs (Constructor.Emit): Set the IsStatic flag in the
18272         EmitContext during the instance constructor initializer
18273         resolution, to stop access to instance variables.
18274
18275         This is mandated by the spec, last paragraph of the `constructor
18276         initializers' section. 
18277
18278 2002-05-05  Miguel de Icaza  <miguel@ximian.com>
18279
18280         * cs-parser.jay, class.cs (Accessor): new class used to represent
18281         an accessor (get or set).  In the past we used `null' to represent
18282         a missing accessor.  But this is ambiguous because there was no
18283         way to tell in abstract indexers/properties if one of them was
18284         specified.
18285
18286         Now there is a way of addressing that.
18287
18288         * expression.cs (Indexers.GetIndexersForType): Use TypeManager.MemberLookup
18289         instead of FindMembers.
18290
18291         * class.cs (TypeContainer.EmitFieldInitializer): Do not typecast
18292         the result of Assign.Resolve as Assign, but rather as ExpressionStatement.
18293
18294         * attribute.cs: Treat indexers and properties as the same in terms
18295         of applying attributes
18296
18297         * ecore.cs (FindMostEncompassedType): Use statically initialized
18298         EmptyExpressions()s like we do elsewhere to avoid creating useless
18299         objects (and we take this out of the tight loop).
18300
18301         (GetConversionOperators): Move the code to extract the actual
18302         operators to a separate routine to clean things up.
18303
18304 2002-05-04  Miguel de Icaza  <miguel@ximian.com>
18305
18306         * ecore.cs (FieldExpr): Remove un-needed tests for null, since now
18307         events are always registered FieldBuilders.
18308
18309         * class.cs (FieldBase): New class shared by Fields 
18310
18311         * delegate.cs: If we are a toplevel delegate, use our full name.
18312         If we are a nested delegate, then only use our tail name.
18313
18314 2002-05-02  Ravi Pratap  <ravi@ximian.com>
18315
18316         * expression.cs (IsApplicable): Ensure that we add the "&" to
18317         ref/out types before comparing it with the type of the argument.
18318
18319         (IsParamsMethodApplicable): Ditto.
18320
18321         (Argument.Type): Use TypeManager.LookupType instead of Type.GetType - 
18322         silly me ;-)
18323
18324         * delegate.cs : Handle the case when we have more than one applicable
18325         method. Flag an error only when we finish checking all.
18326
18327 2002-05-02  Miguel de Icaza  <miguel@ximian.com>
18328
18329         * expression.cs: Add support for boolean static initializers.
18330
18331 2002-05-01  Miguel de Icaza  <miguel@ximian.com>
18332
18333         * attribute.cs: Use proper cast for Events, since we use a MyEventBuilder.
18334
18335         * parameter.cs (ComputeParameterTypes,
18336         ComputeAndDefineParameterTypes): Better error handling: now we
18337         clear the `types' cache if we fail during any of the type lookups.
18338         We also return the status code correctly to our caller
18339
18340         * delegate.cs: If we fail to define a delegate, abort the extra
18341         steps. 
18342
18343         * expression.cs (Binary.ResolveOperator): for
18344         operator==(object,object) and operator !=(object, object) we also
18345         have to verify that there is an implicit conversion from one to
18346         the other.
18347
18348         (ArrayAccess.DoResolve): Array Access can operate on
18349         non-variables. 
18350
18351 2002-04-30  Miguel de Icaza  <miguel@ximian.com>
18352
18353         * assign.cs (CompoundAssign): A new class used as a "flag" that
18354         the assignment actually is happening as part of a compound
18355         assignment operator.
18356
18357         During compound assignment, a few new rules exist to enable things
18358         like:
18359
18360         byte b |= 1 + 2
18361
18362         From the spec:
18363
18364         x op= y can be evaluated as x = (T) (x op y) (ie, an explicit cast
18365         to the type of x) if y is implicitly convertible to the type of x,
18366         and the operator is a builtin operator and the return type of the
18367         operator is explicitly convertible to the type of x. 
18368
18369         * rootcontext.cs: Reset warning level to 2.  4 catches various
18370         "interesting" features in mcs, we must clean this up at some
18371         point, but currently am trying to kill other bugs ;-)
18372
18373         * ecore.cs (SimpleName.SimpleNameResolve): Perform member lookups
18374         in container classes as well.  
18375
18376         * expression.cs (Binary.ResolveOperator): Handle string case
18377         before anything else (as operator overloading does emit an error
18378         before doing anything else).
18379
18380         This code could go away when we move to a table driven model, but
18381         i could not come up with a good plan last night.
18382
18383 2002-04-30  Lawrence Pit <loz@cable.a2000.nl>
18384
18385         * typemanager.cs (CSharpName): reimplementation using regex.
18386         * class.cs: added null check for fields in Emit
18387         * rootcontext.cs: set warninglevel to 4
18388
18389 2002-04-29  Miguel de Icaza  <miguel@ximian.com>
18390
18391         * typemanager.cs (CSharpName): reimplemented with Lupus
18392         suggestion.
18393
18394 2002-04-28  Miguel de Icaza  <miguel@ximian.com>
18395
18396         * statement.cs (If): correclty implement Resolve, because we were
18397         not catching sem errors in there.  The same process is needed
18398         everywhere else. 
18399         (Return, StatementExpression, For, While, Do, Throw, Lock): Implement Resolve
18400
18401
18402         (Statement.Warning_DeadCodeFound): Factorize code.
18403         (While): Report dead code here too.
18404
18405         (Statement): Added Resolve virtual method to allow
18406         for resolution split from the emit code.
18407
18408 2002-04-26  Miguel de Icaza  <miguel@ximian.com>
18409
18410         * statement.cs (EmitBoolExpression): No longer try to resolve the
18411         expression here.    
18412         (MakeBoolean): New utility function that resolve, implicitly
18413         converts to boolean and tags the expression. 
18414
18415
18416         (If, Do): Implement dead code elimination.
18417         (While): Implement loop inversion
18418
18419         (Do, While, For, If): Resolve the expression prior to calling our
18420         code generation.
18421
18422 2002-04-22  Lawrence Pit <loz@cable.a2000.nl>
18423
18424         * class.cs:
18425           - added method Report28 (warning: program has more than one entry point)
18426           - added method IsEntryPoint, implements paragraph 10.1 of the spec
18427           - modified method Method.Define, the part at the end of the method
18428
18429         * rootcontext.cs: added static public Location EntryPointLocation;
18430           
18431         * ../errors/cs0028.cs : Add test case for the above warning.              
18432
18433         * typemanager.cs:
18434           - modified method CSharpName to allow arrays of primitive type to
18435             be printed nicely (e.g. instead of System.Int32[][] it now prints
18436             int[][])
18437           - added method CSharpSignature: returns the signature of a method
18438             in string format to be used in reporting errors, warnings, etc.
18439
18440         * support.cs: InternalParameters.ParameterDesc variable tmp initialized
18441         with String.Empty.
18442
18443 2002-04-26  Ravi Pratap  <ravi@ximian.com>
18444
18445         * delegate.cs (Define): Fix extremely silly bug where I was
18446         setting the type of the 'object' parameter of the BeginInvoke
18447         method to System.IAsyncResult instead of System.Object ;-)
18448
18449 2002-04-26  Miguel de Icaza  <miguel@ximian.com>
18450
18451         * class.cs (ConstructorInitializer.Resolve): Also use DeclaredOnly
18452         here. 
18453
18454         (Constructor.Emit): return if we fail to initialize the
18455         constructor.  Another door closed!  
18456
18457         * expression.cs (New.DoResolve): Improve error message (from -6 to
18458         1501).  Use DeclaredOnly lookup to find the exact constructor.
18459
18460         * typemanager.cs (MemberLookup): If DeclaredOnly is set, do not
18461         loop.  This is useful.
18462
18463         * cs-parser.jay: Adjust the default parameters so that destructors
18464         have the proper signature.
18465
18466 2002-04-26  Martin Baulig  <martin@gnome.org>
18467
18468         * driver.cs (LoadAssembly): If `assembly' contains any characters
18469         which are only valid in path names and not in assembly names
18470         (currently slash, backslash and point), use Assembly.LoadFrom ()
18471         instead of Assembly.Load () on the `assembly' (before iteration
18472         over the link_paths).
18473
18474 2002-04-26  Martin Baulig  <martin@gnome.org>
18475
18476         * cs-tokenizer.cs (is_hex): Correctly handle lowercase chars.
18477
18478 2002-04-25  Miguel de Icaza  <miguel@ximian.com>
18479
18480         * class.cs (Property): use the new typemanager.MemberLookup
18481
18482         (TypeContainer.MemberLookup): Implement using the
18483         TypeManager.MemberLookup now. 
18484
18485         * typemanager.cs: Make MemberLookup a function of the TypeManager,
18486         and return MemberInfos, so that these can be used without an
18487         EmitContext (what we had before).
18488
18489 2002-04-24  Miguel de Icaza  <miguel@ximian.com>
18490
18491         * expression.cs: Fix the case where the argument to params if the
18492         type of the params.  I omitted handling this before.   Fixed
18493
18494 2002-04-22  Miguel de Icaza  <miguel@ximian.com>
18495
18496         * driver.cs: Call BootCorlib_PopulateCoreType
18497
18498         * class.cs (Property.CheckBase): Check for properties only, not
18499         for all members. 
18500
18501         * interface.cs: Temporary hack: try/catch around the
18502         CustomAttributeBuilder, because I am getting an exception that I
18503         do not understand.
18504
18505         * rootcontext.cs (BootCorlib_PopulateCoreType): Populate some
18506         types whose definitions are required to be there (attributes are
18507         defined before standard types).
18508
18509         Compute definitions as we boot the various types, as they are used
18510         immediately (value_type class will need object_type, but if we do
18511         not initialize object_type, we will pass a null, which will let
18512         the runtime pick the System.Object from the existing corlib, which
18513         is not what we want).
18514
18515 2002-04-22  Patrik Torstensson <totte@labs2.com>
18516
18517         * cs-tokenizer.cs: fixed a number of trim() issues.
18518
18519 2002-04-22  Ravi Pratap  <ravi@ximian.com>
18520
18521         * expression.cs (Argument.Type): Ensure that we return the correct
18522         type when we have out or ref parameters [in which case we 
18523         append a "&"].
18524
18525 2002-04-22  Miguel de Icaza  <miguel@ximian.com>
18526
18527         * class.cs (Property, Indexer): Allow extern modifier in there. 
18528
18529         * typemanager.cs (InitBaseTypes): Initializes object_type and
18530         value_type, since those will be used early on during the bootstrap
18531         process to compile corlib.
18532
18533         (InitCoreTypes): Move code from here to InitBaseTypes.
18534
18535 2002-04-21  Miguel de Icaza  <miguel@ximian.com>
18536
18537         * ecore.cs (PropertyExpr): Optimize calls to Array::get_Length on
18538         single-dimension arrays as using the ldlen opcode.  
18539
18540         Daniel Lewis discovered this optimization.  
18541
18542         * typemanager.cs: Add signature for System.Array::get_Length
18543
18544 2002-04-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
18545
18546         * statement.cs: report the error when the foreach does not apply to an
18547         array nor a collection.
18548
18549 2002-04-19  Miguel de Icaza  <miguel@ximian.com>
18550
18551         * expression.cs: Add implicit conversions to the operator ~.
18552
18553         * constant.cs (DecimalConstant.Emit): Emit decimal value.
18554
18555         * typemanager.cs: Locate the decimal constructor.
18556
18557 2002-04-17  Gonzalo Paniagua Javier <gonzalo@ximian.com>
18558
18559         * attribute.cs: use the new property of TypeOf.
18560         * expression.cs: added 'get' property around typearg.
18561
18562         These changes fix a build breaker reported by NickD. Is this the
18563         correct way to fix?  If not, please, revert my changes and make it
18564         work :-).
18565
18566 2002-04-17  Miguel de Icaza  <miguel@ximian.com>
18567
18568         * attribute.cs: Add support for typeof in attribute invocations.
18569         I am not sure that this is right though.
18570
18571 2002-04-14  Duncan Mak  <duncan@ximian.com>
18572
18573         * cfold.cs (BinaryFold): Catch DivideByZeroException in the
18574         Binary.Operator.Division case.
18575
18576 2002-04-13  Ravi Pratap  <ravi@ximian.com>
18577
18578         * class.cs (DefineType): Ensure that we do a proper check on
18579         attribute types and also register it with the TypeManager.
18580
18581         (TypeContainer.Targets): The default for attribute types is
18582         AttributeTargets.All.
18583
18584         * attribute.cs (ApplyAttributes): Registering the attribute type
18585         is done elsewhere, not when we discover we have a Usage attribute.
18586
18587 2002-04-12  Ravi Pratap  <ravi@ximian.com>
18588
18589         * expression.cs (VerifyArgumentsCompat): Implement Miguel's suggestion
18590         and get rid of is_delegate parameter.
18591
18592         * everywhere : update.
18593
18594 2002-04-12  Ravi Pratap  <ravi@ximian.com>
18595
18596         * cs-parser.jay (compilation_unit): Revamp completely to use
18597         some new ideas that I got from Rhys' grammar to solve the problems
18598         with assembly level attributes.
18599
18600         (outer_declaration): New grammar production.
18601
18602         (attribute_sections): Add.
18603
18604         (opt_attributes): Base on attribute_sections
18605
18606         (namespace_declaration): Allow opt_attributes to tackle the case
18607         when we have assembly level attributes - we are clever in this
18608         regard now ;-)
18609
18610         * attribute.cs (ApplyAttributes): Do not worry about assembly 
18611         attributes in the non-global context.
18612
18613         * rootcontext.cs (AddGlobalAttributes): Go back to using this
18614         instead of SetGlobalAttributes.
18615
18616         * class.cs, rootcontext.cs : Ensure we define and generate 
18617         attribute types before anything else.
18618
18619         * attribute.cs (CheckAttribute and GetValidPlaces): Handle the exception
18620         and flag the new error -20 for the case when the attribute type
18621         does not have valid targets specified. csc does not catch this.
18622
18623         * ../errors/errors.txt : update for error # -20
18624
18625 2002-04-11  Ravi Pratap  <ravi@ximian.com>
18626
18627         * support.cs (InternalParameters.ParameterModifier): Do some null
18628         checking and return sane values.
18629
18630         * class.cs (Method.Define): If we are a PInvoke method, ensure
18631         that we are static and extern. Report error # 601
18632
18633         * ../errors/cs0601.cs : Add test case for the above error.
18634
18635 2002-04-07  Ravi Pratap  <ravi@ximian.com>
18636
18637         * rootcontext.cs (attribute_types): We need to keep type of
18638         all attribute types separately and emit code for them first.
18639
18640         (RegisterAttribute) : Implement.
18641
18642         * class.cs (DefineType): Check if the current Type is a custom
18643         attribute type and register it accordingly.
18644
18645         * rootcontext.cs (AddGlobalAttributes): Fix silly bug where we were
18646         adding the first attribute twice and rename to
18647
18648         (SetGlobalAttributes): this.
18649
18650         * rootcontext.cs (NamespaceLookup): Run through the aliases too and perform
18651         lookups.
18652
18653         * attribute.cs (ApplyAttributes): Take an additional argument telling us
18654         if we are processing global arguments. Hmm, I am unsure of this.
18655
18656 2002-04-12  Gonzalo Paniagua Javier <gonzalo@ximian.com>
18657
18658         * expression.cs: added static array of strings to avoid calling
18659         Enum.ToString () for Operator in Binary. Significant recover of
18660         performance.
18661
18662 2002-04-10  Miguel de Icaza  <miguel@ximian.com>
18663
18664         * class.cs (FindMembers): Allow the Builders of the various
18665         members to be null.  If they are skip them.  This only happens
18666         during the PInvoke declaration.
18667
18668 2002-04-09  Miguel de Icaza  <miguel@ximian.com>
18669
18670         * parameter.cs (Parameters.ComputeParameterTypes): Flag the
18671         failure, so we do not keep going afterwards.
18672
18673         * expression.cs: (Invocation.OverloadResolve): I believe Ravi
18674         wanted to pass `false' as the `is_delegate' argument.  If this is
18675         the case, why not use delegate_type == null to mean `is_delegate =
18676         false' and anything else as is_delegate = true.
18677
18678 Tue Apr  9 05:40:12  2002 Piers Haken <piersh@friskit.com>
18679
18680         * statement.cs: fixed SimpleSwitchEmit to make 'goto case' goto the
18681         code for the section, not the beginning of the tests.
18682
18683 2002-04-08  Miguel de Icaza  <miguel@ximian.com>
18684
18685         * cfold.cs: Handle operator + (Enum x, Underlying x) 
18686
18687         * expression.cs (Binary): same.  Warn about errors where we have
18688         Enum/Enum in operator + as well.
18689
18690 Mon Apr  8 06:29:03  2002 Piers Haken <piersh@friskit.com>
18691
18692         * statement.cs:
18693                 - added support for switch(bool)
18694                 - optimize loading of I8/U8 constants (ldc.i4, iconv_i8)
18695                 - add TableSwitchEmit() to handle table-based switch statements
18696
18697 2002-04-05  Ravi Pratap  <ravi@ximian.com>
18698
18699         * expression.cs (Invocation.OverloadResolve): Factor out code which
18700         does parameter compatibility checking with arguments so that we can 
18701         re-use the code even from Delegate.VerifyApplicability
18702
18703         (VerifyArgumentsCompat): Move above code here.
18704
18705         * delegate.cs (VerifyApplicability): Get rid of duplicate code
18706         and instead make a call to the above method.
18707
18708 2002-03-31  Ravi Pratap  <ravi@ximian.com>
18709
18710         * typemanager.cs (attribute_type): Corresponds to System.Attribute.
18711         We use it to keep track of classes which are attribute types.
18712
18713 2002-04-02  Miguel de Icaza  <miguel@ximian.com>
18714
18715         * delegate.cs (Delegate.Define): Correctly define the types in the
18716         presence of fixed and array parameters.
18717
18718         * class.cs (TypeContainers.FindMembers): Use NonPublic flag while
18719         doing FindMembers.
18720
18721         * ecore.cs (Expression.MemberLookup): Reset binding flags to not
18722         include NonPublic after the first iteration.
18723
18724         * class.cs (Indexer.CheckBase): Only check if both parents are
18725         non-null. 
18726
18727         * cs-parser.jay (accessor_body): If empty, set to null.
18728
18729         * ecore.cs (SimpleName.SimpleNameResolve): We did not have the
18730         same code path here to resolve constants names that we did have in
18731         MemberAccess.DoResolve.  There is too much code duplicated here.
18732
18733 2002-04-01  Miguel de Icaza  <miguel@ximian.com>
18734
18735         * statement.cs, makefile: Drop Statementcollection and just use ArrayLists
18736
18737         * ecore.cs: Optimize UserDefinedConversion by minimizing the calls
18738         to MakeUnionSet.
18739
18740         * cs-tokenizer.cs: Reuse a single StringBuilder for assembling
18741         tokens, numbers and strings.
18742
18743         * ecore.cs (MethodGroupExpr): Make Emit warn about missing
18744         parenthesis.
18745
18746         * delegate.cs: Use ComputeAndDefineParameterTypes for both the
18747         asyncronous parameters and the regular parameters.  
18748
18749         * codegen.cs (CodeGen.Init): Use the constructor that allows us to
18750         specify the target directory.
18751
18752         * expression.cs: (This.DoResolve): Simplify
18753         (As.Emit): Optimize, do not generate IsInst if the expression is
18754         always of the given type.
18755
18756         (Is.DoResolve): Bug fix, we were reporting both always/never for
18757         the is expression.
18758
18759         * (Invocation.MakeUnionSet): Simplify vastly and optimize, we were
18760         creating too many unnecessary arrays.
18761
18762 2002-03-31  Miguel de Icaza  <miguel@ximian.com>
18763
18764         * class.cs (EmitFieldInitializer): Use Assign expression to assign
18765         fields instead of rolling our own initializer.   Takes care of all
18766         implicit conversions, and drops unnecessary static checks/argument.
18767
18768 2002-03-31  Dick Porter  <dick@ximian.com>
18769
18770         * driver.cs: use the GetDirectories() return values properly, and
18771         use "/" as path separator.
18772
18773 2002-03-30  Miguel de Icaza  <miguel@ximian.com>
18774
18775         * expression.cs (Unary): Optimize - - expr into expr.
18776         (Binary): Optimize a + (-b) into a -b.
18777
18778         * codegen.cs (CodeGen): Made all methods static.
18779
18780 2002-03-29  Miguel de Icaza  <miguel@ximian.com>
18781
18782         * rootcontext.cs: 
18783
18784         * decl.cs: Rename `definition' into `TypeBuilder' and drop the
18785         TypeBuilder property.
18786
18787         * cs-parser.jay: Drop the use of RecordXXX and use RecordDecl
18788         instead. 
18789
18790         * tree.cs: Removed the various RecordXXXX, and replaced with a
18791         single RecordDecl.  Removed all the accessor methods, and just
18792         left a single access point Type 
18793
18794         * enum.cs: Rename DefineEnum to DefineType.
18795
18796         * decl.cs: New abstract method `DefineType' used to unify the
18797         Defines for Enumerations, Interfaces, TypeContainers and
18798         Delegates.
18799
18800         (FindType): Moved LookupInterfaceOrClass here.  Moved the
18801         LookupBaseClasses method that used to live in class.cs and
18802         interface.cs here, and renamed to FindType.
18803
18804         * delegate.cs: Implement DefineType.  Take advantage of the
18805         refactored pattern for locating the parent builder without taking
18806         the parent_builder argument (which we know does not work if we are
18807         nested, and triggering a toplevel definition).
18808
18809 2002-03-28  Miguel de Icaza  <miguel@ximian.com>
18810
18811         * decl.cs (MemberCore.CheckMethodAgainstBase): Test if the
18812         accessibility of a member has changed during override and report
18813         an error if so.
18814
18815         * class.cs (Method.Define, Property.Define): Only complain on
18816         overrides if the method is private, any other accessibility is
18817         fine (and since we just checked the permission is the same, we are
18818         good to go).
18819
18820         * cs-tokenizer.cs: only line, region, endregion, if, endif, else
18821         and elif are processed always.  The other pre-processing
18822         directives are only processed if we are "taking" the path
18823
18824 2002-03-29  Martin Baulig  <martin@gnome.org>
18825
18826         * class.cs (Method.Emit): Only emit symbolic debugging info if the
18827         current location is not Null.
18828
18829         * codegen.cs (CodeGen.SaveSymbols): Split out symbol writing code into
18830         a separate method so we can profile it.
18831
18832         * driver.cs (ShowTime): We need to use `(int) span.TotalSeconds' since
18833         `span.Seconds' are just seconds, but no minutes or hours.
18834         (MainDriver): Profile the CodeGen.SaveSymbols calls.
18835
18836 2002-03-28  Miguel de Icaza  <miguel@ximian.com>
18837
18838         * class.cs (Method.Define), (Property.Define), (Indexer.Define):
18839         Remove the gratuitous set of Final:
18840
18841                                 // If an interface implementation, then we can set Final.
18842                                 if (((flags & MethodAttributes.Abstract) == 0) &&
18843                                     implementing.DeclaringType.IsInterface)
18844                                         flags |= MethodAttributes.Final;
18845
18846         I do not know what I was smoking when I used that.
18847
18848
18849         * cs-parser.jay, delegate.cs: Make Delegate be a DeclSpace, first
18850         step into fixing the name resolution issues for delegates and
18851         unifying the toplevel name resolution.
18852
18853 2002-03-28  Martin Baulig  <martin@gnome.org>
18854
18855         * class.cs (Method.Emit): If we have a symbol writer, call its
18856         OpenMethod(), CloseMethod() and SetMethodSourceRange() methods to
18857         tell it about the current method.
18858
18859         * codegen.cs (EmitContext.Mark): New public method. Tell the symbol
18860         writer that we're going to emit the first byte of IL code for a new
18861         statement (a new source line).
18862         (EmitContext.EmitTopBlock): If we have a symbol writer, call
18863         EmitContext.Mark() before emitting any code.
18864
18865         * location.cs (SymbolDocument): Return null when we're Null.
18866
18867         * statement.cs (Statement): Moved the `Location loc' variable here.
18868         (Statement.EmitBoolExpression): If we have a symbol writer, call
18869         ec.Mark() before emitting any code to tell it that we're at the
18870         beginning of a new statement.
18871         (StatementExpression): Added `Location' argument to the constructor.
18872         (Block): Added public readonly variable `StartLocation' and public
18873         variable `EndLocation'.  The latter is to be set using SetEndLocation().
18874         (Block): Added constructor which takes a start and end location.
18875         (Block.SetEndLocation): New method. This sets the end location.
18876         (Block.EmitMeta): If we have a symbol writer, tell it the names of the
18877         local variables we create.
18878         (Block.Emit): If we have a symbol writer, call ec.Mark() before emitting
18879         each statement and do also mark the begin and end of the block.
18880
18881         * cs-parser.jay (block : OPEN_BRACE): Use the new `Block' constructor to
18882         tell it the current lexer.Location, use Location.Null for the end of the
18883         block.
18884         (block : OPEN_BRACE opt_statement_list CLOSE_BRACE): When closing the
18885         current block, set its end location using SetEndLocation().
18886         (statement_expression): StatementExpression constructor now takes the
18887         lexer.Location as additional argument.
18888         (for_statement, declare_local_variables): Likewise.
18889         (declare_local_variables): When creating a new implicit block, use the
18890         new Block constructor and pass it the lexer.Location.
18891
18892 2002-03-28  Miguel de Icaza  <miguel@ximian.com>
18893
18894         * ecore.cs (Expression.MemberLookup): On interfaces, lookup
18895         members also on the parent interfaces recursively.
18896
18897 2002-03-27  Miguel de Icaza  <miguel@ximian.com>
18898
18899         * report.cs: Use new formats, since Gonzalo finished the missing
18900         bits. 
18901
18902         * expression.cs (Binary.ResolveOperator): added missing operator|
18903         operator& and operator^ for bool/bool.
18904
18905         * cs-parser.jay: CheckDef now takes a Location argument that is
18906         used to report errors more precisly (instead of reporting the end
18907         of a definition, we try to track something which is a lot closer
18908         to the source of the problem).
18909
18910         * cs-tokenizer.cs: Track global token use, so we can properly flag
18911         the use of #define/#undef after the first token has been seen.
18912
18913         Also, rename the reportXXXX to Error_DescriptiveName
18914
18915         * decl.cs (DeclSpace.IsTopLevel): Move property here from
18916         TypeContainer, so that Enum and Interface can use this too.
18917
18918         * class.cs (TypeContainer.LookupInterfaceOrClass,
18919         GetInterfaceOrClass, GetClassBases, DefineType): Drop the
18920         `builder' argument.  Typically this was used to pass the parent
18921         builder (a ModuleBuilder or a TypeBuilder from whoever triggered
18922         the definition).  
18923
18924         The problem is that a nested class could trigger the definition of
18925         a toplevel class, and the builder would be obviously wrong in that
18926         case. 
18927
18928         So we drop this argument, and we compute dynamically the
18929         TypeBuilder/ModuleBuilder (the correct information was available
18930         to us anyways from DeclSpace.Parent)
18931
18932         * interface.cs (Interface.DefineInterface): Drop builder
18933         parameter cleanup like class.cs
18934
18935         * enum.cs (Enum.DefineEnum): Drop builder parameter.  Clean up
18936         like class.cs
18937
18938         * statement.cs (Switch.EmitObjectInteger): Emit short/ushort
18939         values. 
18940
18941         (Try.Emit): Propagate the returns value from the statement.
18942
18943         (Return.Emit): Even if we are leavning 
18944
18945         * driver.cs: Catch IOExpcetion for Directory.GetFiles as well.
18946
18947         * modifiers.cs: Fix the computation of MethodAttributes flags.
18948
18949 Tue Mar 26 21:14:36 CET 2002 Paolo Molaro <lupus@ximian.com>
18950
18951         * driver.cs: allow compilation of files that start with '/'.
18952         Add a default case when checking the argument of --target.
18953
18954 2002-03-25  Miguel de Icaza  <miguel@ximian.com>
18955
18956         * interface.cs: Implement the same search algorithm for types in
18957         the interface code.
18958
18959         * delegate.cs: Do not allow multiple definition.
18960
18961         * Recovered ChangeLog that got accidentally amputated
18962
18963         * interface.cs (Interface.DefineInterface): Prevent from double definitions.
18964
18965         * rootcontext.cs: Load manually enum to allow core classes to
18966         contain enumerations.
18967
18968         * enum.cs, ecore.cs, driver.cs, attribute.cs, class.cs, expression.cs:
18969         Update to new static methods in TypeManager.
18970
18971         * typemanager.cs (GetMethod, GetConstructor): Use our
18972         implementation of FindMembers to find the members, since during
18973         corlib compilation, the types are TypeBuilders and GetMethod and
18974         GetConstructor do not work.
18975
18976         Make all methods in TypeManager static.
18977
18978         (InitCodeHelpers): Split the functionality from
18979         the InitCodeTypes function.
18980
18981         * driver.cs: Call InitCodeHelpers after we have populated the
18982         types. 
18983
18984         * cs-parser.jay (delegate_declaration): we did not used to compute
18985         the delegate name correctly for void delegates.
18986
18987 2002-03-24  Miguel de Icaza  <miguel@ximian.com>
18988
18989         * rootcontext.cs (RootContext): Init the interface_resolve_order
18990         and type_container_resolve_order always.
18991
18992         (ResolveCore, BootstrapCorlib_ResolveClass,
18993         BootstrapCorlib_ResolveStruct): New functions to bootstrap the
18994         compiler when compiling with --nostdlib
18995
18996         * class.cs (TypeContainer.DefineType): Check that our parent is
18997         not null.  This test is most important when we are bootstraping
18998         the core types.
18999
19000         * codegen.cs: Split out the symbol writing code.
19001
19002 2002-03-25  Martin Baulig  <martin@gnome.org>
19003
19004         * driver.cs (-g): Made -g an alias for --debug.
19005
19006 2002-03-24  Martin Baulig  <martin@gnome.org>
19007
19008         * codegen.cs (SymbolWriter): New public variable. Returns the
19009         current symbol writer.
19010         (CodeGen): Added `bool want_debugging_support' argument to the
19011          constructor. If true, tell the ModuleBuild that we want debugging
19012         support and ask it for the ISymbolWriter.
19013         (Save): If we have a symbol writer, call it's Close() method after
19014         saving the assembly.
19015
19016         * driver.c (--debug): New command line argument to create a
19017         debugger information file.
19018
19019         * location.cs (SymbolDocument): New public property. Returns an
19020         ISymbolDocumentWriter object for the current source file or null
19021         if we don't have a symbol writer.
19022
19023 2002-03-21  Miguel de Icaza  <miguel@ximian.com>
19024
19025         * driver.cs (LoadAssembly): Correctly return when all the paths
19026         have been tried and not before.
19027
19028         * statement.cs (Switch.Emit): return the actual coverage for this
19029         statement (returns/not-returns)
19030
19031         (Switch.SimpleSwitchEmit): Do not generate jumps to the end of the
19032         switch of the statement if we are the last switch section.  That
19033         kills two problems: try/catch problems (we used to emit an empty
19034         nop at the end) and switch statements where all branches would
19035         return. 
19036
19037 2002-03-19  Miguel de Icaza  <miguel@ximian.com>
19038
19039         * driver.cs: Add default assemblies (the equivalent to the
19040         Microsoft CSC.RSP file)
19041
19042         * cs-tokenizer.cs: When updating `cols and setting it to zero,
19043         also update tokens_seen and set it to false.
19044
19045         * driver.cs: Implement --recurse for Mike.
19046
19047         * driver.cs (SplitPathAndPattern): Small bug fix, I was not
19048         correctly splitting out the paths.
19049
19050 2002-03-18  Miguel de Icaza  <miguel@ximian.com>
19051
19052         * interface.cs (Interface.PopulateProperty): Instead of using
19053         `parent' as the declaration space for the set parameters, use
19054         `this' 
19055
19056         * support.cs (InternalParameters): InternalParameters constructor
19057         takes a DeclSpace instead of a TypeContainer.
19058
19059         * expression.cs (ArrayCreation.EmitDynamicInitializers): If value
19060         types are being initialized, load the address of it before calling
19061         the function.  
19062
19063         (New): Provide a mechanism to disable the generation of local
19064         value type temporaries when the caller will be providing us with
19065         an address to store it.
19066
19067         (ArrayCreation.EmitDynamicInitializers): Use it.
19068
19069 2002-03-17  Miguel de Icaza  <miguel@ximian.com>
19070
19071         * expression.cs (Invocation.EmitArguments): Only probe for array
19072         property if there is more than one argument.  Sorry about that.
19073
19074         * class.cs (Invocation.EmitArguments): Fix to emit arguments for
19075         empty param arrays.
19076
19077         * class.cs (Method.LabelParameters): Fix incorrect code path that
19078         prevented the `ParamArrayAttribute' from being applied to the
19079         params attribute.
19080
19081 2002-03-16  Miguel de Icaza  <miguel@ximian.com>
19082
19083         * support.cs (ReflectionParameters): Correctly compute whether the
19084         last argument is a params array.  Fixes the problem with
19085         string.Split ('a')
19086
19087         * typemanager.cs: Make the assemblies array always be non-null
19088         (empty, but non-null)
19089
19090         * tree.cs (RecordDecl): New function that abstracts the recording
19091         of names.  This reports error 101, and provides a pointer to the
19092         previous declaration.  Fixes a crash in the compiler.
19093
19094         * cs-parser.jay (constructor_declaration): Update to new grammar,
19095         and provide a constructor_body that can be empty.
19096
19097 2002-03-15  Miguel de Icaza  <miguel@ximian.com>
19098
19099         * driver.cs: Add support for --resources.
19100
19101         * expression.cs: (FetchGetMethod, FetchAddressMethod, EmitAssign):
19102         Make all types for the various array helper methods be integer.
19103
19104         * ecore.cs (Expression.ConvertNumericExplicit): Pass the
19105         CheckState to ConvCast.
19106
19107         (ConvCast): Now it takes a `checked' state argument, to avoid
19108         depending on the emit context for the conversion, and just using
19109         the resolve time setting.
19110
19111         * expression.cs (ArrayCreation.EmitArrayArguments): New function,
19112         instead of Invocation.EmitArguments.  We do not emit the original
19113         arguments, instead we emit those which have been converted to
19114         unsigned int expressions.
19115
19116         * statement.cs (Block.EmitMeta): Drop tracking of indexes.
19117
19118         * codegen.cs: ditto.
19119
19120         * expression.cs (LocalVariableReference): Drop the use of the
19121         Store function that depended on the variable index.
19122
19123         * statement.cs (VariableInfo): Drop the `Idx' property from this
19124         class, as this is not taking into account the indexes for
19125         temporaries tat we generate during the execution, getting the
19126         indexes wrong.
19127
19128         * class.cs: First emit class initializers, then call the parent
19129         constructor. 
19130
19131         * expression.cs (Binary): Fix opcode emision.
19132         (UnaryMutator.EmitCode): Support checked code generation
19133
19134         * ecore.cs (MemberLookup): TypeManager.FindMembers will return
19135         matches for events for both the Static and Instance scans,
19136         pointing to the same element.   Fix that.
19137
19138 2002-03-14  Miguel de Icaza  <miguel@ximian.com>
19139
19140         * rootcontext.cs (ResolveTree): Always set the
19141         interface_resolve_order, because nested interfaces will be calling
19142         into us.
19143
19144         * class.cs (GetInterfaceOrClass): Track the same resolution
19145         process used by TypeManager.LookupType.  This fixes the nested
19146         type lookups in class declarations (separate path from
19147         LookupType). 
19148
19149         (TypeContainer.DefineType): Also define nested interfaces.
19150         (TypeContainer.RegisterOrder): New public function used to
19151         register the order in which child interfaces need to be closed.
19152
19153         Nested interfaces need to be closed after their parents have been
19154         created. 
19155
19156         * interface.cs (InterfaceAttr): Put all the logic for computing
19157         the interface attribute here. 
19158
19159         (DefineInterface): Register our interface order with the
19160         RootContext or with the TypeContainer depending on the case.
19161
19162 2002-03-12  Miguel de Icaza  <miguel@ximian.com>
19163
19164         * cs-parser.jay: rework foreach statement to work with the new
19165         changes to the policy on SimpleNames.
19166
19167         * report.cs: support Stacktrace on warnings as well.
19168
19169         * makefile: drop --unsafe and /unsafe from the compile.
19170
19171 2002-03-13  Ravi Pratap  <ravi@ximian.com>
19172
19173         * ecore.cs (StandardConversionExists): Modify to take an Expression
19174         as the first parameter. Ensure we do null -> reference type conversion
19175         checking.
19176
19177         * Everywhere : update calls accordingly, making use of MyEmptyExpr to store
19178         temporary Expression objects.
19179
19180 Wed Mar 13 12:32:40 CET 2002 Paolo Molaro <lupus@ximian.com>
19181
19182         * interface.cs: workaround bug in method overloading resolution
19183         (there is already a bugzilla bug for it).
19184
19185 2002-03-12  Miguel de Icaza  <miguel@ximian.com>
19186
19187         We could also solve this problem by having a separate path for
19188         performing type lookups, instead of DoResolve, we could have a
19189         ResolveType entry point, and only participating pieces of the
19190         production (simplename, deref, array) would implement this. 
19191
19192         * codegen.cs (EmitContext): New field OnlyLookupTypes used to
19193         signal SimpleName to only resolve type names and not attempt to
19194         resolve anything else.
19195
19196         * expression.cs (Cast): Set the flag.
19197
19198         * ecore.cs (SimpleName): Use the OnlyLookupTypes flag
19199
19200         * class.cs: Only report 108 if there is no `new' modifier.
19201
19202         * cs-parser.jay: rework foreach statement to work with the new
19203         changes to the policy on SimpleNames.
19204         
19205         * report.cs: support Stacktrace on warnings as well.
19206
19207         * makefile: drop --unsafe and /unsafe from the compile.
19208
19209 2002-03-11  Miguel de Icaza  <miguel@ximian.com>
19210
19211         * ecore.cs (SimpleName.SimpleNameResolve): Perform local variable
19212         lookups here, instead of doing that at parse time.  This means
19213         that our grammar will not introduce `LocalVariableReferences' as
19214         expressions at this point.  That solves the problem of code like
19215         this:
19216
19217         class X {
19218            static void Main ()
19219            { int X = 1;
19220             { X x = null }}}
19221
19222         This is only half the fix.  The full fix requires parameters to
19223         also be handled in this way.
19224
19225         * Everywhere: Use ec.DeclSpace on calls to LookupType, as this
19226         makes the use more obvious of the DeclSpace.  The
19227         ec.TypeContainer.TypeBuilder is now only used to pull the
19228         TypeBuilder for it.
19229
19230         My theory is that I can get rid of the TypeBuilder completely from
19231         the EmitContext, and have typecasts where it is used (from
19232         DeclSpace to where it matters).  
19233
19234         The only pending problem is that the code that implements Aliases
19235         is on TypeContainer, and probably should go in DeclSpace.
19236
19237         * ecore.cs (SimpleName.SimpleNameResolve): Perform local variable
19238         lookups here, instead of doing that at parse time.  This means
19239         that our grammar will not introduce `LocalVariableReferences' as
19240         expressions at this point.  That solves the problem of code like
19241         this:
19242
19243         class X {
19244            static void Main ()
19245            { int X = 1;
19246             { X x = null }}}
19247
19248         This is only half the fix.  The full fix requires parameters to
19249         also be handled in this way.
19250
19251         * class.cs (Property.DefineMethod): When implementing an interface
19252         method, set newslot, when implementing an abstract method, do not
19253         set the flag (before we tried never setting it, or always setting
19254         it, which is the difference).
19255         (Indexer.DefineMethod): same.
19256         (Method.DefineMethod): same.
19257
19258         * ecore.cs: Only set the status used flag if we get back a Field.
19259
19260         * attribute.cs: Temporary hack, so Paolo can keep working.
19261
19262 2002-03-08  Ravi Pratap  <ravi@ximian.com>
19263
19264         * attribute.cs (Attribute.UnmanagedType): This is to keep track of
19265         the unmanaged type in the case we have a MarshalAs attribute.
19266
19267         (Resolve): Handle the case when we are parsing the special MarshalAs
19268         attribute [we need to store the unmanaged type to use later]
19269
19270         * typemanager.cs (marshal_as_attr_type): Built in type for the 
19271         MarshalAs Attribute.
19272
19273         * attribute.cs (ApplyAttributes): Recognize the MarshalAs attribute 
19274         on parameters and accordingly set the marshalling info.
19275
19276 2002-03-09  Miguel de Icaza  <miguel@ximian.com>
19277
19278         * class.cs: Optimizing slightly by removing redundant code after
19279         we switched to the `NoTypes' return value.
19280         (Property.DefineMethod): use NoTypes here too.
19281
19282         This fixes the bug I introduced in my last batch of changes.
19283
19284 2002-03-05  Ravi Pratap  <ravi@ximian.com>
19285
19286         * tree.cs (RecordEnum): Add. We now keep track of enums too.
19287
19288         * class.cs (LookupInterfaceOrClass): Check against the list of recorded
19289         Enums since those are types too. 
19290
19291         * cs-parser.jay (enum_declaration): Record enums as we parse them.
19292
19293         * enum.cs (DefineEnum): Return if the TypeBuilder has already been defined 
19294         thanks to a call during the lookup process.
19295
19296 2002-03-07  Miguel de Icaza  <miguel@ximian.com>
19297
19298         * statement.cs (Foreach): Lots of work to accomodate a particular
19299         kind of foreach statement that I had not kept in mind.  It is
19300         possible to have foreachs on classes that provide a GetEnumerator
19301         method that return objects that implement the "pattern" for using
19302         a foreach, there is no need to support GetEnumerator
19303         specifically. 
19304
19305         This is needed to compile nant.
19306
19307         * decl.cs: Only report 114 if the member is not `Finalize' and if
19308         the warning level is at least 2.
19309
19310         * class.cs: Moved the compare function from Method to
19311         MethodSignature. 
19312
19313         (MethodSignature.InheritableMemberSignatureCompare): Add new
19314         filter function that is used to extract inheritable methods from a
19315         class. 
19316
19317         (Method.Define): Use the new `inheritable_method_signature_filter'
19318         delegate
19319
19320         * cs-tokenizer.cs (get_cmd_arg): Do not add white space to the
19321         command. 
19322
19323 2002-03-06  Miguel de Icaza  <miguel@ximian.com>
19324
19325         * ecore.cs (Expression.ConvertReferenceExplicit): Removed dead code.
19326
19327         * cs-parser.jay: Add opt_semicolon to the interface declaration.
19328
19329         * expression.cs: Pass location information to
19330         ConvertImplicitStandard. 
19331
19332         * class.cs: Added debugging code to track return values from
19333         interfaces. 
19334
19335 2002-03-05  Miguel de Icaza  <miguel@ximian.com>
19336
19337         * expression.cs (Is.DoResolve): If either side of the `is' is an
19338         interface, do not flag the warning.
19339
19340         * ecore.cs (ImplicitReferenceConversion): We need a separate test
19341         for interfaces
19342
19343         * report.cs: Allow for --fatal to be used with --probe.
19344
19345         * typemanager.cs (NoTypes): Move the definition for the empty Type
19346         array here. 
19347
19348         * class.cs (TypeContainer.FindMembers): Also look for methods defined by
19349         properties. 
19350         (TypeContainer.DefineProxy): New function used to proxy to parent
19351         implementations when implementing interfaces.
19352         (TypeContainer.ParentImplements): used to lookup if our parent
19353         implements a public function that is required by an interface.
19354         (TypeContainer.VerifyPendingMethods): Hook this up.
19355
19356         * typemanager.cs (TypeManager, AddModule, AddAssembly): Make the
19357         `modules' and `assemblies' arraylists into arrays.  We only grow
19358         these are the very early start up of the program, so this improves
19359         the speedof LookupType (nicely measured).
19360
19361         * expression.cs (MakeByteBlob): Replaced unsafe code with
19362         BitConverter, as suggested by Paolo.
19363
19364         * cfold.cs (ConstantFold.Binary): Special case: perform constant
19365         folding of string concatenation, but if either side is a string,
19366         and the other is not, then return null, and let the runtime use
19367         the concatenation on the string plus the object (using
19368         `Object.ToString'). 
19369
19370 2002-03-04  Miguel de Icaza  <miguel@ximian.com>
19371
19372         Constant Folding has been implemented now.
19373
19374         * expression.cs (Unary.Reduce): Do not throw an exception, catch
19375         the error instead on types that are not supported in one's
19376         complement. 
19377
19378         * constant.cs (Constant and all children): New set of functions to
19379         perform implict and explicit conversions.
19380
19381         * ecore.cs (EnumConstant): Implement the new functions to perform
19382         conversion by proxying to the child expression.
19383
19384         * codegen.cs: (ConstantCheckState): Constant evaluation has its
19385         own separate setting that can not be turned off from the command
19386         line using --unchecked or --checked and is only controlled using
19387         the checked/unchecked statements and expressions.  This setting is
19388         used by the constant folder to flag errors.
19389
19390         * expression.cs (CheckedExpr, UncheckedExpr): Set the
19391         ConstantCheckState as well.   
19392
19393         During Resolve, they also have to flag the state, because the
19394         constant folder runs completely in the Resolve phase.
19395
19396         * statement.cs (Checked, Unchecked): Set the ConstantCheckState as
19397         well.
19398
19399 2002-03-01  Miguel de Icaza  <miguel@ximian.com>
19400
19401         * cfold.cs: New file, this file contains the constant folder.
19402
19403         * ecore.cs (IMemoryLocation.AddressOf): Now takes an extra
19404         argument to track whether we are using the resulting address to
19405         load or store a value and provide better error messages. 
19406
19407         (FieldExpr.Emit, FieldExpr.EmitAssign, FieldExpr.AddressOf): Use
19408         new AddressOf arguments.
19409
19410         * statement.cs (Foreach.EmitCollectionForeach): Update
19411
19412         * expression.cs (Argument.Emit): Call AddressOf with proper
19413         arguments to track usage.
19414
19415         (New.DoEmit): Call AddressOf with new arguments.
19416
19417         (Unary.Emit): Adjust AddressOf call.
19418
19419 2002-03-01  Ravi Pratap  <ravi@ximian.com>
19420
19421         * cs-parser.jay (member_access): Change the case for pre-defined types
19422         to use a MemberAccess instead of a SimpleName. Thanks to Felix again for 
19423         this suggestion.
19424
19425         * class.cs (Operator::Emit): If we are abstract or extern, we don't have
19426         a method body.
19427
19428         * attribute.cs (CheckAttribute, ApplyAttribute): Ensure that we treat operators
19429         essentially like methods and apply attributes like MethodImplOptions to them too.
19430
19431         * ecore.cs (SimpleName.SimpleNameResolve): Perform a check on ec.TypeContainer.TypeBuilder
19432         not being null.
19433
19434         * codegen.cs (EmitContext): The constructor now takes in an extra argument specifying the
19435         DeclSpace as the distinction is important. We provide sane defaults as usually the TypeContainer
19436         is the DeclSpace.
19437
19438         * Update code everywhere accordingly.
19439
19440         * ecore.cs : Change references to ec.TypeContainer to ec.DeclSpace where appropriate.
19441
19442         * cs-parser.jay (enum_declaration): Set the current namespace of the enum.
19443
19444 2002-02-28  Ravi Pratap  <ravi@ximian.com>
19445
19446         * rootcontext.cs (LookupType): As we cycle through the chain of namespaces
19447         try performing lookups against those instead of jumping straight into using
19448         the 'using' clauses.
19449
19450         (ImplicitParent): Add. Thanks to Felix Arrese-Igor for this idea.
19451
19452         (LookupType): Perform lookups in implicit parents too.
19453
19454         * class.cs (GetInterfaceOrClass): Modify to perform the exact same lookup
19455         sequence as RootContext.LookupType. 
19456
19457         * rootcontext.cs (NamespaceLookup): Split out code from LookupType which tries 
19458         the various cases of namespace lookups into this method.
19459
19460 2002-03-01  Miguel de Icaza  <miguel@ximian.com>
19461
19462         * cs-parser.jay: Add support for [Attribute ()] (empty arguments
19463         in positional arguments)
19464
19465         * class.cs (Operator): Update the AllowedModifiers to contain
19466         extern. 
19467
19468         * cs-parser.jay: Update operator declaration to allow for the
19469         operator body to be empty.
19470
19471         * cs-tokenizer.cs: Added '\u' unicode support in strings and hex
19472         values. 
19473
19474 2002-02-27  Miguel de Icaza  <miguel@ximian.com>
19475
19476         * class.cs (Method.Emit): Label parameters.
19477
19478         * driver.cs: Return 1 or 0 as the program exit code.
19479
19480 2002-02-26  Miguel de Icaza  <miguel@ximian.com>
19481
19482         * expression.cs: Special case the `null' object when trying to
19483         auto-compute the type, as anything can be explicitly converted to
19484         that. 
19485
19486         * ecore.cs (Expression.ConvertExplicit): Bug fix, thanks for
19487         spotting this Paolo.
19488
19489         (Expression.ImplicitNumericConversion): Perform comparissions of
19490         the type using the underlying type in the case of an enumeration
19491         rather than using the enumeration type for the compare.
19492
19493         Cope with the underlying == type case, which is not possible to
19494         catch before. 
19495
19496         (Expression.ConvertNumericExplicit): Perform comparissions of
19497         the type using the underlying type in the case of an enumeration
19498         rather than using the enumeration type for the compare.
19499
19500         * driver.cs: If the user does not supply an extension, assume .exe
19501
19502         * cs-parser.jay (if_statement): Rewrote so that we can track the
19503         location for the if statement.
19504
19505         * expression.cs (Binary.ConstantFold): Only concat strings when
19506         the operation is "+", not everything ;-)
19507
19508         * statement.cs (Statement.EmitBoolExpression): Take a location
19509         argument. 
19510         (If, While, Do): Track location.
19511
19512         * expression.cs (Binary.ResolveOperator): In the object + string
19513         case, I was missing a call to ConvertImplicit
19514
19515 2002-02-25  Ravi Pratap  <ravi@ximian.com>
19516
19517         * parameter.cs (Parameter.ExternalType): Take in extra DeclSpace and
19518         Location arguments. Ensure we use RootContext.LookupType to do our work
19519         and not try to do a direct Type.GetType and ModuleBuilder.GetType
19520
19521         * interface.cs (PopulateMethod): Handle the type of the parameter being
19522         null gracefully.
19523
19524         * expression.cs (Invocation.BetterFunction): Handle the case when we 
19525         have a params method with no fixed arguments and a call is made with no
19526         arguments.
19527
19528 2002-02-25  Miguel de Icaza  <miguel@ximian.com>
19529
19530         * cs-tokenizer.cs: Add support for the quote-escape-sequence in
19531         the verbatim-string-literal
19532
19533         * support.cs (InternalParameters.ParameterModifier): handle null
19534         fixed parameters.
19535         (InternalParameters.ParameterType): ditto.
19536
19537         * parameter.cs (VerifyArgs): Also check if the fixed parameter is
19538         duplicating the name of the variable parameter.
19539         (GetParameterByName): Fix bug where we were not looking up array
19540         paramters if they were the only present (thanks Paolo!).
19541         (GetParameterInfo): We only have an empty set of types if both
19542         fixed and array are set to null.
19543         (GetParameterInfo-idx): Handle FixedParameter == null
19544
19545         * cs-parser.jay: Handle the case where there is no catch
19546         statements (missing null test).
19547
19548 2002-02-22  Miguel de Icaza  <miguel@ximian.com>
19549
19550         * driver.cs (MainDriver): Be conservative on our command line
19551         handling.
19552
19553         Catch DirectoryNotFoundException when calling GetFiles.
19554
19555         (SplitPathAndPattern): Used to split the input specification into
19556         a path and a pattern that we can feed to Directory.GetFiles.
19557
19558 2002-02-21  Miguel de Icaza  <miguel@ximian.com>
19559
19560         * statement.cs (Fixed): Implement the last case of the Fixed
19561         statement (string handling).
19562
19563         * expression.cs (StringPtr): New class used to return a char * to
19564         a string;  Used by the Fixed statement.
19565
19566         * typemanager.cs: Add char_ptr_type.  Add get_OffsetToStringData method.
19567
19568         * expression.cs (Binary.ResolveOperator): Remove redundant
19569         MemberLookup pn parent type.
19570         Optimize union call, we do not need a union if the types are the same.
19571         (Unary.ResolveOperator): REmove redundant MemberLookup on parent
19572         type.
19573
19574         Specialize the use of MemberLookup everywhere, instead of using
19575         the default settings. 
19576
19577         (StackAlloc): Implement stackalloc keyword.
19578
19579         * cs-parser.jay: Add rule to parse stackalloc.
19580
19581         * driver.cs: Handle /h, /help, /?
19582
19583         * expression.cs (MakeByteBlob): Removed the hacks we had in place
19584         before we supported unsafe code.
19585
19586         * makefile: add --unsafe to the self compilation of mcs.
19587
19588 2002-02-20  Miguel de Icaza  <miguel@ximian.com>
19589
19590         * expression.cs (PointerArithmetic): New class that is used to
19591         perform pointer arithmetic.
19592         (Binary.Resolve): Handle pointer arithmetic
19593         Handle pointer comparission.
19594         (ArrayPtr): Utility expression class that is used to take the
19595         address of an array.
19596
19597         (ElementAccess): Implement array access for pointers
19598
19599         * statement.cs (Fixed): Implement fixed statement for arrays, we
19600         are missing one more case before we are done.
19601
19602         * expression.cs (Indirection): Implement EmitAssign and set the
19603         ExprClass to Variable.  This allows pointer dereferences to be
19604         treated as variables, and to have values assigned to them.
19605
19606         * ecore.cs (Expression.StoreFromPtr): New utility function to
19607         store values dereferencing.
19608
19609 2002-02-20  Ravi Pratap  <ravi@ximian.com>
19610
19611         * expression.cs (Binary.ResolveOperator): Ensure that we are
19612         not trying to operate on a void type - this fixes the reported
19613         bug.
19614
19615         * decl.cs (CheckMethodAgainstBase): Do not allow overriding if
19616         the parent implementation is sealed.
19617
19618         * ../errors/cs0239.cs : Add.
19619
19620         * attribute.cs (ApplyAttributes): Handle Modulebuilders too.
19621
19622         * typemanager.cs (unverifiable_code_type): Corresponds to 
19623         System.Security.UnverifiableCodeAttribute. We need to emit this for modules
19624         which have unsafe code in them.
19625
19626         * rootcontext.cs (EmitCode): Emit the above attribute when we are in an 
19627         unsafe context.
19628
19629 2002-02-19  Miguel de Icaza  <miguel@ximian.com>
19630
19631         * cs-tokenizer.cs: Add support for @"litreal strings"
19632
19633         Make tokenizer accept pre-processor directives
19634         on any column (remove the old C-like limitation). 
19635
19636         * rootcontext.cs (EmitCode): Emit any global attributes.
19637         (AddGlobalAttributes): Used to keep track of assembly attributes. 
19638
19639         * attribute.cs (ApplyAttributes): Support AssemblyAttributes.
19640
19641         * cs-parser.jay: Add support for global attributes.  
19642
19643 2002-02-17  Miguel de Icaza  <miguel@ximian.com>
19644
19645         * expression.cs (Indirection): New helper class.  Unary will
19646         create Indirection classes to be able to implement the
19647         IMemoryLocation interface on it.
19648
19649 2002-02-16  Miguel de Icaza  <miguel@ximian.com>
19650
19651         * cs-parser.jay (fixed_statement): reference the right statement.
19652
19653         * statement.cs (Fixed.Emit): Finish implementing the fixed
19654         statement for the &x case.
19655
19656 2002-02-14  Miguel de Icaza  <miguel@ximian.com>
19657
19658         * class.cs (Property.Define, Method.Define): Remove newslot when
19659         `implementing'.  
19660
19661         * modifiers.cs: My use of NewSlot when `Abstract' was set was
19662         wrong.  NewSlot should only be used if the `new' keyword is present.
19663
19664         * driver.cs (GetSystemDir): Use CodeBase instead of FullName for
19665         locating our system dir.  Sorry about this.
19666
19667 2002-02-13  Miguel de Icaza  <miguel@ximian.com>
19668
19669         * driver.cs (GetSystemDir): Compute correctly the location of our
19670         system assemblies.  I was using the compiler directory instead of
19671         the library directory.
19672
19673 2002-02-13  Ravi Pratap  <ravi@ximian.com>
19674
19675         * expression.cs (BetterFunction): Put back in what Miguel commented out
19676         since it is the correct fix. The problem is elsewhere ;-)
19677
19678         (IsParamsMethodApplicable): Fix bug where we were not checking that the fixed
19679         parameters of the parms method are themselves compatible or not !
19680
19681         (StandardConversionExists): Fix very dangerous bug where we were forgetting
19682         to check that a class implements an interface before saying that an implicit
19683         conversion was allowed. Use ImplementsInterface to do the checking.
19684
19685 2002-02-13  Miguel de Icaza  <miguel@ximian.com>
19686
19687         * class.cs (Method.Define): Track whether we are an explicit
19688         implementation or not.  And only call DefineMethodOverride if we
19689         are an explicit implementation.
19690
19691         (Property.DefineMethod): Ditto.
19692
19693 2002-02-11  Ravi Pratap  <ravi@ximian.com>
19694
19695         * expression.cs (BetterFunction): Catch hideous bug which was
19696          preventing us from detecting ambiguous calls due to implicit casts i.e
19697         cs0121.
19698
19699 2002-01-29  Miguel de Icaza  <miguel@ximian.com>
19700
19701         * support.cs (Pair): Remove un-needed method.  I figured why I was
19702         getting the error in cs-parser.jay, the variable in a foreach loop
19703         is readonly, and the compiler does not really treat this as a variable.
19704
19705         * cs-parser.jay (fixed_statement): Fix grammar.  Use ASSIGN
19706         instead of EQUALS in grammar.  
19707
19708         * typemanager.cs (VerifyUnmanaged): Report correct error (208)
19709
19710         * expression.cs (Unary.DoResolve): Check whether the argument is
19711         managed or not.
19712
19713 2002-01-28  Miguel de Icaza  <miguel@ximian.com>
19714
19715         * support.cs: Api for Pair to set a value.  Despite the fact that
19716         the variables are public the MS C# compiler refuses to compile
19717         code that accesses the field if the variable is part of a foreach
19718         statement. 
19719
19720         * statement.cs (Fixed): Begin implementation of the fixed
19721         statement.
19722
19723         (Block.AddVariable): Return the VariableInfo on success and null
19724         on failure instead of true/false. 
19725
19726         * cs-parser.jay (foreach): Catch errors on variables already
19727         defined (we were ignoring this value before) and properly unwind
19728         the block hierarchy
19729
19730         (fixed_statement): grammar for the fixed statement.
19731
19732 2002-01-25  Miguel de Icaza  <miguel@ximian.com>
19733
19734         * expression.cs (UnaryMutator.IsIncrementableNumber): Allow also
19735         pointer types to be incretemented.
19736
19737         (SizeOf): Implement.
19738
19739         * cs-parser.jay (pointer_member_access): Implement
19740         expr->IDENTIFIER production.
19741
19742         * expression.cs (IndexerAccess.DoResolve, ArrayAccess.DoResolve,
19743         MemberAccess.DoResolve, Invocation.DoResolve): Check for pointers
19744         on safe contexts.
19745
19746         (Unary): Implement indirection.
19747
19748         * ecore.cs (Expression.UnsafeError): Reports error 214 (pointer
19749         use in non-unsafe context).
19750
19751         (SimpleName.DoResolve): Check for pointers in field access on safe
19752         contexts. 
19753
19754         (Expression.LoadFromPtr): Factor the load-indirect code in this
19755         function.  This was duplicated in UnboxCast and ParameterReference
19756
19757 2002-01-24  Miguel de Icaza  <miguel@ximian.com>
19758
19759         * expression.cs (ComposedCast): report an error if a pointer cast
19760         is used in a safe region.
19761
19762         * ecore.cs (Expression.ConvertExplicit): Add rules for implicit
19763         pointer type casts in unsafe context.
19764
19765         * codegen.cs (EmitContext): Set up IsUnsafe.
19766
19767         * cs-parser.jay (non_expression_type): Add productions for pointer
19768         casts. 
19769
19770         * expression.cs (Invocation.EmitCall): Remove chunk of buggy
19771         code.  We should not use force into static mode if the method is
19772         not virtual.  Fixes bug in MIS
19773
19774         * statement.cs (Do.Emit, While.Emit, For.Emit,
19775         Statement.EmitBoolExpression): Add support to Do and While to
19776         propagate infinite loop as `I do return' semantics.
19777
19778         Improve the For case to also test for boolean constants.
19779
19780         * attribute.cs (Attribute.ApplyAttributes): Add ParameterBuilder
19781         to the list of attributes we can add.
19782
19783         Remove `EmitContext' argument.
19784
19785         * class.cs (Method.Define): Apply parameter attributes.
19786         (Constructor.Define): Apply parameter attributes.
19787         (MethodCore.LabelParameters): Move here the core of labeling
19788         parameters. 
19789
19790         * support.cs (ReflectionParameters.ParameterModifier,
19791         InternalParameters.ParameterModifier): Use IsByRef on the type and
19792         only return the OUT bit for these parameters instead of in/out/ref
19793         flags.
19794
19795         This is because I miss-understood things.  The ParameterInfo.IsIn
19796         and IsOut represent whether the parameter has the [In] and [Out]
19797         attributes set.  
19798
19799 2002-01-22  Miguel de Icaza  <miguel@ximian.com>
19800
19801         * ecore.cs (FieldExpr.Emit): Release temporaries.
19802
19803         * assign.cs (LocalTemporary.Release): new function.
19804
19805         * codegen.cs (EmitContext.GetTemporaryStorage,
19806         EmitContext.FreeTemporaryStorage): Rework the way we deal with
19807         temporary storage.  Now we can "put back" localbuilders when we
19808         are done with them
19809
19810 2002-01-21  Miguel de Icaza  <miguel@ximian.com>
19811
19812         * ecore.cs (FieldExpr.Emit): Handle initonly fields specially: we
19813         need to make a copy of the variable to generate verifiable code.
19814
19815 2002-01-19  Miguel de Icaza  <miguel@ximian.com>
19816
19817         * driver.cs: Compute dynamically the system directory.
19818
19819         * ecore.cs (CopyNewMethods): reworked, exposed, made public.
19820         Slower, but more generally useful.  Used by the abstract
19821         registering implementation. 
19822
19823         * expression.cs (ResolveMemberAccess): Reorder the way we evaluate
19824         the rules for the special rule on Type/instances.  First check if
19825         we have the same name, and if so, try that special static path
19826         rather than the instance path.
19827
19828 2002-01-18  Miguel de Icaza  <miguel@ximian.com>
19829
19830         * cs-parser.jay: Emit 642 (warning: possible empty statement) for
19831         for, while and if.
19832
19833         * class.cs (TypeBuilder.DefineType): Do not allow inheritance from
19834         Enum, ValueType, Delegate or Array for non-corlib compiles.
19835
19836         * cs-tokenizer.cs: Catch long identifiers (645)
19837
19838         * typemanager.cs (IndexerPropetyName): Ravi never tested this
19839         piece of code.
19840
19841         * class.cs (TypeContainer.RegisterRequiredImplementations): Bug
19842         fix, we were returning too early, so we were not registering
19843         pending methods from abstract classes.
19844
19845         Do not register pending methods if the class is abstract.
19846
19847         * expression.cs (Conditional.DoResolve): Report circular implicit
19848         conversions when we neecd to compute it for conditional
19849         expressions. 
19850
19851         (Is.DoResolve): If the expression is always of the provided type,
19852         flag warning 183.  If the expression can not ever be of the
19853         provided type flag warning 184.
19854
19855         * class.cs: Catch 169 as well.
19856
19857         * ecore.cs (FieldExpr): For now in AddressOf mark as assigned and
19858         read. 
19859
19860 2002-01-18  Nick Drochak  <ndrochak@gol.com>
19861
19862         * makefile: remove path to beta2 csc.exe.  path to csc.exe must be in PATH instead.
19863
19864 2002-01-17  Miguel de Icaza  <miguel@ximian.com>
19865
19866         * interface.cs: (PopulateMethod): Check for pointers being defined
19867         only if the unsafe context is active.
19868         (PopulateProperty): ditto.
19869         (PopulateIndexer): ditto.
19870
19871         * class.cs (Method, Method.Define): Allow `unsafe' modifier to be
19872         specified.  If pointers are present, make sure that they are
19873         present in an unsafe context.
19874         (Constructor, Constructor.Define): ditto.
19875         (Field, Field.Define): ditto.
19876         (Property, Property.Define): ditto.
19877         (Event, Event.Define): ditto.
19878
19879         * interface.cs (Interface.GetInterfaceTypeByName): Only lookup the
19880         hashtable if there are classes or structs defined.
19881
19882         * expression.cs (LocalVariableReference.DoResolve): Simplify this
19883         code, as the constant resolution moved.
19884
19885         * statement.cs (Block.EmitMeta): Resolve all constants as we emit
19886         the metadata, so we can flag error 133. 
19887
19888         * decl.cs (MemberCore.UnsafeOK): New function to test that a
19889         pointer is being declared in an unsafe context.
19890
19891 2002-01-16  Miguel de Icaza  <miguel@ximian.com>
19892
19893         * modifiers.cs (Modifiers.Check): Require a Location argument.
19894         Report error 227 for Unsafe use.
19895
19896         * typemanager.cs: Remove IsPointerType, we should be using Type.IsPointer
19897
19898         * statement.cs (For.Emit): If the test is null, then report that
19899         we do `return', as we wont reach anything afterwards.
19900
19901         (Switch.SwitchGoverningType): Track the expression that matched
19902         the conversion.
19903
19904         * driver.cs: Allow negative numbers as an error code to flag.
19905
19906         * cs-parser.jay: Handle 1551.
19907
19908         * namespace.cs: Add 1537 checking (repeated using alias namespaces).
19909
19910 2002-01-15  Miguel de Icaza  <miguel@ximian.com>
19911
19912         * cs-parser.jay: Report 1518 (type declaration can only contain
19913         class, struct, interface, enum or delegate)
19914
19915         (switch_label): Report 1523 (keywords `case' or `default' must
19916         preced code)
19917
19918         (opt_switch_sections): Report 1522 (empty switch)
19919
19920         * driver.cs: Report 1515 (response file specified multiple times)
19921         Report 1516 (Source file specified multiple times).
19922
19923         * expression.cs (Argument.Resolve): Signal 1510
19924
19925         (BaseAccess.Resolve, BaseIndexer.Resolve): Signal 1511 (base
19926         access not allowed in static code)
19927
19928 2002-01-11  Ravi Pratap  <ravi@ximian.com>
19929
19930         * typemanager.cs (IsPointerType): Utility method which we are going
19931         to need a lot.
19932
19933         * ecore.cs (ImplicitReferenceConversion): A pointer type cannot be cast to
19934         the object type, so we take care of that.
19935
19936         * expression.cs (FullMethodDesc): Also include the return type in descriptions.
19937
19938         * support.cs (ParameterDesc): Fix minor bug which was causing params tags to be
19939         added to non-params parameters :-)
19940
19941         * typemanager.cs (CSharpName): Include 'void' type too. 
19942
19943         (void_ptr_type): Include in the set of core types.
19944
19945         * ecore.cs (ConvertImplicit): Make use of ConvertImplicitStandard instead of 
19946         duplicating code.
19947
19948         (ConvertImplicitStandard): Handle standard implicit pointer conversions when we have 
19949         an unsafe context.
19950
19951         * cs-parser.jay (local_variable_pointer_type): Add support for 'void *' as I had 
19952         completely forgotten about it.
19953
19954 2002-01-10  Ravi Pratap  <ravi@ximian.com>
19955
19956         * cs-parser.jay (pointer_type): Add. This begins our implementation
19957         of parsing rules for unsafe code.
19958
19959         (unsafe_statement): Implement.
19960
19961         (embedded_statement): Modify to include the above.
19962
19963         * statement.cs (Unsafe): Implement new class for unsafe blocks.
19964
19965         * codegen.cs (EmitContext.InUnsafe): Add. This determines
19966         if the current context is an unsafe one.
19967
19968         * cs-parser.jay (local_variable_pointer_type): Since local variable types
19969         are handled differently, we need separate rules for them.
19970
19971         (local_variable_declaration): Update to use local_variable_pointer_type
19972         to allow variable declarations of unmanaged pointer types.
19973
19974         * expression.cs (Unary.ResolveOperator): Ensure that the '&' operator is used only
19975         in unsafe contexts.
19976
19977         * ../errors/cs0214.cs : Add.
19978
19979 2002-01-16  Nick Drochak  <ndrochak@gol.com>
19980
19981         * makefile: remove 'response' file when cleaning.
19982
19983 2002-01-15  Miguel de Icaza  <miguel@ximian.com>
19984
19985         * cs-parser.jay: Report 1524.
19986
19987 2002-01-14  Miguel de Icaza  <miguel@ximian.com>
19988
19989         * typemanager.cs (RegisterMethod): drop checking if we have
19990         registered this from here
19991
19992 2002-01-12  Miguel de Icaza  <miguel@ximian.com>
19993
19994         * class.cs (Method.EmitDestructor): Implement calling our base
19995         destructor. 
19996
19997         * statement.cs (Try.Emit): Fix to reset the InFinally to the old
19998         value of InFinally.
19999
20000         * codegen.cs (EmitContext.EmitTopBlock): Destructors will call
20001         this routine and will wrap the call in a try/catch block.  Deal
20002         with the case.
20003
20004 2002-01-11  Miguel de Icaza  <miguel@ximian.com>
20005
20006         * ecore.cs (Expression.MemberLookup): instead of taking a
20007         parameter `same_type' that was used to tell whether we could
20008         access private members we compute our containing type from the
20009         EmitContext.
20010
20011         (FieldExpr): Added partial support for volatile fields.  This does
20012         not work for volatile fields exposed from assemblies, as I can not
20013         figure out how to extract the modreq from it.
20014
20015         Updated all the source files to use this.
20016
20017         * codegen.cs (EmitContext): Compute ContainerType ahead of time,
20018         because it is referenced by MemberLookup very often. 
20019
20020 2002-01-09  Ravi Pratap  <ravi@ximian.com>
20021
20022         * typemanager.cs (IndexerPropertyName): If we have a TypeBuilder, use
20023         TypeBuilder.GetCustomAttributes to retrieve what we need.
20024
20025         Get rid of redundant default_member_attr_type as this is the same as
20026         default_member_type which already exists.
20027
20028         * interface.cs, attribute.cs : Update accordingly.
20029
20030 2002-01-08  Miguel de Icaza  <miguel@ximian.com>
20031
20032         * typemanager.cs: Enable IndexerPropertyName again.  It does not
20033         work for TYpeBuilders though.  Ravi, can you please fix this?
20034
20035         * cs-tokenizer.cs: Accept _ as a name in pp-expressions.
20036
20037         * expression.cs (Argument.Emit): Handle the case of ref objects
20038         being passed to ref functions;  
20039
20040         (ParameterReference.EmitLoad): Loads the content of the pointer
20041         without dereferencing.
20042
20043 2002-01-07  Miguel de Icaza  <miguel@ximian.com>
20044
20045         * cs-tokenizer.cs: Implemented the pre-processing expressions.
20046
20047 2002-01-08  Ravi Pratap  <ravi@ximian.com>
20048
20049         * class.cs (Indexer.DefineMethod): Incorporate the interface
20050         type in the name of the method if we are doing explicit interface
20051         implementation.
20052
20053         * expression.cs (ConversionExists): Remove as it is completely obsolete.
20054
20055         (BetterConversion): Fix extremely trivial bug where we were referring to
20056         ConversionExists instead of StandardConversionExists ! Hooray, things are fine
20057         again !
20058
20059         * ../errors/bug16.cs : Add although we have fixed it.
20060
20061 2002-01-07  Miguel de Icaza  <miguel@ximian.com>
20062
20063         * expression.cs (BaseIndexer): Begin implementation.
20064
20065         * class.cs (TypeContainer.IsInterfaceMethod): Bug fix.
20066
20067         * cs-parser.jay (indexer_declarator): Use qualified_identifier
20068         production directly to remove a shift/reduce, and implement
20069         explicit interface implementation.
20070
20071         * cs-tokenizer.cs: Fix tokenizer, it was consuming one extra char
20072         after a floating point suffix.
20073
20074         * expression.cs (DoNumericPromotions): Improved the conversion for
20075         uint/uint.  If we have a constant, we avoid doing a typecast to a
20076         larger type.
20077
20078         * class.cs (Indexer): Implement explicit interface implementation
20079         for indexers.
20080
20081 Sat Jan 5 16:08:23 CET 2002 Paolo Molaro <lupus@ximian.com>
20082
20083         * class.cs: make the default instance constructor public and hidebysig.
20084
20085 2001-01-03  Ravi Pratap  <ravi@ximian.com>
20086
20087         * interface.cs (EmitDefaultMemberAttr): Make this helper method static
20088         so we can call it from elsewhere.
20089
20090         * class.cs (TypeContainer.Emit): Emit the attribute here too. The rule is that
20091         we emit it internally if the class has a defined indexer; otherwise the user
20092         emits it by decorating the class definition with the DefaultMemberAttribute.
20093
20094         * attribute.cs (ApplyAttributes): Perform checks to see that the DefaultMember
20095         attribute is not used on a type which defines an indexer.
20096
20097         * cs-tokenizer.cs (get_cmd_arg): Ensure we trim whitespace and also include the tab
20098         character when we skip whitespace.
20099
20100         * ../errors/cs0646.cs : Add.
20101
20102 2002-01-03  Miguel de Icaza  <miguel@ximian.com>
20103
20104         * ecore.cs (SimpleName.ResolveSimpleName): Report error 120
20105         again. 
20106
20107         * makefile: Add practical target `mcs3.exe' which builds the third
20108         generation compiler. 
20109
20110         * expression.cs (New): Fix structures constructor calling.
20111
20112         * class.cs (Property, Method, Indexer): Emit Final flag on the
20113         method if we are an interface implementation and we are not
20114         abstract. 
20115
20116         * ecore.cs (PropertyExpr): New public field `IsBase', tells
20117         whether this property is referencing a `base' method.
20118
20119         * expression.cs (Invocation.EmitCall): take an extra argument:
20120         is_base, this is used to determine whether the `call' or
20121         `callvirt' opcode should be used.
20122
20123
20124         * delegate.cs: update EmitCall.
20125
20126         * class.cs (Method.Define): Set NewSlot for the cases where we are
20127         not implementing an interface method.
20128
20129         (Property.Define): ditto.
20130
20131 2002-01-02  Miguel de Icaza  <miguel@ximian.com>
20132
20133         * cs-tokenizer.cs: (Tokenizer.escape): Escape '\r' as '\r' not as
20134         'r'.  Allows mcs to parse itself fully.
20135
20136 2002-01-02  Ravi Pratap  <ravi@ximian.com>
20137
20138         * expression.cs (ArrayCreation.num_automatic_initializers): Keep track
20139         of the number of initializers that require the InitializeArray method.
20140
20141         (CheckIndices): Store the Expression in all cases - not the plain value. Also
20142         update the above field where necessary.
20143
20144         (MakeByteBlob): Update accordingly.
20145
20146         (DoEmit): Call EmitStaticInitializers only if the number of initializers is 
20147         greater than 2.
20148
20149         (EmitDynamicInitializers): Update in accordance with the new optimization.
20150
20151         (ArrayAccess.EmitStoreOpcode): Include char type along with short and ushort - the
20152         same OpCode applies.
20153
20154         * cs-parser.jay : Fix some glaring errors I introduced.
20155
20156 2002-01-01  Ravi Pratap  <ravi@ximian.com> 
20157
20158         * parameters.cs (AddVariable, AddConstant): Pass in current_local_parameters
20159         so that we can check for name clashes there too.
20160
20161         * typemanager.cs (default_member_attr_type): The attribute that we need to emit
20162         for interface indexers.
20163
20164         * interfaces.cs (Define): Emit the default member attribute.
20165
20166         * expression.cs (MakeByteBlob): Fix extremely trivial bug where the wrong
20167         variable was being referred to while setting the value ;-)
20168
20169 2002-01-01  Miguel de Icaza  <miguel@ximian.com>
20170
20171         * expression.cs (MakeByteBlob): Optimize: we do not need to fill
20172         byte-by-byte information when we know the data is zero.
20173
20174         Make the block always a multiple of 4, because
20175         DefineInitializedData has a bug.
20176
20177         * assign.cs: Fix, we should assign from the temporary, not from
20178         the source. 
20179
20180         * expression.cs (MakeByteBlob): Fix my incorrect code.
20181
20182 2001-12-31  Miguel de Icaza  <miguel@ximian.com>
20183
20184         * typemanager.cs (EnumToUnderlying): This function is used to get
20185         the underlying type from an enumeration, because it does not
20186         always work. 
20187
20188         * constant.cs: Use the I4_S form for values between -128 and 127.
20189
20190         * statement.cs (Block.LookupLabel): Looks up a label.
20191         (Block): Drop support for labeled blocks.
20192
20193         (LabeledStatement): New kind of statement that represents a label
20194         only.
20195
20196         (Goto): Finally implement this bad boy.
20197
20198         * cs-parser.jay: Update to reflect new mechanism to implement
20199         labels.
20200
20201 2001-12-30  Miguel de Icaza  <miguel@ximian.com>
20202
20203         * codegen.cs (EmitContext.This): a codegen property that keeps the
20204         a single instance of this instead of creating many different this
20205         instances. 
20206
20207         * delegate.cs (Delegate.DoResolve): Update to use the property;
20208
20209         * ecore.cs (SimpleName.SimpleNameResolve): Ditto
20210
20211         * expression.cs (BaseAccess.DoResolve): Ditto.
20212
20213 2001-12-29  Ravi Pratap  <ravi@ximian.com>
20214
20215         * typemanager.cs (methodimpl_attr_type): Add to hold the type
20216         corresponding to System.Runtime.CompilerServices.MethodImplAttribute.
20217
20218         (InitCoreTypes): Update accordingly.
20219
20220         * attribute.cs (Resolve): Remember if the attribute is a MethodImplAttribute
20221         so we can quickly store the state.
20222
20223         (ApplyAttributes): Set the correct implementation flags
20224         for InternalCall methods.
20225
20226 2001-12-29  Miguel de Icaza  <miguel@ximian.com>
20227
20228         * expression.cs (EmitCall): if a method is not virtual, then do
20229         not use callvirt on it.
20230
20231         (ArrayAccess.EmitAssign): storing non-builtin value types (ie,
20232         user defined stuff) requires the use of stobj, which takes an
20233         address on the stack instead of an array and an index.  So emit
20234         the Ldelema operation for it.
20235
20236         (EmitStoreOpcode): Use stobj for valuetypes.
20237
20238         (UnaryMutator.EmitCode): Use the right 1 value depending on
20239         whether we are dealing with int64/uint64, float or doubles.
20240
20241         * class.cs (TypeContainer.AddConstructor): Fix the logic to define
20242         constructors that I implemented last night.
20243
20244         (Constructor.IsDefault): Fix to work properly for static
20245         constructors.
20246
20247         * cs-parser.jay (CheckDef): report method signature errors.
20248         Update error number 103 to be 132.
20249
20250         * decl.cs: New AdditionResult enumeration value: MethodExists.
20251         Although we do this check for methods later on in the semantic
20252         analysis, catching repeated default constructors is so easy that
20253         we catch these here. 
20254
20255         * expression.cs (Binary.DoNumericPromotions): Fix the uint64 type
20256         promotions code.
20257
20258         (ParameterReference.EmitAssign, Emit): handle
20259         bools as bytes.
20260
20261         (ArrayAccess.EmitLoadOpcode): Handle bool type here.
20262         (ArrayAccess.EmitStoreOpcode): ditto.
20263
20264         * cs-tokenizer.cs (is_punct): Eliminated empty computation.
20265
20266         * expression.cs (MakeByteBlob): Complete all the missing types
20267         (uint, short, ushort, byte, sbyte)
20268
20269         * class.cs: Only init instance field initializers on instance
20270         constructors. 
20271
20272         Rename `constructors' to instance_constructors. 
20273
20274         (TypeContainer.AddConstructor): Only add constructors to the list
20275         if it is not static.
20276
20277         Make sure that we handle default_static_constructor independently
20278         everywhere where we handle instance_constructors
20279
20280 2001-12-28  Miguel de Icaza  <miguel@ximian.com>
20281
20282         * class.cs: Do not lookup or create a base initializer for a
20283         static constructor.
20284
20285         (ConstructorInitializer.Resolve): use the proper type to lookup
20286         for constructors.
20287
20288         * cs-parser.jay: Report error 1585 (modifiers between type and name).
20289
20290         * enum.cs, interface.cs: Remove CloseType, this is taken care by
20291         in DeclSpace. 
20292
20293         * decl.cs: CloseType is now an virtual method, the default
20294         implementation just closes this type.
20295
20296 2001-12-28  Ravi Pratap  <ravi@ximian.com>
20297
20298         * attribute.cs (DefinePInvokeMethod): Set the implementation flags
20299         to PreserveSig by default. Also emit HideBySig on such methods.
20300
20301         Basically, set the defaults to standard values.
20302
20303         * expression.cs (Invocation.BetterFunction): We need to make sure that for each
20304         argument, if candidate is better, it can't be worse than the best !
20305
20306         (Invocation): Re-write bits to differentiate between methods being
20307         applicable in their expanded form and their normal form - for params
20308         methods of course.
20309
20310         Get rid of use_standard everywhere as only standard conversions are allowed
20311         in overload resolution. 
20312
20313         More spec conformance.
20314
20315 2001-12-27  Miguel de Icaza  <miguel@ximian.com>
20316
20317         * driver.cs: Add --timestamp, to see where the compiler spends
20318         most of its time.
20319
20320         * ecore.cs (SimpleName.DoResolve): Do not create an implicit
20321         `this' in static code.
20322
20323         (SimpleName.DoResolve): Implement in terms of a helper function
20324         that allows static-references to be passed upstream to
20325         MemberAccess.
20326
20327         (Expression.ResolveWithSimpleName): Resolve specially simple
20328         names when called by MemberAccess to implement the special
20329         semantics. 
20330
20331         (Expression.ImplicitReferenceConversion): Handle conversions from
20332         Null to reference types before others, as Null's type is
20333         System.Object. 
20334
20335         * expression.cs (Invocation.EmitCall): Handle the special case of
20336         calling methods declared on a reference type from a ValueType
20337         (Base classes System.Object and System.Enum)
20338
20339         (MemberAccess.Resolve): Only perform lookups on Enumerations if
20340         the left hand side is a TypeExpr, not on every enumeration. 
20341
20342         (Binary.Resolve): If types are reference types, then do a cast to
20343         object on operators != and == of both arguments.
20344
20345         * typemanager.cs (FindMembers): Extract instance and static
20346         members if requested.
20347
20348         * interface.cs (PopulateProperty): Use void_type instead of null
20349         as the return type for the setter method.
20350
20351         (PopulateIndexer): ditto.
20352
20353 2001-12-27  Ravi Pratap  <ravi@ximian.com>
20354
20355         * support.cs (ReflectionParameters): Fix minor bug where we
20356         were examining the wrong parameter for the ParamArray attribute.
20357
20358         Cope with requests for the type of the parameter at position
20359         greater than the params parameter's. We now return the element
20360         type of the params array as that makes more sense.
20361
20362         * expression.cs (Invocation.IsParamsMethodApplicable): Update 
20363         accordingly as we no longer have to extract the element type
20364         ourselves.
20365
20366         (Invocation.OverloadResolve): Update.
20367
20368 2001-12-27  Miguel de Icaza  <miguel@ximian.com>
20369
20370         * statement.cs (Foreach.GetEnumeratorFilter): Do not compare
20371         against IEnumerator, test whether the return value is a descendant
20372         of the IEnumerator interface.
20373
20374         * class.cs (Indexer.Define): Use an auxiliary method to implement
20375         the other bits of the method definition.  Begin support for
20376         explicit interface implementation.
20377
20378         (Property.DefineMethod): Use TypeManager.void_type instead of null
20379         for an empty return value.
20380
20381 2001-12-26  Miguel de Icaza  <miguel@ximian.com>
20382
20383         * expression.cs (MemberAccess.ResolveMemberAccess): if we are
20384         dealing with a FieldExpr which is composed of a FieldBuilder, in
20385         the code path we did extract the constant, but we should have
20386         obtained the underlying value to be able to cast it (otherwise we
20387         end up in an infinite loop, this is what Ravi was running into).
20388
20389         (ArrayCreation.UpdateIndices): Arrays might be empty.
20390
20391         (MemberAccess.ResolveMemberAccess): Add support for section
20392         14.5.4.1 that deals with the special case of E.I when E is a type
20393         and something else, that I can be a reference to a static member.
20394
20395         (ArrayCreation.MakeByteBlob): It is not an error to not be able to
20396         handle a particular array type to create byte blobs, it is just
20397         something we dont generate byteblobs for.
20398
20399         * cs-tokenizer.cs (get_cmd_arg): Ignore \r in commands and
20400         arguments. 
20401
20402         * location.cs (Push): remove the key from the hashtable that we
20403         are about to add.   This happens for empty files.
20404
20405         * driver.cs: Dispose files after we have parsed them.
20406
20407         (tokenize): new function that only runs the tokenizer on its
20408         input, for speed testing.
20409
20410 2001-12-26  Ravi Pratap  <ravi@ximian.com>
20411
20412         * class.cs (Event.Define): Define the private field only if there
20413         are no accessors defined.
20414
20415         * expression.cs (ResolveMemberAccess): If there is no associated
20416         field with the event, that means we have an event defined with its
20417         own accessors and we should flag error cs0070 since transforming
20418         ourselves into a field is not valid in that case.
20419
20420         * ecore.cs (SimpleName.DoResolve): Same as above.
20421
20422         * attribute.cs (DefinePInvokeMethod): Set the default calling convention
20423         and charset to sane values.
20424
20425 2001-12-25  Ravi Pratap  <ravi@ximian.com>
20426
20427         * assign.cs (DoResolve): Perform check on events only if they 
20428         are being accessed outside the declaring type.
20429
20430         * cs-parser.jay (event_declarations): Update rules to correctly
20431         set the type of the implicit parameter etc.
20432
20433         (add_accessor, remove_accessor): Set current local parameters.
20434
20435         * expression.cs (Binary): For delegate addition and subtraction,
20436         cast the return value from the method into the appropriate delegate
20437         type.
20438
20439 2001-12-24  Ravi Pratap  <ravi@ximian.com>
20440
20441         * typemanager.cs (RegisterDelegateData, GetDelegateData): Get rid
20442         of these as the workaround is unnecessary.
20443
20444         * delegate.cs (NewDelegate.DoResolve): Get rid of bits which registered
20445         delegate data - none of that is needed at all.
20446
20447         Re-write bits to extract the instance expression and the delegate method
20448         correctly.
20449
20450         * expression.cs (Binary.ResolveOperator): Handle the '-' binary operator 
20451         on delegates too.
20452
20453         * attribute.cs (ApplyAttributes): New method to take care of common tasks
20454         of attaching attributes instead of duplicating code everywhere.
20455
20456         * everywhere : Update code to do attribute emission using the above method.
20457
20458 2001-12-23  Miguel de Icaza  <miguel@ximian.com>
20459
20460         * expression.cs (IsParamsMethodApplicable): if there are not
20461         parameters, return immediately.
20462
20463         * ecore.cs: The 0 literal can be implicity converted to an enum
20464         type. 
20465
20466         (SimpleName.DoResolve): First lookup the type, then lookup the
20467         members. 
20468
20469         (FieldExpr.Emit): If the InstanceExpression is a ValueType, we
20470         want to get its address.  If the InstanceExpression is not
20471         addressable, store the result in a temporary variable, then get
20472         the address of it.
20473
20474         * codegen.cs: Only display 219 errors on warning level or above. 
20475
20476         * expression.cs (ArrayAccess): Make it implement the
20477         IMemoryLocation interface.
20478
20479         (Binary.DoResolve): handle the operator == (object a, object b)
20480         and operator != (object a, object b) without incurring into a
20481         BoxedCast (because 5 != o should never be performed).
20482
20483         Handle binary enumerator operators.
20484
20485         (EmitLoadOpcode): Use Ldelema if the object we are loading is a
20486         value type, otherwise use Ldelem_ref.
20487
20488         Use precomputed names;
20489
20490         (AddressOf): Implement address of
20491
20492         * cs-parser.jay (labeled_statement): Fix recursive block
20493         addition by reworking the production.
20494
20495         * expression.cs (New.DoEmit): New has a special case:
20496                 
20497                  If we are dealing with a ValueType, we have a few
20498                  situations to deal with:
20499                 
20500                     * The target of New is a ValueType variable, that is
20501                       easy, we just pass this as the variable reference
20502                 
20503                     * The target of New is being passed as an argument,
20504                       to a boxing operation or a function that takes a
20505                       ValueType.
20506                 
20507                       In this case, we need to create a temporary variable
20508                       that is the argument of New.
20509
20510
20511 2001-12-23  Ravi Pratap  <ravi@ximian.com>
20512
20513         * rootcontext.cs (LookupType): Check that current_type is not null before
20514         going about looking at nested types.
20515
20516         * ecore.cs (EventExpr.EmitAddOrRemove): Rename from EmitAssign as we do
20517         not implement the IAssignMethod interface any more.
20518
20519         * expression.cs (MemberAccess.ResolveMemberAccess): Handle EventExprs specially
20520         where we tranform them into FieldExprs if they are being resolved from within
20521         the declaring type.
20522
20523         * ecore.cs (SimpleName.DoResolve): Do the same here.
20524
20525         * assign.cs (DoResolve, Emit): Clean up code considerably. 
20526
20527         * ../errors/bug10.cs : Add.
20528
20529         * ../errors/cs0070.cs : Add.
20530
20531         * typemanager.cs : Use PtrHashtable for Delegate data hashtable etc.
20532
20533         * assign.cs : Get rid of EventIsLocal everywhere.
20534
20535 2001-12-23  Miguel de Icaza  <miguel@ximian.com>
20536
20537         * ecore.cs (ConvertIntLiteral): finished the implementation.
20538
20539         * statement.cs (SwitchLabel): Convert the value we are using as a
20540         key before looking up the table.
20541
20542 2001-12-22  Miguel de Icaza  <miguel@ximian.com>
20543
20544         * codegen.cs (EmitTopBlock): Require a Location argument now.
20545
20546         * cs-parser.jay (constructor_declarator): We need to setup
20547         current_local_parameters before we parse the
20548         opt_constructor_initializer, to allow the variables to be bound
20549         to the constructor arguments.
20550
20551         * rootcontext.cs (LookupType): First lookup nested classes in our
20552         class and our parents before we go looking outside our class.
20553
20554         * expression.cs (ConstantFold): Extract/debox the values at the
20555         beginnning. 
20556
20557         * rootcontext.cs (EmitCode): Resolve the constants first before we
20558         resolve the types.  This is not really needed, but it helps debugging.
20559
20560         * statement.cs: report location.
20561
20562         * cs-parser.jay: pass location to throw statement.
20563
20564         * driver.cs: Small bug fix.
20565
20566         * report.cs: Updated format to be 4-zero filled digits.
20567
20568 2001-12-22  Ravi Pratap  <ravi@ximian.com>
20569
20570         * expression.cs (CheckIndices): Fix minor bug where the wrong
20571         variable was being referred to ;-)
20572
20573         (DoEmit): Do not call EmitStaticInitializers when the 
20574         underlying type is System.Object.
20575
20576 2001-12-21  Ravi Pratap  <ravi@ximian.com>
20577
20578         * ecore.cs (EventExpr.Resolve): Implement to correctly set the type
20579         and do the usual workaround for SRE.
20580
20581         * class.cs (MyEventBuilder.EventType): New member to get at the type
20582         of the event, quickly.
20583
20584         * expression.cs (Binary.ResolveOperator): Handle delegate addition.
20585
20586         * assign.cs (Assign.DoResolve): Handle the case when the target
20587         is an EventExpr and perform the necessary checks.
20588
20589         * ecore.cs (EventExpr.EmitAssign): Implement the IAssignMethod
20590         interface.
20591
20592         (SimpleName.MemberStaticCheck): Include check for EventExpr.
20593
20594         (EventExpr): Set the type in the constructor itself since we 
20595         are meant to be born fully resolved.
20596
20597         (EventExpr.Define): Revert code I wrote earlier.
20598                 
20599         * delegate.cs (NewDelegate.Resolve): Handle the case when the MethodGroup's
20600         instance expression is null. The instance expression is a This in that case
20601         or a null, depending on whether it is a static method or not.
20602
20603         Also flag an error if the reference to a method is ambiguous i.e the MethodGroupExpr
20604         refers to more than one method.
20605
20606         * assign.cs (DoResolve): Check whether the event belongs to the same Type container
20607         and accordingly flag errors.
20608
20609 2001-12-21  Miguel de Icaza  <miguel@ximian.com>
20610
20611         * statement.cs (Throw.Emit): Add support for re-throwing exceptions.
20612
20613 2001-12-22  Miguel de Icaza  <miguel@ximian.com>
20614
20615         * location.cs (ToString): Provide useful rutine.
20616
20617 2001-12-21  Miguel de Icaza  <miguel@ximian.com>
20618
20619         * ecore.cs (Expression.ConvertIntLiteral): Do not return Constant
20620         objects, return the actual integral boxed.
20621
20622         * statement.cs (SwitchLabel): define an ILLabel for each
20623         SwitchLabel. 
20624
20625         (Switch.CheckSwitch): If the value is a Literal, extract
20626         the underlying literal.
20627
20628         Also in the unused hashtable we had, add the SwitchLabel so we can
20629         quickly look this value up.
20630
20631         * constant.cs: Implement a bunch of new constants.  Rewrite
20632         Literal based on this.  Made changes everywhere to adapt to this.
20633
20634         * expression.cs (Expression.MakeByteBlob): Optimize routine by
20635         dereferencing array only once, and also copes with enumrations.
20636
20637         bytes are two bytes wide, not one.
20638
20639         (Cast): Perform constant conversions.
20640
20641         * ecore.cs (TryImplicitIntConversion): Return literals instead of
20642         wrappers to the literals here.
20643
20644         * expression.cs (DoNumericPromotions): long literals can converted
20645         to ulong implicity (this is taken care of elsewhere, but I was
20646         missing this spot).
20647
20648         * ecore.cs (Expression.Literalize): Make the return type Literal,
20649         to improve type checking.
20650
20651         * rootcontext.cs: Lookup for nested classes in our class hierarchy.
20652
20653 2001-12-20  Miguel de Icaza  <miguel@ximian.com>
20654
20655         * literal.cs: Revert code from ravi that checked the bounds.  The
20656         bounds are sane by the definition of the type itself. 
20657
20658         * typemanager.cs: Fix implementation of ImplementsInterface.  We
20659         need to actually look up in our parent hierarchy for interfaces
20660         implemented. 
20661
20662         * const.cs: Use the underlying type for enumerations
20663
20664         * delegate.cs: Compute the basename for the delegate creation,
20665         that should fix the delegate test case, and restore the correct
20666         Type Lookup semantics in rootcontext
20667
20668         * rootcontext.cs: Revert Ravi's last patch.  The correct way of
20669         referencing a nested type with the Reflection API is using the "+"
20670         sign. 
20671
20672         * cs-parser.jay: Do not require EOF token at the end.
20673
20674 2001-12-20  Ravi Pratap  <ravi@ximian.com>
20675
20676         * rootcontext.cs (LookupType): Concatenate type names with
20677         a '.' instead of a '+' The test suite passes again.
20678
20679         * enum.cs (Enum.DefineEnum): Set RTSpecialName on the 'value__'
20680         field of the enumeration.
20681
20682         * expression.cs (MemberAccess.ResolveMemberAccess): Add support for
20683         the case when the member is an EventExpr.
20684
20685         * ecore.cs (EventExpr.InstanceExpression): Every event which is not
20686         static has an associated instance expression.
20687
20688         * typemanager.cs (RegisterEvent): The usual workaround, now for events.
20689
20690         (GetAddMethod, GetRemoveMethod): Workarounds, as usual.
20691
20692         * class.cs (Event.Define): Register event and perform appropriate checks
20693         for error #111.
20694
20695         We define the Add and Remove methods even if the use provides none because
20696         in that case, we provide default implementations ourselves.
20697
20698         Define a private field of the type of the event. This is done by the CSC compiler
20699         and we should be doing it too ;-)
20700
20701         * typemanager.cs (delegate_combine_delegate_delegate, delegate_remove_delegate_delegate):
20702         More methods we use in code we generate.
20703
20704         (multicast_delegate_type, delegate_type): Two separate types since the distinction
20705         is important.
20706
20707         (InitCoreTypes): Update accordingly for the above.
20708
20709         * class.cs (Event.Emit): Generate code for default accessors that we provide
20710
20711         (EmitDefaultMethod): Do the job in the above.
20712
20713         * delegate.cs (DefineDelegate): Use TypeManager.multicast_delegate_type in the 
20714         appropriate place.
20715
20716 2001-12-20  Miguel de Icaza  <miguel@ximian.com>
20717
20718         * class.cs (Indexer.Define): Fix bug, we were setting both Get/Set
20719         builders even if we were missing one.
20720
20721         * interface.cs, class.cs, enum.cs: When calling DefineNestedType
20722         pass the Basename as our class name instead of the Name.  The
20723         basename will be correctly composed for us.
20724
20725         * parameter.cs (Paramters): Now takes a Location argument.
20726
20727         * decl.cs (DeclSpace.LookupType): Removed convenience function and
20728         make all the code call directly LookupType in RootContext and take
20729         this chance to pass the Location information everywhere.
20730
20731         * Everywhere: pass Location information.
20732
20733 2001-12-19  Miguel de Icaza  <miguel@ximian.com>
20734
20735         * class.cs (Constructor.Define): Updated way of detecting the
20736         length of the parameters.
20737
20738         (TypeContainer.DefineType): Use basename as the type name for
20739         nested types.
20740
20741         (TypeContainer.Define): Do not recursively define types here, as
20742         definition is taken care in order by the RootContext.
20743
20744         * tree.cs: Keep track of namespaces in a per-file basis.
20745
20746         * parameter.cs (Parameter.ComputeSignature): Update to use
20747         DeclSpace. 
20748
20749         (Parameters.GetSignature): ditto.
20750
20751         * interface.cs (InterfaceMethod.GetSignature): Take a DeclSpace
20752         instead of a TypeContainer.
20753
20754         (Interface.SemanticAnalysis): Use `this' instead of our parent to
20755         resolve names.  Because we need to be resolve in our context, not
20756         our parents.
20757
20758         * driver.cs: Implement response files.
20759
20760         * class.cs (TypeContainer.DefineType): If we are defined, do not
20761         redefine ourselves.
20762
20763         (Event.Emit): Emit the code for add/remove handlers.
20764         (Event.Define): Save the MethodBuilders for add/remove.
20765
20766         * typemanager.cs: Use pair here too.
20767
20768         * cs-parser.jay: Replaced use of DictionaryEntry for Pair because
20769         DictionaryEntry requires the first argument to be non-null.  
20770
20771         (enum_declaration): Compute full name for registering the
20772         enumeration.
20773
20774         (delegate_declaration): Instead of using
20775         formal_parameter_list, use opt_formal_parameter_list as the list
20776         can be empty.
20777
20778         * cs-tokenizer.cs (PropertyParsing): renamed from `properties'
20779         (EventParsing): New property that controls whether `add' and
20780         `remove' are returned as tokens or identifiers (for events);
20781
20782 2001-12-19  Ravi Pratap  <ravi@ximian.com>
20783
20784         * class.cs (Event.Define): Revamp use of EventBuilder completely. We now
20785         use MyEventBuilder only and let it wrap the real builder for us.
20786
20787         (MyEventBuilder): Revamp constructor etc.
20788
20789         Implement all operations that we perform on EventBuilder in precisely the same
20790         way here too.
20791
20792         (FindMembers): Update to use the EventBuilder member.
20793
20794         (Event.Emit): Update accordingly.
20795
20796 2001-12-18  Ravi Pratap  <ravi@ximian.com>
20797
20798         * class.cs (MyEventBuilder.Set*): Chain to the underlying builder
20799         by calling the appropriate methods.
20800
20801         (GetCustomAttributes): Make stubs as they cannot possibly do anything
20802         useful.
20803
20804         (Event.Emit): Use MyEventBuilder everywhere - even to set attributes.
20805
20806 2001-12-17  Ravi Pratap  <ravi@ximian.com>
20807
20808         * delegate.cs (Delegate.Populate): Check that the return type
20809         and various parameters types are indeed accessible.
20810
20811         * class.cs (Constructor.Define): Same here.
20812
20813         (Field.Define): Ditto.
20814
20815         (Event.Define): Ditto.
20816
20817         (Operator.Define): Check that the underlying Method defined itself
20818         correctly - so it's MethodBuilder should not be null.
20819
20820         * delegate.cs (DelegateInvocation.DoResolve): Bale out if the type of the Instance
20821         expression happens to be null.
20822
20823         * class.cs (MyEventBuilder): Workaround for SRE lameness. Implement various abstract
20824         members but as of now we don't seem to be able to do anything really useful with it.
20825
20826         (FindMembers): Handle events separately by returning the MyEventBuilder of the event,
20827         not the EventBuilder.
20828
20829 2001-12-18  Miguel de Icaza  <miguel@ximian.com>
20830
20831         * cs-tokenizer.cs: Add support for defines.
20832         Add support for #if, #elif, #else, #endif
20833
20834         (eval_var): evaluates a variable.
20835         (eval): stubbed for evaluating functions.
20836
20837         * cs-parser.jay: Pass the defines information
20838
20839         * driver.cs: Add --define command line option.
20840
20841         * decl.cs: Move MemberCore here.
20842
20843         Make it the base class for DeclSpace.  This allows us to catch and
20844         report 108 and 109 for everything now.
20845
20846         * class.cs (TypeContainer.Define): Extract all the members
20847         before populating and emit the warning 108 (new keyword required
20848         to override) instead of having each member implement this.
20849
20850         (MemberCore.Define): New abstract method, we will be using this in
20851         the warning reporting engine in Populate.
20852
20853         (Operator.Define): Adjust to new MemberCore protocol. 
20854
20855         * const.cs (Const): This does not derive from Expression, it is a
20856         temporary object we use to create fields, it is a MemberCore. 
20857
20858         * class.cs (Method.Define): Allow the entry point to be in a
20859         specific class.
20860
20861         * driver.cs: Rewrite the argument handler to clean it up a bit.
20862
20863         * rootcontext.cs: Made it just an auxiliary namespace feature by
20864         making everything static.
20865
20866         * driver.cs: Adapt code to use RootContext type name instead of
20867         instance variable.
20868
20869         * delegate.cs: Remove RootContext argument.
20870
20871         * class.cs: (Struct, TypeContainer, Class): Remove RootContext
20872         argument. 
20873
20874         * class.cs (Event.Define): The lookup can fail.
20875
20876         * cs-tokenizer.cs: Begin implementation of pre-procesor. 
20877
20878         * expression.cs: Resolve the this instance before invoking the code.
20879
20880 2001-12-17  Miguel de Icaza  <miguel@ximian.com>
20881
20882         * cs-parser.jay: Add a production in element_access that allows
20883         the thing to become a "type" reference.  This way we can parse
20884         things like "(string [])" as a type.
20885
20886         Note that this still does not handle the more complex rules of
20887         casts. 
20888
20889
20890         * delegate.cs (Delegate.Populate): Register the delegage constructor builder here. 
20891
20892         * ecore.cs: (CopyNewMethods): new utility function used to
20893         assemble the list of methods from running FindMembers.
20894
20895         (MemberLookup): Rework FindMembers so that 
20896
20897 2001-12-16  Miguel de Icaza  <miguel@ximian.com>
20898
20899         * class.cs (TypeContainer): Remove Delegates who fail to be
20900         defined.
20901
20902         * delegate.cs (Populate): Verify that we dont get null return
20903         values.   TODO: Check for AsAccessible.
20904
20905         * cs-parser.jay: Use basename to emit error 574 (destructor should
20906         have the same name as container class), not the full name.
20907
20908         * cs-tokenizer.cs (adjust_int): Fit the integer in the best
20909         possible representation.  
20910
20911         Also implements integer type suffixes U and L.
20912
20913 2001-12-15  Miguel de Icaza  <miguel@ximian.com>
20914
20915         * expression.cs (ArrayCreation.DoResolve): We need to do the
20916         argument resolution *always*.
20917
20918         * decl.cs: Make this hold the namespace.  Hold the root context as
20919         well.
20920         (LookupType): Move here.
20921
20922         * enum.cs, class.cs, interface.cs: Adapt to new hierarchy.
20923
20924         * location.cs (Row, Name): Fixed the code, it was always returning
20925         references to the first file.
20926
20927         * interface.cs: Register properties defined through interfaces.
20928
20929         * driver.cs: Add support for globbing on the command line
20930
20931         * class.cs (Field): Make it derive from MemberCore as well.
20932         (Event): ditto.
20933
20934 2001-12-15  Ravi Pratap  <ravi@ximian.com>
20935
20936         * class.cs (Event::Define): Check that the type of the event is a delegate
20937         type else flag error #66.
20938
20939         Also, re-use TypeContainer.MethodModifiersValid here too as the rules are the
20940         same.
20941
20942         * attribute.cs (DefinePInvokeMethod): Handle named arguments and process
20943         values of EntryPoint, CharSet etc etc.
20944
20945         Pass in the values to TypeBuilder.DefinePInvokeMethod; determine Type etc neatly.
20946
20947         * class.cs (FindMembers): If a method is in transit, its MethodBuilder will
20948         be null and we should ignore this. I am not sure if this is really clean. Apparently,
20949         there's no way of avoiding hitting this because the call is coming from SimpleName.DoResolve,
20950         which needs this to do its work.
20951
20952         * ../errors/cs0066.cs : Add.
20953
20954 2001-12-14  Miguel de Icaza  <miguel@ximian.com>
20955
20956         * typemanager.cs: (GetPropertyGetter, GetPropertyGetter): New
20957         helper functions.
20958
20959         * class.cs: (MethodSignature.MethodSignature): Removed hack that
20960         clears out the parameters field.
20961         (MemberSignatureCompare): Cleanup
20962
20963         (MemberCore): New base class used to share code between MethodCore
20964         and Property.
20965
20966         (RegisterRequiredImplementations) BindingFlags.Public requires
20967         either BindingFlags.Instace or Static.  Use instance here.
20968
20969         (Property): Refactored code to cope better with the full spec.
20970
20971         * parameter.cs (GetParameterInfo): Return an empty array instead
20972         of null on error.
20973
20974         * class.cs (Property): Abstract or extern properties have no bodies.
20975
20976         * parameter.cs (GetParameterInfo): return a zero-sized array.
20977
20978         * class.cs (TypeContainer.MethodModifiersValid): Move all the
20979         method modifier validation to the typecontainer so we can reuse
20980         this on properties.
20981
20982         (MethodCore.ParameterTypes): return an empty sized array of types.
20983
20984         (Property.Define): Test property modifier validity.
20985
20986         Add tests for sealed/override too.
20987
20988         (Method.Emit): abstract or extern methods have no bodies.
20989
20990 2001-12-14  Ravi Pratap  <ravi@ximian.com>
20991
20992         * class.cs (Method.IsPInvoke): Get rid of it as it is an expensive
20993         thing.
20994
20995         (Method::Define, ::Emit): Modify accordingly.
20996
20997         * expression.cs (Invocation::OverloadResolve): Handle error # 121.
20998
20999         (ArrayCreation::MakeByteBlob): Handle floats and doubles.
21000
21001         * makefile: Pass in /unsafe.
21002
21003 2001-12-13  Miguel de Icaza  <miguel@ximian.com>
21004
21005         * class.cs (MakeKey): Kill routine.
21006
21007         * class.cs (TypeContainer.Define): Correctly define explicit
21008         method implementations (they require the full interface name plus
21009         the method name).
21010
21011         * typemanager.cs: Deply the PtrHashtable here and stop using the
21012         lame keys.  Things work so much better.
21013
21014         This of course broke everyone who depended on `RegisterMethod' to
21015         do the `test for existance' test.  This has to be done elsewhere.
21016
21017         * support.cs (PtrHashtable): A hashtable that avoid comparing with
21018         the object stupid Equals method (because, that like fails all over
21019         the place).  We still do not use it.
21020
21021         * class.cs (TypeContainer.SetRequiredInterface,
21022         TypeContainer.RequireMethods): Killed these two routines and moved
21023         all the functionality to RegisterRequiredImplementations.
21024
21025         (TypeContainer.RegisterRequiredImplementations): This routine now
21026         registers all the implementations required in an array for the
21027         interfaces and abstract methods.  We use an array of structures
21028         which can be computed ahead of time to reduce memory usage and we
21029         also assume that lookups are cheap as most classes will not
21030         implement too many interfaces.
21031
21032         We also avoid creating too many MethodSignatures.
21033
21034         (TypeContainer.IsInterfaceMethod): Update and optionally does not
21035         clear the "pending" bit if we find that there are problems with
21036         the declaration.
21037
21038         (TypeContainer.VerifyPendingMethods): Update to report errors of
21039         methods that look like implementations but are not.
21040
21041         (TypeContainer.Define): Add support for explicit interface method
21042         implementation. 
21043
21044 2001-12-12  Miguel de Icaza  <miguel@ximian.com>
21045
21046         * typemanager.cs: Keep track of the parameters here instead of
21047         being a feature of the TypeContainer.
21048
21049         * class.cs: Drop the registration of parameters here, as
21050         InterfaceMethods are also interface declarations.
21051
21052         * delegate.cs: Register methods with the TypeManager not only with
21053         the TypeContainer.  This code was buggy.
21054
21055         * interface.cs: Full registation here.
21056
21057 2001-12-11  Miguel de Icaza  <miguel@ximian.com>
21058
21059         * expression.cs: Remove reducer for binary expressions, it can not
21060         be done this way.
21061
21062         * const.cs: Put here the code that used to go into constant.cs
21063
21064         * constant.cs: Put here the code for constants, this is a new base
21065         class for Literals.
21066
21067         * literal.cs: Make Literal derive from Constant.
21068
21069 2001-12-09  Miguel de Icaza  <miguel@ximian.com>
21070
21071         * statement.cs (Return.Emit): Report error 157 if the user
21072         attempts to return from a finally block.
21073
21074         (Return.Emit): Instead of emitting a return, jump to the end of
21075         the function.
21076
21077         * codegen.cs (EmitContext): ReturnValue, ReturnLabel: new
21078         LocalBuilder to store the result of the function.  ReturnLabel is
21079         the target where we jump.
21080
21081
21082 2001-12-09  Radek Doulik  <rodo@ximian.com>
21083
21084         * cs-parser.jay: remember alias in current namespace
21085
21086         * ecore.cs (SimpleName::DoResolve): use aliases for types or
21087         namespaces
21088
21089         * class.cs (LookupAlias): lookup alias in my_namespace
21090
21091         * namespace.cs (UsingAlias): add alias, namespace_or_type pair to
21092         aliases hashtable
21093         (LookupAlias): lookup alias in this and if needed in parent
21094         namespaces
21095
21096 2001-12-08  Miguel de Icaza  <miguel@ximian.com>
21097
21098         * support.cs: 
21099
21100         * rootcontext.cs: (ModuleBuilder) Made static, first step into
21101         making things static.  I need this to avoid passing the
21102         TypeContainer when calling ParameterType.
21103
21104         * support.cs (InternalParameters.ParameterType): Remove ugly hack
21105         that did string manipulation to compute the type and then call
21106         GetType.  Use Parameter.ParameterType instead.
21107
21108         * cs-tokenizer.cs: Consume the suffix for floating values.
21109
21110         * expression.cs (ParameterReference): figure out whether this is a
21111         reference parameter or not.  Kill an extra variable by computing
21112         the arg_idx during emission.
21113
21114         * parameter.cs (Parameters.GetParameterInfo): New overloaded
21115         function that returns whether a parameter is an out/ref value or not.
21116
21117         (Parameter.ParameterType): The type of the parameter (base,
21118         without ref/out applied).
21119
21120         (Parameter.Resolve): Perform resolution here.
21121         (Parameter.ExternalType): The full type (with ref/out applied).
21122
21123         * statement.cs (Using.Emit, Using.EmitExpression): Implement
21124         support for expressions on the using statement.
21125
21126 2001-12-07  Miguel de Icaza  <miguel@ximian.com>
21127
21128         * statement.cs (Using.EmitLocalVariableDecls): Split the
21129         localvariable handling of the using statement.
21130
21131         (Block.EmitMeta): Keep track of variable count across blocks.  We
21132         were reusing slots on separate branches of blocks.
21133
21134         (Try.Emit): Emit the general code block, we were not emitting it. 
21135
21136         Check the type of the declaration to be an IDisposable or
21137         something that can be implicity converted to it. 
21138
21139         Emit conversions if required.
21140
21141         * ecore.cs (EmptyExpression): New utility class.
21142         (Expression.ImplicitConversionExists): New utility function.
21143
21144 2001-12-06  Miguel de Icaza  <miguel@ximian.com>
21145
21146         * statement.cs (Using): Implement.
21147
21148         * expression.cs (LocalVariableReference): Support read only variables.
21149
21150         * statement.cs: Remove the explicit emit for the Leave opcode.
21151         (VariableInfo): Add a readonly field.
21152
21153 2001-12-05  Miguel de Icaza  <miguel@ximian.com>
21154
21155         * ecore.cs (ConvCast): new class used to encapsulate the various
21156         explicit integer conversions that works in both checked and
21157         unchecked contexts.
21158
21159         (Expression.ConvertNumericExplicit): Use new ConvCast class to
21160         properly generate the overflow opcodes.
21161
21162 2001-12-04  Miguel de Icaza  <miguel@ximian.com>
21163
21164         * statement.cs: The correct type for the EmptyExpression is the
21165         element_type, not the variable type.  Ravi pointed this out.
21166
21167 2001-12-04  Ravi Pratap  <ravi@ximian.com>
21168
21169         * class.cs (Method::Define): Handle PInvoke methods specially
21170         by using DefinePInvokeMethod instead of the usual one.
21171
21172         * attribute.cs (DefinePInvokeMethod): Implement as this is what is called
21173         above to do the task of extracting information and defining the method.
21174
21175 2001-12-04  Ravi Pratap  <ravi@ximian.com>
21176
21177         * expression.cs (ArrayCreation::EmitStaticInitializers): Get rid
21178         of the condition for string type.
21179
21180         (Emit): Move that here. 
21181
21182         (ArrayCreation::CheckIndices): Keep string literals in their expression
21183         form.
21184
21185         (EmitDynamicInitializers): Handle strings appropriately.
21186
21187 2001-12-04  Miguel de Icaza  <miguel@ximian.com>
21188
21189         * codegen.cs (EmitContext): Replace multiple variables with a
21190         single pointer to the current Switch statement.
21191
21192         * statement.cs (GotoDefault, Switch): Adjust to cleaned up
21193         EmitContext.
21194
21195 2001-12-03  Miguel de Icaza  <miguel@ximian.com>
21196
21197         * statement.cs 
21198
21199         * statement.cs (GotoDefault), cs-parser.jay: Implement `goto
21200         default'.
21201
21202         (Foreach.Emit): Foreach on arrays was not setting
21203         up the loop variables (for break/continue).
21204
21205         (GotoCase): Semi-implented.
21206
21207 2001-12-03  Ravi Pratap  <ravi@ximian.com>
21208
21209         * attribute.cs (CheckAttribute): Handle system attributes by using
21210         Attribute.GetAttributes to examine information we need.
21211
21212         (GetValidPlaces): Same here.
21213
21214         * class.cs (Method::Define): Catch invalid use of extern and abstract together.
21215
21216         * typemanager.cs (dllimport_type): Core type for System.DllImportAttribute.
21217
21218         * class.cs (Method.IsPinvoke): Used to determine if we are a PInvoke method.
21219
21220         (Method::Define): Set appropriate flags if we have a DllImport attribute.
21221
21222         (Method::Emit): Handle the case when we are a PInvoke method.
21223
21224 2001-12-03  Miguel de Icaza  <miguel@ximian.com>
21225
21226         * expression.cs: Use ResolveWithSimpleName on compound names.
21227
21228 2001-12-02  Ravi Pratap  <ravi@ximian.com>
21229
21230         * constant.cs (EmitConstant): Make sure we resolve the associated expression
21231         before trying to reduce it.
21232
21233         * typemanager.cs (RegisterConstant, LookupConstant): Implement.
21234
21235         * constant.cs (LookupConstantValue): Implement.
21236
21237         (EmitConstant): Use the above in emitting the constant.
21238
21239         * expression.cs (MemberAccess::ResolveMemberAccess): Handle constants
21240         that are user-defined by doing a LookupConstantValue on them.
21241
21242         (SimpleName::DoResolve): When we have a FieldExpr, cope with constants
21243         too, like above.
21244
21245 2001-11-29  Miguel de Icaza  <miguel@ximian.com>
21246
21247         * expression.cs (BaseAccess, BaseIndexer): Also split this out.
21248
21249         (BaseAccess.DoResolve): Implement.
21250
21251         (MemberAccess.DoResolve): Split this routine into a
21252         ResolveMemberAccess routine that can be used independently
21253
21254 2001-11-28  Miguel de Icaza  <miguel@ximian.com>
21255
21256         * expression.cs (Probe, Is, As): Split Probe in two classes Is and
21257         As that share bits of the implementation.  Is returns a boolean,
21258         while As returns the Type that is being probed.
21259
21260 2001-12-01  Ravi Pratap  <ravi@ximian.com>
21261
21262         * enum.cs (LookupEnumValue): Re-write various bits, return an object value
21263         instead of a Literal - much easier.
21264
21265         (EnumInTransit): Remove - utterly useless :-)
21266
21267         (Populate): Re-write bits - remove duplicate code etc. The code is much neater now.
21268
21269         * expression.cs (MemberLookup): Cope with user-defined enums when they are in transit.
21270
21271         * enum.cs (LookupEnumValue): Auto-compute next values by going down the dependency
21272         chain when we have no associated expression.
21273
21274 2001-11-30  Ravi Pratap  <ravi@ximian.com>
21275
21276         * constant.cs (Define): Use Location while reporting the errror.
21277
21278         Also emit a warning when 'new' is used and there is no inherited
21279         member to hide.
21280
21281         * enum.cs (EnumInTransit): Used to tell if an enum type is in the process of being 
21282         populated.
21283
21284         (LookupEnumValue): Implement to lookup an enum member's value and define it
21285         if necessary.
21286
21287         (Populate): Re-write accordingly to use the above routine.
21288
21289 2001-11-27  Miguel de Icaza  <miguel@ximian.com>
21290
21291         * expression.cs (This): Fix prototype for DoResolveLValue to
21292         override the base class DoResolveLValue.
21293
21294         * cs-parser.cs: Report errors cs574 and cs575 (destructor
21295         declarations) 
21296
21297         * ecore.cs (FieldExpr.EmitAssign): Handle value types specially
21298         (we need to load the address of the field here).  This fixes
21299         test-22. 
21300
21301         (FieldExpr.DoResolveLValue): Call the DoResolve
21302         function to initialize the Instance expression.
21303
21304         * statement.cs (Foreach.Emit): Fix the bug where we did not invoke
21305         correctly the GetEnumerator operation on a value type.
21306
21307         * cs-parser.jay: Add more simple parsing error catches.
21308
21309         * statement.cs (Switch): Add support for string switches.
21310         Handle null specially.
21311
21312         * literal.cs (NullLiteral): Make NullLiteral objects singletons. 
21313
21314 2001-11-28  Ravi Pratap  <ravi@ximian.com>
21315
21316         * cs-parser.jay (local_constant_declaration): Use declare_local_constant.
21317
21318         (declare_local_constant): New helper function.
21319
21320         * statement.cs (AddConstant): Keep a separate record of constants
21321
21322         (IsConstant): Implement to determine if a variable is a constant.
21323
21324         (GetConstantExpression): Implement.
21325
21326         * expression.cs (LocalVariableReference): Handle the case when it is a constant.
21327
21328         * statement.cs (IsVariableDefined): Re-write.
21329
21330 2001-11-27  Ravi Pratap  <ravi@ximian.com>
21331
21332         * class.cs (TypeContainer::FindMembers): Look for constants
21333         in the case when we are looking for MemberTypes.Field
21334
21335         * expression.cs (MemberAccess::DoResolve): Check that in the
21336         case we are a FieldExpr and a Literal, we are not being accessed
21337         by an instance reference.
21338
21339         * cs-parser.jay (local_constant_declaration): Implement.
21340
21341         (declaration_statement): Implement for constant declarations.
21342
21343 2001-11-26  Miguel de Icaza  <miguel@ximian.com>
21344
21345         * statement.cs (Switch): Catch double defaults.
21346
21347         (Switch): More work on the switch() statement
21348         implementation.  It works for integral values now, need to finish
21349         string support.
21350
21351
21352 2001-11-24  Miguel de Icaza  <miguel@ximian.com>
21353
21354         * ecore.cs (Expression.ConvertIntLiteral): New function to convert
21355         integer literals into other integer literals.  To be used by
21356         switch. 
21357
21358 2001-11-24  Ravi Pratap  <ravi@ximian.com>
21359
21360         * expression.cs (ArrayCreation): Get rid of ArrayExprs : we save
21361         some memory.
21362
21363         (EmitDynamicInitializers): Cope with the above since we extract data
21364         directly from ArrayData now.
21365
21366         (ExpectInitializers): Keep track of whether initializers are mandatory
21367         or not.
21368
21369         (Bounds): Make it a hashtable to prevent the same dimension being 
21370         recorded for every element in that dimension.
21371
21372         (EmitDynamicInitializers): Fix bug which prevented the Set array method
21373         from being found.
21374
21375         Also fix bug which was causing the indices to be emitted in the reverse
21376         order.
21377
21378 2001-11-24  Miguel de Icaza  <miguel@ximian.com>
21379
21380         * expression.cs (ArrayCreation): Implement the bits that Ravi left
21381         unfinished.  They do not work, because the underlying code is
21382         sloppy.
21383
21384 2001-11-22  Miguel de Icaza  <miguel@ximian.com>
21385
21386         * cs-parser.jay: Remove bogus fixme.
21387
21388         * statement.cs (Switch, SwitchSection, SwithLabel): Started work
21389         on Switch statement.
21390
21391 2001-11-23  Ravi Pratap  <ravi@ximian.com>
21392
21393         * typemanager.cs (IsDelegateType, IsEnumType): Fix logic to determine
21394         the same. 
21395
21396         * expression.cs (ArrayCreation::CheckIndices): Get rid of the require_constant
21397         parameter. Apparently, any expression is allowed. 
21398
21399         (ValidateInitializers): Update accordingly.
21400
21401         (CheckIndices): Fix some tricky bugs thanks to recursion.
21402
21403         * delegate.cs (NewDelegate::DoResolve): Re-write large portions as 
21404         I was being completely brain-dead.
21405
21406         (VerifyMethod, VerifyApplicability, VerifyDelegate): Make static
21407         and re-write acordingly.
21408
21409         (DelegateInvocation): Re-write accordingly.
21410
21411         * expression.cs (ArrayCreation::Emit): Handle string initialization separately.
21412
21413         (MakeByteBlob): Handle types more correctly.
21414
21415         * expression.cs (ArrayCreation:Emit): Write preliminary code to do
21416         initialization from expressions but it is incomplete because I am a complete
21417         Dodo :-|
21418
21419 2001-11-22  Miguel de Icaza  <miguel@ximian.com>
21420
21421         * statement.cs (If.Emit): Fix a bug that generated incorrect code
21422         on If.  Basically, we have to return `true' (ie, we do return to
21423         our caller) only if both branches of the if return.
21424
21425         * expression.cs (Binary.Emit): LogicalOr and LogicalAnd are
21426         short-circuit operators, handle them as short circuit operators. 
21427
21428         (Cast.DoResolve): Resolve type.
21429         (Cast.Cast): Take an expression as the target type.
21430
21431         * cs-parser.jay (cast_expression): Remove old hack that only
21432         allowed a limited set of types to be handled.  Now we take a
21433         unary_expression and we resolve to a type during semantic
21434         analysis.
21435
21436         Use the grammar productions from Rhys to handle casts (this is
21437         not complete like Rhys syntax yet, we fail to handle that corner
21438         case that C# has regarding (-x), but we will get there.
21439
21440 2001-11-22  Ravi Pratap  <ravi@ximian.com>
21441
21442         * class.cs (EmitFieldInitializer): Take care of the case when we have a
21443         field which is an array type.
21444
21445         * cs-parser.jay (declare_local_variables): Support array initialization too.
21446
21447         * typemanager.cs (MakeKey): Implement.
21448
21449         (everywhere): Use the above appropriately.
21450
21451         * cs-parser.jay (for_statement): Update for array initialization while
21452         declaring variables.
21453
21454         * ecore.cs : The error message was correct, it's the variable's names that
21455         were misleading ;-) Make the code more readable.
21456
21457         (MemberAccess::DoResolve): Fix the code which handles Enum literals to set
21458         the correct type etc.
21459
21460         (ConvertExplicit): Handle Enum types by examining the underlying type.
21461
21462 2001-11-21  Ravi Pratap  <ravi@ximian.com>
21463
21464         * parameter.cs (GetCallingConvention): Always return
21465         CallingConventions.Standard for now.
21466
21467 2001-11-22  Miguel de Icaza  <miguel@ximian.com>
21468
21469         * expression.cs (Binary.ResolveOperator): Update the values of `l'
21470         and `r' after calling DoNumericPromotions.
21471
21472         * ecore.cs: Fix error message (the types were in the wrong order).
21473
21474         * statement.cs (Foreach.ProbeCollectionType): Need to pass
21475         BindingFlags.Instance as well 
21476
21477         * ecore.cs (Expression.TryImplicitIntConversion): Wrap the result
21478         implicit int literal conversion in an empty cast so that we
21479         propagate the right type upstream.
21480
21481         (UnboxCast): new class used to unbox value types.
21482         (Expression.ConvertExplicit): Add explicit type conversions done
21483         by unboxing.
21484
21485         (Expression.ImplicitNumericConversion): Oops, forgot to test for
21486         the target type before applying the implicit LongLiterals to ULong
21487         literal cast.
21488
21489 2001-11-21  Miguel de Icaza  <miguel@ximian.com>
21490
21491         * cs-parser.jay (for_statement): Reworked the way For works: now
21492         we declare manually any variables that are introduced in
21493         for_initializer to solve the problem of having out-of-band code
21494         emition (that is what got for broken).
21495
21496         (declaration_statement): Perform the actual variable declaration
21497         that used to be done in local_variable_declaration here.
21498
21499         (local_variable_declaration): Do not declare anything, just pass
21500         the information on a DictionaryEntry
21501
21502 2001-11-20  Ravi Pratap  <ravi@ximian.com>
21503
21504         * expression.cs (ArrayCreation::CheckIndices): The story continues :-) Complete
21505         re-write of the logic to now make it recursive.
21506
21507         (UpdateIndices): Re-write accordingly.
21508
21509         Store element data in a separate ArrayData list in the above methods.
21510
21511         (MakeByteBlob): Implement to dump the array data into a byte array.
21512
21513 2001-11-19  Ravi Pratap  <ravi@ximian.com>
21514
21515         * expression.cs (ArrayCreation): Factor out some code from ValidateInitializers
21516         into CheckIndices.
21517
21518         * constant.cs (Define): Implement.
21519
21520         (EmitConstant): Re-write fully.
21521
21522         Pass in location info.
21523
21524         * class.cs (Populate, Emit): Call Constant::Define and Constant::EmitConstant
21525         respectively.
21526
21527         * cs-parser.jay (constant_declarator): Use VariableDeclaration instead of
21528         DictionaryEntry since we need location info too.
21529
21530         (constant_declaration): Update accordingly.
21531
21532         * expression.cs (ArrayCreation): Make ValidateInitializers simpler by factoring
21533         code into another method : UpdateIndices.
21534
21535 2001-11-18  Ravi Pratap  <ravi@ximian.com>
21536
21537         * expression.cs (ArrayCreation::ValidateInitializers): Update to perform
21538         some type checking etc.
21539
21540 2001-11-17  Ravi Pratap  <ravi@ximian.com>
21541
21542         * expression.cs (ArrayCreation::ValidateInitializers): Implement
21543         bits to provide dimension info if the user skips doing that.
21544
21545         Update second constructor to store the rank correctly.
21546
21547 2001-11-16  Ravi Pratap  <ravi@ximian.com>
21548
21549         * expression.cs (ArrayCreation::ValidateInitializers): Poke around
21550         and try to implement.
21551
21552         * ../errors/cs0150.cs : Add.
21553
21554         * ../errors/cs0178.cs : Add.
21555
21556 2001-11-16  Miguel de Icaza  <miguel@ximian.com>
21557
21558         * statement.cs: Implement foreach on multi-dimensional arrays. 
21559
21560         * parameter.cs (Parameters.GetParameterByName): Also lookup the
21561         name of the params argument.
21562
21563         * expression.cs: Use EmitStoreOpcode to get the right opcode while
21564         initializing the array.
21565
21566         (ArrayAccess.EmitStoreOpcode): move the opcode generation here, so
21567         we can use this elsewhere.
21568
21569         * statement.cs: Finish implementation of foreach for single
21570         dimension arrays.
21571
21572         * cs-parser.jay: Use an out-of-band stack to pass information
21573         around, I wonder why I need this.
21574
21575         foreach_block: Make the new foreach_block the current_block.
21576
21577         * parameter.cs (Parameters.GetEmptyReadOnlyParameters): New
21578         function used to return a static Parameters structure.  Used for
21579         empty parameters, as those are created very frequently.
21580
21581         * cs-parser.jay, class.cs: Use GetEmptyReadOnlyParameters
21582
21583 2001-11-15  Ravi Pratap  <ravi@ximian.com>
21584
21585         * interface.cs : Default modifier is private, not public. The
21586         make verify test passes again.
21587
21588 2001-11-15  Ravi Pratap  <ravi@ximian.com>
21589
21590         * support.cs (ReflectionParameters): Fix logic to determine
21591         whether the last parameter is a params one. Test 9 passes again.
21592
21593         * delegate.cs (Populate): Register the builders we define with
21594         RegisterParameterForBuilder. Test 19 passes again.
21595
21596         * cs-parser.jay (property_declaration): Reference $6 instead
21597         of $$ to get at the location.
21598
21599         (indexer_declaration): Similar stuff.
21600
21601         (attribute): Ditto.
21602
21603         * class.cs (Property): Register parameters for the Get and Set methods
21604         if they exist. Test 23 passes again.
21605
21606         * expression.cs (ArrayCreation::Emit): Pass null for the method in the
21607         call to EmitArguments as we are sure there aren't any params arguments. 
21608         Test 32 passes again.
21609
21610         * suppor.cs (ParameterDesc, ParameterModifier): Fix trivial bug causing
21611         IndexOutOfRangeException. 
21612
21613         * class.cs (Property::Define): Register property using TypeManager.RegisterProperty
21614         Test 33 now passes again.
21615
21616 2001-11-15  Miguel de Icaza  <miguel@ximian.com>
21617
21618         * cs-parser.jay: Kill horrendous hack ($??? = lexer.Location) that
21619         broke a bunch of things.  Will have to come up with a better way
21620         of tracking locations.
21621
21622         * statement.cs: Implemented foreach for single dimension arrays.
21623
21624 2001-11-09  Miguel de Icaza  <miguel@ximian.com>
21625
21626         * enum.cs (Enum.Emit): Delay the lookup of loc until we run into
21627         an error.  This removes the lookup from the critical path.
21628
21629         * cs-parser.jay: Removed use of temporary_loc, which is completely
21630         broken. 
21631
21632 2001-11-14  Miguel de Icaza  <miguel@ximian.com>
21633
21634         * support.cs (ReflectionParameters.ParameterModifier): Report
21635         whether the argument is a PARAMS argument or not.
21636
21637         * class.cs: Set the attribute `ParamArrayAttribute' on the
21638         parameter argument.
21639
21640         * typemanager.cs: Define param_array_type (ParamArrayAttribute)
21641         and cons_param_array_attribute (ConstructorInfo for
21642         ParamArrayAttribute)., 
21643
21644         * codegen.cs: Emit the return using the `Return' statement, that
21645         way we can report the error correctly for missing return values. 
21646
21647         * class.cs (Method.Emit): Clean up.
21648
21649         * expression.cs (Argument.Resolve): Take another argument: the
21650         location where this argument is used.  Notice that this is not
21651         part of the "Argument" class as to reduce the size of the
21652         structure (we know the approximate location anyways).
21653
21654         Test if the argument is a variable-reference, if not, then
21655         complain with a 206.
21656
21657         (Argument.Emit): Emit addresses of variables.
21658
21659         (Argument.FullDesc): Simplify.
21660
21661         (Invocation.DoResolve): Update for Argument.Resolve.
21662
21663         (ElementAccess.DoResolve): ditto.
21664
21665         * delegate.cs (DelegateInvocation.Emit): Invocation of Invoke
21666         method should be virtual, as this method is always virtual.
21667
21668         (NewDelegate.DoResolve): Update for Argument.Resolve.
21669
21670         * class.cs (ConstructorInitializer.DoResolve): ditto.
21671
21672         * attribute.cs (Attribute.Resolve): ditto.
21673
21674 2001-11-13  Miguel de Icaza  <miguel@ximian.com>
21675
21676         * statement.cs (Foreach.Emit): Use EmitAssign instead of Store.
21677
21678         * expression.cs (ParameterReference): Drop IStackStorage and implement
21679         IAssignMethod instead. 
21680
21681         (LocalVariableReference): ditto.
21682
21683         * ecore.cs (FieldExpr): Drop IStackStorage and implement
21684         IAssignMethod instead. 
21685
21686 2001-11-13  Miguel de Icaza <miguel@ximian.com>
21687
21688         * parameter.cs, expression.cs, class.cs, ecore.cs: Made all
21689         enumerations that are used in heavily used structures derive from
21690         byte in a laughable and pathetic attempt to reduce memory usage.
21691         This is the kind of pre-optimzations that you should not do at
21692         home without adult supervision.
21693
21694         * expression.cs (UnaryMutator): New class, used to handle ++ and
21695         -- separatedly from the other unary operators.  Cleans up the
21696         code, and kills the ExpressionStatement dependency in Unary.
21697
21698         (Unary): Removed `method' and `Arguments' from this class, making
21699         it smaller, and moving it all to SimpleCall, so I can reuse this
21700         code in other locations and avoid creating a lot of transient data
21701         strucutres when not required.
21702
21703         * cs-parser.jay: Adjust for new changes.
21704
21705 2001-11-11  Miguel de Icaza  <miguel@ximian.com>
21706
21707         * enum.cs (Enum.Populate): If there is a failure during
21708         definition, return
21709
21710         * cs-parser.jay (opt_enum_base): we used to catch type errors
21711         here, but this is really incorrect.  The type error should be
21712         catched during semantic analysis.
21713
21714 2001-12-11  Ravi Pratap  <ravi@ximian.com>
21715
21716         * cs-parser.jay (operator_declarator, conversion_operator_declarator): Set
21717         current_local_parameters as expected since I, in my stupidity, had forgotten
21718         to do this :-)
21719
21720         * attribute.cs (GetValidPlaces): Fix stupid bug.
21721
21722         * class.cs (Method::Emit): Perform check on applicability of attributes.
21723
21724         (Constructor::Emit): Ditto.
21725
21726         (Field::Emit): Ditto.
21727
21728         (Field.Location): Store location information.
21729
21730         (Property, Event, Indexer, Operator): Ditto.
21731
21732         * cs-parser.jay (field_declaration): Pass in location for each field.
21733
21734         * ../errors/cs0592.cs : Add.
21735
21736 2001-11-12  Ravi Pratap  <ravi@ximian.com>
21737
21738         * typemanager.cs (attribute_usage_type): New static member for System.AttributeUsage.
21739
21740         (InitCoreTypes): Update accordingly.
21741
21742         (RegisterAttrType, LookupAttr): Implement.
21743
21744         * attribute.cs (Attribute.Targets, AllowMultiple, Inherited): New fields to hold
21745         info about the same.
21746
21747         (Resolve): Update to populate the above as necessary.
21748
21749         (Error592): Helper.
21750
21751         (GetValidPlaces): Helper to the above.
21752
21753         (CheckAttribute): Implement to perform validity of attributes on declarative elements.
21754
21755         * class.cs (TypeContainer::Emit): Update attribute emission code to perform checking etc.
21756
21757 2001-11-12  Ravi Pratap  <ravi@ximian.com>
21758
21759         * attribute.cs (Attribute::Resolve): Expand to handle named arguments too.
21760
21761         * ../errors/cs0617.cs : Add.
21762
21763 2001-11-11  Ravi Pratap  <ravi@ximian.com>
21764
21765         * enum.cs (Emit): Rename to Populate to be more consistent with what
21766         we expect it to do and when exactly it is called.
21767
21768         * class.cs, rootcontext.cs : Update accordingly.
21769
21770         * typemanager.cs (RegisterField, GetValue): Workarounds for the fact that
21771         FieldInfo.GetValue does not work on dynamic types ! S.R.E lameness strikes again !
21772
21773         * enum.cs (Populate): Register fields with TypeManager.RegisterField.
21774
21775         * expression.cs (MemberAccess.DoResolve): Adjust code to obtain the value
21776         of a fieldinfo using the above, when dealing with a FieldBuilder.
21777
21778 2001-11-10  Ravi Pratap  <ravi@ximian.com>
21779
21780         * ../errors/cs0031.cs : Add.
21781
21782         * ../errors/cs1008.cs : Add.
21783
21784         * ../errrors/cs0543.cs : Add.
21785
21786         * enum.cs (DefineEnum): Check the underlying type and report an error if not a valid
21787         enum type.
21788
21789         (FindMembers): Implement.
21790
21791         * typemanager.cs (FindMembers): Re-write to call the appropriate methods for
21792         enums and delegates too.
21793
21794         (enum_types): Rename to builder_to_enum.
21795
21796         (delegate_types): Rename to builder_to_delegate.
21797
21798         * delegate.cs (FindMembers): Implement.
21799
21800 2001-11-09  Ravi Pratap  <ravi@ximian.com>
21801
21802         * typemanager.cs (IsEnumType): Implement.
21803
21804         * enum.cs (Emit): Re-write parts to account for the underlying type
21805         better and perform checking etc.
21806
21807         (GetNextDefaultValue): Helper to ensure we don't overshoot max value
21808         of the underlying type.
21809
21810         * literal.cs (GetValue methods everywhere): Perform bounds checking and return
21811         value
21812
21813         * enum.cs (error31): Helper to report error #31.
21814
21815         * cs-parser.jay (enum_declaration): Store location of each member too.
21816
21817         * enum.cs (member_to_location): New hashtable. 
21818
21819         (AddEnumMember): Update location hashtable.
21820
21821         (Emit): Use the location of each member while reporting errors.
21822
21823 2001-11-09  Miguel de Icaza  <miguel@ximian.com>
21824
21825         * cs-parser.jay: A for_initializer if is a
21826         local_variable_declaration really ammount to have an implicit
21827         block with the variable declaration and no initializer for for.
21828
21829         * statement.cs (For.Emit): Cope with null initializers.
21830
21831         This fixes the infinite loop on for initializers.
21832
21833 2001-11-08  Miguel de Icaza  <miguel@ximian.com>
21834
21835         * enum.cs: More cleanup.
21836
21837         * ecore.cs: Remove dead code.
21838
21839         * class.cs (Property.Emit): More simplification.
21840         (Event.Emit): ditto.
21841
21842         Reworked to have less levels of indentation.
21843
21844 2001-11-08  Ravi Pratap  <ravi@ximian.com>
21845
21846         * class.cs (Property): Emit attributes.
21847
21848         (Field): Ditto.
21849
21850         (Event): Ditto.
21851
21852         (Indexer): Ditto.
21853
21854         (Operator): Ditto.
21855
21856         * enum.cs (Emit): Ditto.
21857
21858         * rootcontext.cs (ResolveTree, EmitCode, CloseTypes): Do the same for
21859         Enums too.
21860
21861         * class.cs (Field, Event, etc.): Move attribute generation into the
21862         Emit method everywhere.
21863
21864         * enum.cs (Enum): Revamp to use the same definition semantics as delegates so
21865         we have a DefineEnum, CloseEnum etc. The previous way of doing things was not right
21866         as we had no way of defining nested enums !
21867
21868         * rootcontext.cs : Adjust code accordingly.
21869
21870         * typemanager.cs (AddEnumType): To keep track of enum types separately.
21871
21872 2001-11-07  Ravi Pratap  <ravi@ximian.com>
21873
21874         * expression.cs (EvalConstantExpression): Move into ecore.cs
21875
21876         * enum.cs (Enum): Rename some members and make them public and readonly
21877         according to our convention.
21878
21879         * modifiers.cs (EnumAttr): Implement as we need to set only visibility flags,
21880         nothing else.
21881
21882         * enum.cs (Enum::Define): Use the above instead of TypeAttr.
21883
21884         (Enum::Emit): Write a simple version for now which doesn't try to compute
21885         expressions. I shall modify this to be more robust in just a while.
21886
21887         * class.cs (TypeContainer::Emit): Make sure we include Enums too.
21888
21889         (TypeContainer::CloseType): Create the Enum types too.
21890
21891         * attribute.cs (Resolve): Use the new Reduce method instead of EvalConstantExpression.
21892
21893         * expression.cs (EvalConstantExpression): Get rid of completely.
21894
21895         * enum.cs (Enum::Emit): Use the new expression reducer. Implement assigning
21896         user-defined values and other cases.
21897
21898         (IsValidEnumLiteral): Helper function.
21899
21900         * expression.cs (ExprClassfromMemberInfo): Modify to not do any literalizing 
21901         out there in the case we had a literal FieldExpr.
21902
21903         (MemberAccess:DoResolve): Do the literalizing of the FieldExpr here.
21904
21905         (Literalize): Revamp a bit to take two arguments.
21906
21907         (EnumLiteral): New class which derives from Literal to wrap enum literals.
21908
21909 2001-11-06  Ravi Pratap  <ravi@ximian.com>
21910
21911         * cs-parser.jay (compilation_unit): Remove extra opt_attributes for now.
21912
21913         * expression.cs (ArrayCreation::ValidateInitializers): Implement.
21914
21915         (Resolve): Use the above to ensure we have proper initializers.
21916
21917 2001-11-05  Ravi Pratap  <ravi@ximian.com>
21918
21919         * expression.cs (Expression::EvalConstantExpression): New method to 
21920         evaluate constant expressions.
21921
21922         * attribute.cs (Attribute::Resolve): Modify bits to use the above function.
21923
21924 2001-11-07  Miguel de Icaza  <miguel@ximian.com>
21925
21926         * expression.cs (ArrayCreation.Emit): Some bits to initialize data
21927         in an array.
21928
21929         (Binary.ResolveOperator): Handle operator != (object a, object b)
21930         and operator == (object a, object b);
21931
21932         (Binary.DoNumericPromotions): Indicate whether the numeric
21933         promotion was possible.
21934
21935         (ArrayAccess.DoResolve, ArrayAccess.Emit, ArrayAccess.EmitAssign):
21936         Implement.  
21937
21938         Made the ArrayAccess implement interface IAssignMethod instead of
21939         IStackStore as the order in which arguments are passed reflects
21940         this.
21941
21942         * assign.cs: Instead of using expr.ExprClass to select the way of
21943         assinging, probe for the IStackStore/IAssignMethod interfaces.
21944
21945         * typemanager.cs: Load InitializeArray definition.
21946
21947         * rootcontext.cs (RootContext.MakeStaticData): Used to define
21948         static data that can be used to initialize arrays. 
21949
21950 2001-11-05  Miguel de Icaza  <miguel@ximian.com>
21951
21952         * expression.cs: Handle operator== and operator!= for booleans.
21953
21954         (Conditioal.Reduce): Implement reducer for the ?: operator.
21955
21956         (Conditional.Resolve): Implement dead code elimination.
21957
21958         (Binary.Resolve): Catch string literals and return a new
21959         concatenated string.
21960
21961         (Unary.Reduce): Implement reduction of unary expressions.
21962
21963         * ecore.cs: Split out the expression core handling here.
21964
21965         (Expression.Reduce): New method used to perform constant folding
21966         and CSE.  This is needed to support constant-expressions. 
21967
21968         * statement.cs (Statement.EmitBoolExpression): Pass true and false
21969         targets, and optimize for !x.
21970
21971 2001-11-04  Ravi Pratap  <ravi@ximian.com>
21972
21973         * attribute.cs (Attribute::Resolve): Implement guts. Note that resolution
21974         of an attribute gives us a CustomAttributeBuilder which we use accordingly to
21975         set custom atttributes.
21976
21977         * literal.cs (Literal::GetValue): New abstract method to return the actual
21978         value of the literal, cast as an object.
21979
21980         (*Literal): Implement GetValue method.
21981
21982         * cs-parser.jay (positional_argument_list, named_argument_list): Add not just plain
21983         expressions to the arraylist but objects of type Argument.
21984
21985         * class.cs (TypeContainer::Emit): Emit our attributes too.
21986
21987         (Method::Emit, Constructor::Emit): Ditto.
21988
21989         * cs-parser.jay (constructor_declaration): Set attributes too, which we seemed
21990         to be ignoring earlier.
21991
21992 2001-11-03  Ravi Pratap  <ravi@ximian.com>
21993
21994         * attribute.cs (AttributeSection::Define): Implement to do the business
21995         of constructing a CustomAttributeBuilder.
21996
21997         (Attribute): New trivial class. Increases readability of code.  
21998
21999         * cs-parser.jay : Update accordingly.
22000
22001         (positional_argument_list, named_argument_list, named_argument): New rules
22002
22003         (attribute_arguments): Use the above so that we are more correct.
22004
22005 2001-11-02  Ravi Pratap  <ravi@ximian.com>
22006
22007         * expression.cs (Invocation::IsParamsMethodApplicable): Implement
22008         to perform all checks for a method with a params parameter.
22009
22010         (Invocation::OverloadResolve): Update to use the above method and therefore
22011         cope correctly with params method invocations.
22012
22013         * support.cs (InternalParameters::ParameterDesc): Provide a desc for 
22014         params too.
22015
22016         * class.cs (ConstructorInitializer::Resolve): Make sure we look for Non-public
22017         constructors in our parent too because we can't afford to miss out on 
22018         protected ones ;-)
22019
22020         * attribute.cs (AttributeSection): New name for the class Attribute
22021
22022         Other trivial changes to improve readability.
22023
22024         * cs-parser.jay (opt_attributes, attribute_section etc.): Modify to
22025         use the new class names.
22026
22027 2001-11-01  Ravi Pratap  <ravi@ximian.com>
22028
22029         * class.cs (Method::Define): Complete definition for params types too
22030
22031         (Indexer::Define): Ditto.
22032
22033         * support.cs (InternalParameters::ParameterType, ParameterDesc, ParameterModifier):
22034         Cope everywhere with a request for info about the array parameter.
22035
22036 2001-11-01  Ravi Pratap  <ravi@ximian.com>
22037
22038         * tree.cs (RecordNamespace): Fix up to check for the correct key.
22039
22040         * cs-parser.jay (GetQualifiedIdentifier): New Helper method used in 
22041         local_variable_type to extract the string corresponding to the type.
22042
22043         (local_variable_type): Fixup the action to use the new helper method.
22044
22045         * codegen.cs : Get rid of RefOrOutParameter, it's not the right way to 
22046         go.
22047
22048         * expression.cs : Clean out code which uses the above.
22049
22050 2001-10-31  Ravi Pratap  <ravi@ximian.com>
22051
22052         * typemanager.cs (RegisterMethod): Check if we already have an existing key
22053         and bale out if necessary by returning a false.
22054
22055         (RegisterProperty): Ditto.
22056
22057         * class.cs (everywhere): Check the return value from TypeManager.RegisterMethod
22058         and print out appropriate error messages.
22059
22060         * interface.cs (everywhere): Ditto.
22061
22062         * cs-parser.jay (property_declaration, event_declaration, indexer_declaration): Pass
22063         location to constructor.
22064
22065         * class.cs (Property, Event, Indexer): Update accordingly.
22066
22067         * ../errors/cs111.cs : Added.
22068
22069         * expression.cs (Invocation::IsApplicable): New static method to determine applicability
22070         of a method, as laid down by the spec.
22071
22072         (Invocation::OverloadResolve): Use the above method.
22073
22074 2001-10-31  Ravi Pratap  <ravi@ximian.com>
22075
22076         * support.cs (InternalParameters): Get rid of crap taking in duplicate info. We
22077         now take a TypeContainer and a Parameters object.
22078
22079         (ParameterData): Modify return type of ParameterModifier method to be 
22080         Parameter.Modifier and not a string.
22081
22082         (ReflectionParameters, InternalParameters): Update accordingly.
22083
22084         * expression.cs (Argument::GetParameterModifier): Same here.
22085
22086         * support.cs (InternalParameters::ParameterType): Find a better way of determining
22087         if we are a ref/out parameter. Actually, the type shouldn't be holding the '&'
22088         symbol in it at all so maybe this is only for now.
22089
22090 2001-10-30  Ravi Pratap  <ravi@ximian.com>
22091
22092         * support.cs (InternalParameters): Constructor now takes an extra argument 
22093         which is the actual Parameters class.
22094
22095         (ParameterDesc): Update to provide info on ref/out modifiers.
22096
22097         * class.cs (everywhere): Update call to InternalParameters to pass in
22098         the second argument too.
22099
22100         * support.cs (ParameterData): Add ParameterModifier, which is a method 
22101         to return the modifier info [ref/out etc]
22102
22103         (InternalParameters, ReflectionParameters): Implement the above.
22104
22105         * expression.cs (Argument::ParameterModifier): Similar function to return
22106         info about the argument's modifiers.
22107
22108         (Invocation::OverloadResolve): Update to take into account matching modifiers 
22109         too.
22110
22111         * class.cs (Indexer::Define): Actually define a Parameter object and put it onto
22112         a new SetFormalParameters object which we pass to InternalParameters.
22113
22114 2001-10-30  Ravi Pratap  <ravi@ximian.com>
22115
22116         * expression.cs (NewArray): Merge into the ArrayCreation class.
22117
22118 2001-10-29  Ravi Pratap  <ravi@ximian.com>
22119
22120         * expression.cs (NewArray): Merge classes NewBuiltinArray and 
22121         NewUserdefinedArray into one as there wasn't much of a use in having
22122         two separate ones.
22123
22124         * expression.cs (Argument): Change field's name to ArgType from Type.
22125
22126         (Type): New readonly property which returns the proper type, taking into 
22127         account ref/out modifiers.
22128
22129         (everywhere): Adjust code accordingly for the above.
22130
22131         * codegen.cs (EmitContext.RefOrOutParameter): New field to determine
22132         whether we are emitting for a ref or out parameter.
22133
22134         * expression.cs (Argument::Emit): Use the above field to set the state.
22135
22136         (LocalVariableReference::Emit): Update to honour the flag and emit the
22137         right stuff.
22138
22139         * parameter.cs (Attributes): Set the correct flags for ref parameters.
22140
22141         * expression.cs (Argument::FullDesc): New function to provide a full desc.
22142
22143         * support.cs (ParameterData): Add method ParameterDesc to the interface.
22144
22145         (ReflectionParameters, InternalParameters): Implement the above method.
22146
22147         * expression.cs (Invocation::OverloadResolve): Use the new desc methods in
22148         reporting errors.
22149
22150         (Invocation::FullMethodDesc): Ditto. 
22151
22152 2001-10-29  Miguel de Icaza  <miguel@ximian.com>
22153
22154         * cs-parser.jay: Add extra production for the second form of array
22155         creation. 
22156
22157         * expression.cs (ArrayCreation): Update to reflect the above
22158         change. 
22159
22160         * Small changes to prepare for Array initialization.
22161
22162 2001-10-28  Miguel de Icaza  <miguel@ximian.com>
22163
22164         * typemanager.cs (ImplementsInterface): interface might be null;
22165         Deal with this problem;
22166
22167         Also, we do store negative hits on the cache (null values), so use
22168         this instead of calling t.GetInterfaces on the type everytime.
22169
22170 2001-10-28  Ravi Pratap  <ravi@ximian.com>
22171
22172         * typemanager.cs (IsBuiltinType): New method to help determine the same.
22173
22174         * expression.cs (New::DoResolve): Get rid of array creation code and instead
22175         split functionality out into different classes.
22176
22177         (New::FormArrayType): Move into NewBuiltinArray.
22178
22179         (Invocation::EmitArguments): Get rid of the MethodBase argument. Appears
22180         quite useless.
22181
22182         (NewBuiltinArray): New class to handle creation of built-in arrays.
22183
22184         (NewBuiltinArray::DoResolve): Implement guts of array creation. Also take into
22185         account creation of one-dimensional arrays.
22186
22187         (::Emit): Implement to use Newarr and Newobj opcodes accordingly.
22188
22189         (NewUserdefinedArray::DoResolve): Implement.
22190
22191         * cs-parser.jay (local_variable_type): Fix up to add the rank to the variable too.
22192
22193         * typemanager.cs (AddModule): Used to add a ModuleBuilder to the list of modules
22194         we maintain inside the TypeManager. This is necessary to perform lookups on the
22195         module builder.
22196
22197         (LookupType): Update to perform GetType on the module builders too.     
22198
22199         * driver.cs (Driver): Add the ModuleBuilder to the list maintained by the TypeManager.
22200
22201         * exprssion.cs (NewUserdefinedArray::Emit): Implement.
22202
22203 2001-10-23  Ravi Pratap  <ravi@ximian.com>
22204
22205         * expression.cs (New::DoResolve): Implement guts of array creation.
22206
22207         (New::FormLookupType): Rename to FormArrayType and modify ever so slightly.
22208
22209 2001-10-27  Miguel de Icaza  <miguel@ximian.com>
22210
22211         * expression.cs: Fix bug I introduced lsat night that broke
22212         Delegates. 
22213
22214         (Expression.Resolve): Report a 246 error (can not resolve name)
22215         if we find a SimpleName in the stream.
22216
22217         (Expression.ResolveLValue): Ditto.
22218
22219         (Expression.ResolveWithSimpleName): This function is a variant of
22220         ResolveName, this one allows SimpleNames to be returned without a
22221         warning.  The only consumer of SimpleNames is MemberAccess
22222
22223 2001-10-26  Miguel de Icaza  <miguel@ximian.com>
22224
22225         * expression.cs (Invocation::DoResolve): Catch SimpleNames that
22226         might arrive here.  I have my doubts that this is correct.
22227
22228         * statement.cs (Lock): Implement lock statement.
22229
22230         * cs-parser.jay: Small fixes to support `lock' and `using'
22231
22232         * cs-tokenizer.cs: Remove extra space
22233
22234         * driver.cs: New flag --checked, allows to turn on integer math
22235         checking. 
22236
22237         * typemanger.cs: Load methodinfos for Threading.Monitor.Enter and
22238         Threading.Monitor.Exit 
22239
22240 2001-10-23  Miguel de Icaza  <miguel@ximian.com>
22241
22242         * expression.cs (IndexerAccess::DoResolveLValue): Set the
22243         Expression Class to be IndexerAccess.
22244
22245         Notice that Indexer::DoResolve sets the eclass to Value.
22246
22247 2001-10-22  Miguel de Icaza  <miguel@ximian.com>
22248
22249         * class.cs (TypeContainer::Emit): Emit code for indexers.
22250
22251         * assign.cs (IAssignMethod): New interface implemented by Indexers
22252         and Properties for handling assignment.
22253
22254         (Assign::Emit): Simplify and reuse code. 
22255
22256         * expression.cs (IndexerAccess, PropertyExpr): Implement
22257         IAssignMethod, clean up old code. 
22258
22259 2001-10-22  Ravi Pratap  <ravi@ximian.com>
22260
22261         * typemanager.cs (ImplementsInterface): New method to determine if a type
22262         implements a given interface. Provides a nice cache too.
22263
22264         * expression.cs (ImplicitReferenceConversion): Update checks to use the above
22265         method.
22266
22267         (ConvertReferenceExplicit): Ditto.
22268
22269         * delegate.cs (Delegate::Populate): Update to define the parameters on the 
22270         various methods, with correct names etc.
22271
22272         * class.cs (Operator::OpType): New members Operator.UnaryPlus and 
22273         Operator.UnaryNegation.
22274
22275         * cs-parser.jay (operator_declarator): Be a little clever in the case where
22276         we have a unary plus or minus operator.
22277
22278         * expression.cs (Unary): Rename memebers of Operator enum to UnaryPlus and 
22279         UnaryMinus.
22280
22281         * everywhere : update accordingly.
22282
22283         * everywhere : Change Negate and BitComplement to LogicalNot and OnesComplement
22284         respectively.
22285
22286         * class.cs (Method::Define): For the case where we are implementing a method
22287         inherited from an interface, we need to set the MethodAttributes.Final flag too. 
22288         Also set MethodAttributes.NewSlot and MethodAttributes.HideBySig.
22289
22290 2001-10-21  Ravi Pratap  <ravi@ximian.com>
22291
22292         * interface.cs (FindMembers): Implement to work around S.R.E
22293         lameness.
22294
22295         * typemanager.cs (IsInterfaceType): Implement.
22296
22297         (FindMembers): Update to handle interface types too.
22298
22299         * expression.cs (ImplicitReferenceConversion): Re-write bits which
22300         use IsAssignableFrom as that is not correct - it doesn't work.
22301
22302         * delegate.cs (DelegateInvocation): Derive from ExpressionStatement
22303         and accordingly override EmitStatement.
22304
22305         * expression.cs (ConvertReferenceExplicit): Re-write similary, this time
22306         using the correct logic :-)
22307
22308 2001-10-19  Ravi Pratap  <ravi@ximian.com>
22309
22310         * ../errors/cs-11.cs : Add to demonstrate error -11 
22311
22312 2001-10-17  Miguel de Icaza  <miguel@ximian.com>
22313
22314         * assign.cs (Assign::Resolve): Resolve right hand side first, and
22315         then pass this as a hint to ResolveLValue.
22316
22317         * expression.cs (FieldExpr): Add Location information
22318
22319         (FieldExpr::LValueResolve): Report assignment to readonly
22320         variable. 
22321
22322         (Expression::ExprClassFromMemberInfo): Pass location information.
22323
22324         (Expression::ResolveLValue): Add new method that resolves an
22325         LValue. 
22326
22327         (Expression::DoResolveLValue): Default invocation calls
22328         DoResolve. 
22329
22330         (Indexers): New class used to keep track of indexers in a given
22331         Type. 
22332
22333         (IStackStore): Renamed from LValue, as it did not really describe
22334         what this did.  Also ResolveLValue is gone from this interface and
22335         now is part of Expression.
22336
22337         (ElementAccess): Depending on the element access type
22338
22339         * typemanager.cs: Add `indexer_name_type' as a Core type
22340         (System.Runtime.CompilerServices.IndexerNameAttribute)
22341
22342         * statement.cs (Goto): Take a location.
22343
22344 2001-10-18  Ravi Pratap  <ravi@ximian.com>
22345
22346         * delegate.cs (Delegate::VerifyDelegate): New method to verify
22347         if two delegates are compatible.
22348
22349         (NewDelegate::DoResolve): Update to take care of the case when
22350         we instantiate a delegate from another delegate.
22351
22352         * typemanager.cs (FindMembers): Don't even try to look up members
22353         of Delegate types for now.
22354
22355 2001-10-18  Ravi Pratap  <ravi@ximian.com>
22356
22357         * delegate.cs (NewDelegate): New class to take care of delegate
22358         instantiation.
22359
22360         * expression.cs (New): Split the delegate related code out into 
22361         the NewDelegate class.
22362
22363         * delegate.cs (DelegateInvocation): New class to handle delegate 
22364         invocation.
22365
22366         * expression.cs (Invocation): Split out delegate related code into
22367         the DelegateInvocation class.
22368
22369 2001-10-17  Ravi Pratap  <ravi@ximian.com>
22370
22371         * expression.cs (New::DoResolve): Implement delegate creation fully
22372         and according to the spec.
22373
22374         (New::DoEmit): Update to handle delegates differently.
22375
22376         (Invocation::FullMethodDesc): Fix major stupid bug thanks to me
22377         because of which we were printing out arguments in reverse order !
22378
22379         * delegate.cs (VerifyMethod): Implement to check if the given method
22380         matches the delegate.
22381
22382         (FullDelegateDesc): Implement.
22383
22384         (VerifyApplicability): Implement.
22385
22386         * expression.cs (Invocation::DoResolve): Update to accordingly handle
22387         delegate invocations too.
22388
22389         (Invocation::Emit): Ditto.
22390
22391         * ../errors/cs1593.cs : Added.
22392
22393         * ../errors/cs1594.cs : Added.
22394
22395         * delegate.cs (InstanceExpression, TargetMethod): New properties.
22396
22397 2001-10-16  Ravi Pratap  <ravi@ximian.com>
22398
22399         * typemanager.cs (intptr_type): Core type for System.IntPtr
22400
22401         (InitCoreTypes): Update for the same.
22402
22403         (iasyncresult_type, asynccallback_type): Ditto.
22404
22405         * delegate.cs (Populate): Fix to use System.Intptr as it is indeed
22406         correct.
22407
22408         * typemanager.cs (AddDelegateType): Store a pointer to the Delegate class
22409         too.
22410
22411         * delegate.cs (ConstructorBuilder, InvokeBuilder, ...): New members to hold
22412         the builders for the 4 members of a delegate type :-)
22413
22414         (Populate): Define the BeginInvoke and EndInvoke methods on the delegate
22415         type.
22416
22417         * expression.cs (New::DoResolve): Implement guts for delegate creation.
22418
22419         * ../errors/errors.txt : Update for an error (-11) which only we catch :-)
22420
22421 2001-10-15  Miguel de Icaza  <miguel@ximian.com>
22422
22423         * statement.cs (Break::Emit): Implement.   
22424         (Continue::Emit): Implement.
22425
22426         (For::Emit): Track old being/end loops;  Set Begin loop, ack end loop
22427         (While::Emit): Track old being/end loops;  Set Begin loop, ack end loop
22428         (Do::Emit): Track old being/end loops;  Set Begin loop, ack end loop
22429         (Foreach::Emit): Track old being/end loops;  Set Begin loop, ack
22430         end loop
22431
22432         * codegen.cs (EmitContext::LoopEnd, EmitContext::LoopBegin): New
22433         properties that track the label for the current loop (begin of the
22434         loop and end of the loop).
22435
22436 2001-10-15  Ravi Pratap  <ravi@ximian.com>
22437
22438         * delegate.cs (Emit): Get rid of it as there doesn't seem to be any ostensible
22439         use of emitting anything at all.
22440
22441         * class.cs, rootcontext.cs : Get rid of calls to the same.
22442
22443         * delegate.cs (DefineDelegate): Make sure the class we define is also sealed.
22444
22445         (Populate): Define the constructor correctly and set the implementation
22446         attributes.
22447
22448         * typemanager.cs (delegate_types): New hashtable to hold delegates that
22449         have been defined.
22450
22451         (AddDelegateType): Implement.
22452
22453         (IsDelegateType): Implement helper method.
22454
22455         * delegate.cs (DefineDelegate): Use AddDelegateType instead of AddUserType.
22456
22457         * expression.cs (New::DoResolve): Check if we are trying to instantiate a delegate type
22458         and accordingly handle it.
22459
22460         * delegate.cs (Populate): Take TypeContainer argument.
22461         Implement bits to define the Invoke method. However, I still haven't figured out
22462         how to take care of the native int bit :-(
22463
22464         * cs-parser.jay (delegate_declaration): Fixed the bug that I had introduced :-) 
22465         Qualify the name of the delegate, not its return type !
22466
22467         * expression.cs (ImplicitReferenceConversion): Implement guts of implicit array
22468         conversion.
22469
22470         (StandardConversionExists): Checking for array types turns out to be recursive.
22471
22472         (ConvertReferenceExplicit): Implement array conversion.
22473
22474         (ExplicitReferenceConversionExists): New method to determine precisely that :-)
22475
22476 2001-10-12  Ravi Pratap  <ravi@ximian.com>
22477
22478         * cs-parser.jay (delegate_declaration): Store the fully qualified
22479         name as it is a type declaration.
22480
22481         * delegate.cs (ReturnType, Name): Rename members to these. Make them 
22482         readonly.
22483
22484         (DefineDelegate): Renamed from Define. Does the same thing essentially,
22485         as TypeContainer::DefineType.
22486
22487         (Populate): Method in which all the definition of the various methods (Invoke)
22488         etc is done.
22489
22490         (Emit): Emit any code, if necessary. I am not sure about this really, but let's
22491         see.
22492
22493         (CloseDelegate): Finally creates the delegate.
22494
22495         * class.cs (TypeContainer::DefineType): Update to define delegates.
22496         (Populate, Emit and CloseType): Do the same thing here too.
22497
22498         * rootcontext.cs (ResolveTree, PopulateTypes, EmitCode, CloseTypes): Include
22499         delegates in all these operations.
22500
22501 2001-10-14  Miguel de Icaza  <miguel@ximian.com>
22502
22503         * expression.cs: LocalTemporary: a new expression used to
22504         reference a temporary that has been created.
22505
22506         * assign.cs: Handle PropertyAccess back here, so that we can
22507         provide the proper semantic access to properties.
22508
22509         * expression.cs (Expression::ConvertReferenceExplicit): Implement
22510         a few more explicit conversions. 
22511
22512         * modifiers.cs: `NEW' modifier maps to HideBySig.
22513
22514         * expression.cs (PropertyExpr): Make this into an
22515         ExpressionStatement, and support the EmitStatement code path. 
22516
22517         Perform get/set error checking, clean up the interface.
22518
22519         * assign.cs: recognize PropertyExprs as targets, and if so, turn
22520         them into toplevel access objects.
22521
22522 2001-10-12  Miguel de Icaza  <miguel@ximian.com>
22523
22524         * expression.cs: PropertyExpr::PropertyExpr: use work around the
22525         SRE.
22526
22527         * typemanager.cs: Keep track here of our PropertyBuilders again to
22528         work around lameness in SRE.
22529
22530 2001-10-11  Miguel de Icaza  <miguel@ximian.com>
22531
22532         * expression.cs (LValue::LValueResolve): New method in the
22533         interface, used to perform a second resolution pass for LValues. 
22534
22535         (This::DoResolve): Catch the use of this in static methods.
22536
22537         (This::LValueResolve): Implement.
22538
22539         (This::Store): Remove warning, assigning to `this' in structures
22540         is 
22541
22542         (Invocation::Emit): Deal with invocation of
22543         methods on value types.  We need to pass the address to structure
22544         methods rather than the object itself.  (The equivalent code to
22545         emit "this" for structures leaves the entire structure on the
22546         stack instead of a pointer to it). 
22547
22548         (ParameterReference::DoResolve): Compute the real index for the
22549         argument based on whether the method takes or not a `this' pointer
22550         (ie, the method is static).
22551
22552         * codegen.cs (EmitContext::GetTemporaryStorage): Used to store
22553         value types returned from functions when we need to invoke a
22554         method on the sturcture.
22555
22556
22557 2001-10-11  Ravi Pratap  <ravi@ximian.com>
22558
22559         * class.cs (TypeContainer::DefineType): Method to actually do the business of
22560         defining the type in the Modulebuilder or Typebuilder. This is to take
22561         care of nested types which need to be defined on the TypeBuilder using
22562         DefineNestedMethod.
22563
22564         (TypeContainer::GetClassBases): Implement. Essentially the code from the 
22565         methods in RootContext, only ported to be part of TypeContainer.
22566
22567         (TypeContainer::GetInterfaceOrClass): Ditto.
22568
22569         (TypeContainer::LookupInterfaceOrClass, ::MakeFQN): Ditto.
22570
22571         * interface.cs (Interface::DefineInterface): New method. Does exactly
22572         what RootContext.CreateInterface did earlier, only it takes care of nested types 
22573         too.
22574
22575         (Interface::GetInterfaces): Move from RootContext here and port.
22576
22577         (Interface::GetInterfaceByName): Same here.
22578
22579         * rootcontext.cs (ResolveTree): Re-write.
22580
22581         (PopulateTypes): Re-write.
22582
22583         * class.cs (TypeContainer::Populate): Populate nested types too.
22584         (TypeContainer::Emit): Emit nested members too.
22585
22586         * typemanager.cs (AddUserType): Do not make use of the FullName property,
22587         instead just use the name argument passed in as it is already fully
22588         qualified.
22589
22590         (FindMembers): Check in the Builders to TypeContainer mapping instead of the name
22591         to TypeContainer mapping to see if a type is user-defined.
22592
22593         * class.cs (TypeContainer::CloseType): Implement. 
22594
22595         (TypeContainer::DefineDefaultConstructor): Use Basename, not Name while creating
22596         the default constructor.
22597
22598         (TypeContainer::Populate): Fix minor bug which led to creating default constructors
22599         twice.
22600
22601         (Constructor::IsDefault): Fix up logic to determine if it is the default constructor
22602
22603         * interface.cs (CloseType): Create the type here.
22604
22605         * rootcontext.cs (CloseTypes): Re-write to recursively close types by running through
22606         the hierarchy.
22607
22608         Remove all the methods which are now in TypeContainer.
22609
22610 2001-10-10  Ravi Pratap  <ravi@ximian.com>
22611
22612         * delegate.cs (Define): Re-write bits to define the delegate
22613         correctly.
22614
22615 2001-10-10  Miguel de Icaza  <miguel@ximian.com>
22616
22617         * makefile: Renamed the compiler to `mcs.exe' instead of compiler.exe
22618
22619         * expression.cs (ImplicitReferenceConversion): handle null as well
22620         as a source to convert to any reference type.
22621
22622         * statement.cs (Return): Perform any implicit conversions to
22623         expected return type.  
22624
22625         Validate use of return statement.  
22626
22627         * codegen.cs (EmitContext): Pass the expected return type here.
22628
22629         * class.cs (Method, Constructor, Property): Pass expected return
22630         type to EmitContext.
22631
22632 2001-10-09  Miguel de Icaza  <miguel@ximian.com>
22633
22634         * expression.cs: Make DoResolve take an EmitContext instead of a
22635         TypeContainer.
22636
22637         Replaced `l' and `location' for `loc', for consistency.
22638
22639         (Error, Warning): Remove unneeded Tc argument.
22640
22641         * assign.cs, literal.cs, constant.cs: Update to new calling
22642         convention. 
22643
22644         * codegen.cs: EmitContext now contains a flag indicating whether
22645         code is being generated in a static method or not.
22646
22647         * cs-parser.jay: DecomposeQI, new function that replaces the old
22648         QualifiedIdentifier.  Now we always decompose the assembled
22649         strings from qualified_identifier productions into a group of
22650         memberaccesses.
22651
22652 2001-10-08  Miguel de Icaza  <miguel@ximian.com>
22653
22654         * rootcontext.cs: Deal with field-less struct types correctly now
22655         by passing the size option to Define Type.
22656
22657         * class.cs: Removed hack that created one static field. 
22658
22659 2001-10-07  Miguel de Icaza  <miguel@ximian.com>
22660
22661         * statement.cs: Moved most of the code generation here. 
22662
22663 2001-10-09  Ravi Pratap  <ravi@ximian.com>
22664
22665         * expression.cs (New::DoResolve): Revert changes for array creation, doesn't
22666         seem very right.
22667
22668         (ElementAccess): Remove useless bits for now - keep checks as the spec
22669         says.
22670
22671 2001-10-08  Ravi Pratap  <ravi@ximian.com>
22672
22673         * expression.cs (ElementAccess::DoResolve): Remove my crap code
22674         and start performing checks according to the spec.
22675
22676 2001-10-07  Ravi Pratap  <ravi@ximian.com>
22677
22678         * cs-parser.jay (type_suffix*): Remove - they are redundant. Use
22679         rank_specifiers instead.
22680
22681         (rank_specifiers): Change the order in which the rank specifiers are stored
22682
22683         (local_variable_declaration): Use opt_rank_specifier instead of type_suffixes.
22684
22685         * expression.cs (ElementAccess): Implement the LValue interface too.
22686
22687 2001-10-06  Ravi Pratap  <ravi@ximian.com>
22688
22689         * expression.cs (ConvertExplicitStandard): Add. Same as ConvertExplicit
22690         except that user defined conversions are not included.
22691
22692         (UserDefinedConversion): Update to use the ConvertExplicitStandard to 
22693         perform the conversion of the return type, if necessary.
22694
22695         (New::DoResolve): Check whether we are creating an array or an object
22696         and accordingly do the needful.
22697
22698         (New::Emit): Same here.
22699
22700         (New::DoResolve): Implement guts of array creation.
22701
22702         (New::FormLookupType): Helper function.
22703
22704 2001-10-07  Miguel de Icaza  <miguel@ximian.com>
22705
22706         * codegen.cs: Removed most of the code generation here, and move the
22707         corresponding code generation bits to the statement classes. 
22708
22709         Added support for try/catch/finalize and throw.
22710
22711         * cs-parser.jay: Added support for try/catch/finalize.
22712
22713         * class.cs: Catch static methods having the flags override,
22714         virtual or abstract.
22715
22716         * expression.cs (UserCast): This user cast was not really doing
22717         what it was supposed to do.  Which is to be born in fully resolved
22718         state.  Parts of the resolution were being performed at Emit time! 
22719
22720         Fixed this code.
22721
22722 2001-10-05  Miguel de Icaza  <miguel@ximian.com>
22723
22724         * expression.cs: Implicity convert the result from UserCast.
22725
22726 2001-10-05  Ravi Pratap  <ravi@ximian.com>
22727
22728         * expression.cs (Expression::FindMostEncompassingType): Fix bug which
22729         prevented it from working correctly. 
22730
22731         (ConvertExplicit): Make the first try, a call to ConvertImplicitStandard, not
22732         merely ConvertImplicit.
22733
22734 2001-10-05  Miguel de Icaza  <miguel@ximian.com>
22735
22736         * typemanager.cs: Make the LookupTypeContainer function static,
22737         and not per-instance.  
22738
22739         * class.cs: Make static FindMembers (the one that takes a Type
22740         argument). 
22741
22742         * codegen.cs: Add EmitForeach here.
22743
22744         * cs-parser.jay: Make foreach a toplevel object instead of the
22745         inline expansion, as we need to perform semantic analysis on it. 
22746
22747 2001-10-05  Ravi Pratap  <ravi@ximian.com>
22748
22749         * expression.cs (Expression::ImplicitUserConversion): Rename to
22750         UserDefinedConversion.
22751
22752         (Expression::UserDefinedConversion): Take an extra argument specifying 
22753         whether we look for explicit user conversions too.
22754
22755         (Expression::ImplicitUserConversion): Make it a call to UserDefinedConversion.
22756
22757         (UserDefinedConversion): Incorporate support for user defined explicit conversions.
22758
22759         (ExplicitUserConversion): Make it a call to UserDefinedConversion
22760         with the appropriate arguments.
22761
22762         * cs-parser.jay (cast_expression): Record location too.
22763
22764         * expression.cs (Cast): Record location info.
22765
22766         (Expression::ConvertExplicit): Take location argument.
22767
22768         (UserImplicitCast): Change name to UserCast. Take an extra constructor argument
22769         to determine if we are doing explicit conversions.
22770
22771         (UserCast::Emit): Update accordingly.
22772
22773         (Expression::ConvertExplicit): Report an error if everything fails.
22774
22775         * ../errors/cs0030.cs : Add.
22776
22777 2001-10-04  Miguel de Icaza  <miguel@ximian.com>
22778
22779         * modifiers.cs: If the ABSTRACT keyword is present, also set the
22780         virtual and newslot bits. 
22781
22782         * class.cs (TypeContainer::RegisterRequiredImplementations):
22783         Record methods we need.
22784
22785         (TypeContainer::MakeKey): Helper function to make keys for
22786         MethodBases, since the Methodbase key is useless.
22787
22788         (TypeContainer::Populate): Call RegisterRequiredImplementations
22789         before defining the methods.   
22790
22791         Create a mapping for method_builders_to_methods ahead of time
22792         instead of inside a tight loop.
22793
22794         (::RequireMethods):  Accept an object as the data to set into the
22795         hashtable so we can report interface vs abstract method mismatch.
22796
22797 2001-10-03  Miguel de Icaza  <miguel@ximian.com>
22798
22799         * report.cs: Make all of it static.
22800
22801         * rootcontext.cs: Drop object_type and value_type computations, as
22802         we have those in the TypeManager anyways.
22803
22804         Drop report instance variable too, now it is a global.
22805
22806         * driver.cs: Use try/catch on command line handling.
22807
22808         Add --probe option to debug the error reporting system with a test
22809         suite. 
22810
22811         * report.cs: Add support for exiting program when a probe
22812         condition is reached.
22813
22814 2001-10-03  Ravi Pratap  <ravi@ximian.com>
22815
22816         * expression.cs (Binary::DoNumericPromotions): Fix the case when
22817         we do a forcible conversion regardless of type, to check if 
22818         ForceConversion returns a null.
22819
22820         (Binary::error19): Use location to report error.
22821
22822         (Unary::error23): Use location here too.
22823
22824         * ../errors/cs0019.cs : Check in.
22825
22826         * ../errors/cs0023.cs : Check in.
22827
22828         * expression.cs (Expression.MemberLookup): Return null for a rather esoteric
22829         case of a non-null MethodInfo object with a length of 0 !
22830
22831         (Binary::ResolveOperator): Flag error if overload resolution fails to find
22832         an applicable member - according to the spec :-)
22833         Also fix logic to find members in base types.
22834
22835         (Unary::ResolveOperator): Same here.
22836
22837         (Unary::report23): Change name to error23 and make first argument a TypeContainer
22838         as I was getting thoroughly confused between this and error19 :-)
22839
22840         * expression.cs (Expression::ImplicitUserConversion): Re-write fully
22841         (::FindMostEncompassedType): Implement.
22842         (::FindMostEncompassingType): Implement.
22843         (::StandardConversionExists): Implement.
22844
22845         (UserImplicitCast): Re-vamp. We now need info about most specific
22846         source and target types so that we can do the necessary conversions.
22847
22848         (Invocation::MakeUnionSet): Completely re-write to make sure we form a proper
22849         mathematical union with no duplicates.
22850
22851 2001-10-03  Miguel de Icaza  <miguel@ximian.com>
22852
22853         * rootcontext.cs (RootContext::PopulateTypes): Populate containers
22854         in order from base classes to child classes, so that we can in
22855         child classes look up in our parent for method names and
22856         attributes (required for handling abstract, virtual, new, override
22857         constructs: we need to instrospect our base class, and if we dont
22858         populate the classes in order, the introspection might be
22859         incorrect.  For example, a method could query its parent before
22860         the parent has any methods and would determine that the parent has
22861         no abstract methods (while it could have had them)).
22862
22863         (RootContext::CreateType): Record the order in which we define the
22864         classes.
22865
22866 2001-10-02  Miguel de Icaza  <miguel@ximian.com>
22867
22868         * class.cs (TypeContainer::Populate): Also method definitions can
22869         fail now, keep track of this.
22870
22871         (TypeContainer::FindMembers): Implement support for
22872         DeclaredOnly/noDeclaredOnly flag.
22873
22874         (Constructor::Emit) Return the ConstructorBuilder.
22875
22876         (Method::Emit) Return the MethodBuilder. 
22877         Check for abstract or virtual methods to be public.
22878
22879         * rootcontext.cs (RootContext::CreateType): Register all the
22880         abstract methods required for the class to be complete and the
22881         interface methods that must be implemented. 
22882
22883         * cs-parser.jay: Report error 501 (method requires body if it is
22884         not marked abstract or extern).
22885
22886         * expression.cs (TypeOf::Emit): Implement.
22887
22888         * typemanager.cs: runtime_handle_type, new global type.
22889
22890         * class.cs (Property::Emit): Generate code for properties.
22891
22892 2001-10-02  Ravi Pratap  <ravi@ximian.com>
22893
22894         * expression.cs (Unary::ResolveOperator): Find operators on base type
22895         too - we now conform exactly to the spec.
22896
22897         (Binary::ResolveOperator): Same here.
22898
22899         * class.cs (Operator::Define): Fix minor quirk in the tests.
22900
22901         * ../errors/cs0215.cs : Added.
22902
22903         * ../errors/cs0556.cs : Added.
22904
22905         * ../errors/cs0555.cs : Added.
22906
22907 2001-10-01  Miguel de Icaza  <miguel@ximian.com>
22908
22909         * cs-tokenizer.cs: Reimplemented Location to be a struct with a
22910         single integer which is really efficient
22911
22912 2001-10-01  Ravi Pratap  <ravi@ximian.com>
22913
22914         *  expression.cs (Expression::ImplicitUserConversion): Use location
22915         even in the case when we are examining True operators.
22916  
22917         * class.cs (Operator::Define): Perform extensive checks to conform
22918         with the rules for operator overloading in the spec.
22919
22920         * expression.cs (Expression::ImplicitReferenceConversion): Implement
22921         some of the other conversions mentioned in the spec.
22922
22923         * typemanager.cs (array_type): New static member for the System.Array built-in
22924         type.
22925
22926         (cloneable_interface): For System.ICloneable interface.
22927
22928         * driver.cs (Driver::Driver): Initialize TypeManager's core types even before
22929         we start resolving the tree and populating types.
22930
22931         * ../errors/errors.txt : Update for error numbers -7, -8, -9, -10
22932  
22933 2001-10-01  Miguel de Icaza  <miguel@ximian.com>
22934
22935         * expression.cs (Expression::ExprClassFromMemberInfo,
22936         Expression::Literalize): Create literal expressions from
22937         FieldInfos which are literals.
22938
22939         (ConvertNumericExplicit, ImplicitNumericConversion): Fix a few
22940         type casts, because they were wrong.  The test suite in tests
22941         caught these ones.
22942
22943         (ImplicitNumericConversion): ushort to ulong requires a widening
22944         cast. 
22945
22946         Int32 constant to long requires widening cast as well.
22947
22948         * literal.cs (LongLiteral::EmitLong): Do not generate i4 constants
22949         for integers because the type on the stack is not i4.
22950
22951 2001-09-30  Miguel de Icaza  <miguel@ximian.com>
22952
22953         * expression.cs (report118): require location argument. 
22954
22955         * parameter.cs: Do not dereference potential null value.
22956
22957         * class.cs: Catch methods that lack the `new' keyword when
22958         overriding a name.  Report warnings when `new' is used without
22959         anything being there to override.
22960
22961         * modifiers.cs: Handle `NEW' as MethodAttributes.NewSlot.
22962
22963         * class.cs: Only add constructor to hashtable if it is non-null
22964         (as now constructors can fail on define).
22965
22966         (TypeManager, Class, Struct): Take location arguments.
22967
22968         Catch field instance initialization in structs as errors.
22969
22970         accepting_filter: a new filter for FindMembers that is static so
22971         that we dont create an instance per invocation.
22972
22973         (Constructor::Define): Catch errors where a struct constructor is
22974         parameterless 
22975
22976         * cs-parser.jay: Pass location information for various new
22977         constructs. 
22978
22979         * delegate.cs (Delegate): take a location argument.
22980
22981         * driver.cs: Do not call EmitCode if there were problesm in the
22982         Definition of the types, as many Builders wont be there. 
22983
22984         * decl.cs (Decl::Decl): Require a location argument.
22985
22986         * cs-tokenizer.cs: Handle properly hex constants that can not fit
22987         into integers, and find the most appropiate integer for it.
22988
22989         * literal.cs: Implement ULongLiteral.
22990
22991         * rootcontext.cs: Provide better information about the location of
22992         failure when CreateType fails.
22993
22994 2001-09-29  Miguel de Icaza  <miguel@ximian.com>
22995
22996         * rootcontext.cs (RootContext::PopulateTypes): Populates structs
22997         as well.
22998
22999         * expression.cs (Binary::CheckShiftArguments): Add missing type
23000         computation.
23001         (Binary::ResolveOperator): Add type to the logical and and logical
23002         or, Bitwise And/Or and Exclusive Or code paths, it was missing
23003         before.
23004
23005         (Binary::DoNumericPromotions): In the case where either argument
23006         is ulong (and most signed types combined with ulong cause an
23007         error) perform implicit integer constant conversions as well.
23008
23009 2001-09-28  Miguel de Icaza  <miguel@ximian.com>
23010
23011         * expression.cs (UserImplicitCast): Method should always be
23012         non-null. 
23013         (Invocation::BetterConversion): Simplified test for IntLiteral.
23014
23015         (Expression::ImplicitNumericConversion): Split this routine out.
23016         Put the code that performs implicit constant integer conversions
23017         here. 
23018
23019         (Expression::Resolve): Become a wrapper around DoResolve so we can
23020         check eclass and type being set after resolve.
23021
23022         (Invocation::Badness): Remove this dead function
23023
23024         (Binary::ResolveOperator): Do not compute the expensive argumnets
23025         unless we have a union for it.
23026
23027         (Probe::Emit): Is needs to do an isinst and then
23028         compare against null.
23029
23030         (::CanConvert): Added Location argument.  If the Location argument
23031         is null (Location.Null), then we do not report errors.  This is
23032         used by the `probe' mechanism of the Explicit conversion.  We do
23033         not want to generate an error for something that the user
23034         explicitly requested to be casted.  But the pipeline for an
23035         explicit cast first tests for potential implicit casts.
23036
23037         So for now, if the Location is null, it means `Probe only' to
23038         avoid adding another argument.   Might have to revise this
23039         strategy later.
23040
23041         (ClassCast): New class used to type cast objects into arbitrary
23042         classes (used in Explicit Reference Conversions).
23043
23044         Implement `as' as well.
23045
23046         Reverted all the patches from Ravi below: they were broken:
23047
23048                 * The use of `level' as a mechanism to stop recursive
23049                   invocations is wrong.  That was there just to catch the
23050                   bug with a strack trace but not as a way of addressing
23051                   the problem.
23052
23053                   To fix the problem we have to *understand* what is going
23054                   on and the interactions and come up with a plan, not
23055                   just get things going.
23056
23057                 * The use of the type conversion cache that I proposed
23058                   last night had an open topic: How does this work across
23059                   protection domains.  A user defined conversion might not
23060                   be public in the location where we are applying the
23061                   conversion, a different conversion might be selected
23062                   (ie, private A->B (better) but public B->A (worse),
23063                   inside A, A->B applies, but outside it, B->A will
23064                   apply).
23065
23066                 * On top of that (ie, even if the above is solved),
23067                   conversions in a cache need to be abstract.  Ie, `To
23068                   convert from an Int to a Short use an OpcodeCast', not
23069                   `To convert from an Int to a Short use the OpcodeCast on
23070                   the variable 5' (which is what this patch was doing).
23071
23072 2001-09-28  Ravi Pratap  <ravi@ximian.com>
23073
23074         * expression.cs (Invocation::ConversionExists): Re-write to use
23075         the conversion cache
23076
23077         (Expression::ConvertImplicit): Automatic bailing out if level != 0. Also
23078         cache all conversions done, not just user-defined ones.
23079
23080         (Invocation::BetterConversion): The real culprit. Use ConversionExists
23081         to determine if a conversion exists instead of acutually trying to 
23082         perform the conversion. It's faster too.
23083
23084         (Expression::ConvertExplicit): Modify to use ConversionExists to check
23085         and only then attempt the implicit conversion.
23086
23087 2001-09-28  Ravi Pratap  <ravi@ximian.com>
23088
23089         * expression.cs (ConvertImplicit): Use a cache for conversions
23090         already found. Check level of recursion and bail out if necessary.
23091
23092 2001-09-28  Miguel de Icaza  <miguel@ximian.com>
23093
23094         * typemanager.cs (string_concat_string_string, string_concat_object_object):
23095         Export standard methods that we expect for string operations.
23096
23097         * statement.cs (Block::UsageWarning): Track usage of variables and
23098         report the errors for not used variables.
23099
23100         * expression.cs (Conditional::Resolve, ::Emit): Implement ?:
23101         operator. 
23102
23103 2001-09-27  Miguel de Icaza  <miguel@ximian.com>
23104
23105         * codegen.cs: remove unnneded code 
23106
23107         * expression.cs: Removed BuiltinTypeAccess class
23108
23109         Fix the order in which implicit conversions are
23110         done.  
23111
23112         The previous fixed dropped support for boxed conversions (adding a
23113         test to the test suite now)
23114
23115         (UserImplicitCast::CanConvert): Remove test for source being null,
23116         that code is broken.  We should not feed a null to begin with, if
23117         we do, then we should track the bug where the problem originates
23118         and not try to cover it up here.
23119
23120         Return a resolved expression of type UserImplicitCast on success
23121         rather than true/false.  Ravi: this is what I was talking about,
23122         the pattern is to use a static method as a "constructor" for
23123         objects. 
23124
23125         Also, do not create arguments until the very last minute,
23126         otherwise we always create the arguments even for lookups that
23127         will never be performed. 
23128
23129         (UserImplicitCast::Resolve): Eliminate, objects of type
23130         UserImplicitCast are born in a fully resolved state. 
23131
23132         * typemanager.cs (InitCoreTypes): Init also value_type
23133         (System.ValueType). 
23134
23135         * expression.cs (Cast::Resolve): First resolve the child expression.
23136
23137         (LValue): Add new method AddressOf to be used by
23138         the `&' operator.  
23139
23140         Change the argument of Store to take an EmitContext instead of an
23141         ILGenerator, because things like FieldExpr need to be able to call
23142         their children expression to generate the instance code. 
23143
23144         (Expression::Error, Expression::Warning): Sugar functions for
23145         reporting errors.
23146
23147         (Expression::MemberLookup): Accept a TypeContainer instead of a
23148         Report as the first argument.
23149
23150         (Expression::ResolvePrimary): Killed.  I still want to improve
23151         this as currently the code is just not right.
23152
23153         (Expression::ResolveMemberAccess): Simplify, but it is still
23154         wrong. 
23155
23156         (Unary::Resolve): Catch errors in AddressOf operators.
23157
23158         (LocalVariableReference::Emit, ::Store, ::AddressOf): typecast
23159         index to a byte for the short-version, or the compiler will choose
23160         the wrong Emit call, which generates the wrong data.
23161
23162         (ParameterReference::Emit, ::Store): same.
23163
23164         (FieldExpr::AddressOf): Implement.
23165
23166         * typemanager.cs: TypeManager: made public variable instead of
23167         property.
23168
23169         * driver.cs: document --fatal.
23170
23171         * report.cs (ErrorMessage, WarningMessage): new names for the old
23172         Error and Warning classes.
23173
23174         * cs-parser.jay (member_access): Turn built-in access to types
23175         into a normal simplename
23176
23177 2001-09-27  Ravi Pratap  <ravi@ximian.com>
23178
23179         * expression.cs (Invocation::BetterConversion): Fix to cope
23180         with q being null, since this was introducing a bug.
23181
23182         * expression.cs (ConvertImplicit): Do built-in conversions first.
23183
23184 2001-09-27  Ravi Pratap  <ravi@ximian.com>
23185
23186         * expression.cs (UserImplicitCast::Resolve): Fix bug.
23187
23188 2001-09-27  Ravi Pratap  <ravi@ximian.com>
23189
23190         * class.cs (TypeContainer::AddConstructor): Fix a stupid bug
23191         I had introduced long ago (what's new ?).
23192
23193         * expression.cs (UserImplicitCast::CanConvert): Static method to do 
23194         the work of all the checking. 
23195         (ConvertImplicit): Call CanConvert and only then create object if necessary.
23196         (UserImplicitCast::CanConvert, ::Resolve): Re-write.
23197
23198         (Unary::Operator): Rename Add and Subtract to Addition and Subtraction because
23199         that is the right way. 
23200
23201         (Invocation::MakeUnionSet): Convenience function to make unions of sets for 
23202         overloading resolution. Use everywhere instead of cutting and pasting code.
23203
23204         (Binary::ResolveOperator): Use MakeUnionSet.
23205
23206         (UserImplicitCast::CanConvert, ::Resolve): Update to take care of the case when 
23207         we have to convert to bool types. Not complete yet.
23208
23209 2001-09-27  Miguel de Icaza  <miguel@ximian.com>
23210
23211         * typemanager.cs (TypeManager::CSharpName): support ushort.
23212
23213         * expression.cs (Expression::TryImplicitIntConversion): Attempts
23214         to provide an expression that performsn an implicit constant int
23215         conversion (section 6.1.6).
23216         (Expression::ConvertImplicitRequired): Reworked to include
23217         implicit constant expression conversions.
23218
23219         (Expression::ConvertNumericExplicit): Finished.
23220
23221         (Invocation::Emit): If InstanceExpression is null, then it means
23222         that we perform a call on this.
23223
23224 2001-09-26  Miguel de Icaza  <miguel@ximian.com>
23225
23226         * expression.cs (Unary::Emit): Remove some dead code.
23227         (Probe): Implement Resolve and Emit for `is'.
23228         (Expression::ConvertImplicitRequired): Attempt to do constant
23229         expression conversions here.  Maybe should be moved to
23230         ConvertImplicit, but I am not sure.
23231         (Expression::ImplicitLongConstantConversionPossible,
23232         Expression::ImplicitIntConstantConversionPossible): New functions
23233         that tell whether is it possible to apply an implicit constant
23234         expression conversion.
23235
23236         (ConvertNumericExplicit): Started work on explicit numeric
23237         conversions.
23238
23239         * cs-parser.jay: Update operator constants.
23240
23241         * parameter.cs (Parameters::GetParameterInfo): Hook up VerifyArgs
23242         (Parameters::GetSignature): Hook up VerifyArgs here.
23243         (Parameters::VerifyArgs): Verifies that no two arguments have the
23244         same name. 
23245
23246         * class.cs (Operator): Update the operator names to reflect the
23247         ones that the spec expects (as we are just stringizing the
23248         operator names).
23249
23250         * expression.cs (Unary::ResolveOperator): Fix bug: Use
23251         MethodInfo's ReturnType instead of LookupMethodByBuilder as the
23252         previous usage did only work for our methods.
23253         (Expression::ConvertImplicit): Handle decimal implicit numeric
23254         conversions as well.
23255         (Expression::InternalTypeConstructor): Used to invoke constructors
23256         on internal types for default promotions.
23257
23258         (Unary::Emit): Implement special handling for the pre/post
23259         increment/decrement for overloaded operators, as they need to have
23260         the same semantics as the other operators.
23261
23262         (Binary::ResolveOperator): ditto.
23263         (Invocation::ConversionExists): ditto.
23264         (UserImplicitCast::Resolve): ditto.
23265
23266 2001-09-26  Ravi Pratap  <ravi@ximian.com>
23267
23268         * expression.cs (Unary::Emit and Binary::Emit): If we have an overloaded
23269         operator, return after emitting body. Regression tests pass again !
23270
23271         * expression.cs (ConvertImplicit): Take TypeContainer as first argument
23272         (Unary::ForceConversion, Binary::ForceConversion): Ditto.
23273         (Invocation::OverloadResolve): Ditto.
23274         (Invocation::BetterFunction, BetterConversion, ConversionExists): Ditto.
23275
23276         * everywhere : update calls to the above methods accordingly.
23277
23278 2001-09-26  Miguel de Icaza  <miguel@ximian.com>
23279
23280         * assign.cs (Assign): Make it inherit from ExpressionStatement.
23281
23282         * expression.cs (ExpressionStatement): New base class used for
23283         expressions that can appear in statements, so that we can provide
23284         an alternate path to generate expression that do not leave a value
23285         on the stack.
23286
23287         (Expression::Emit, and all the derivatives): We no longer return
23288         whether a value is left on the stack or not.  Every expression
23289         after being emitted leaves a single value on the stack.
23290
23291         * codegen.cs (EmitContext::EmitStatementExpression): Use the
23292         facilties of ExpressionStatement if possible.
23293
23294         * cs-parser.jay: Update statement_expression.
23295
23296 2001-09-25  Miguel de Icaza  <miguel@ximian.com>
23297
23298         * driver.cs: Change the wording of message
23299
23300 2001-09-25  Ravi Pratap  <ravi@ximian.com>
23301
23302         * expression.cs (Binary::ResolveOperator): Had forgottten to set 
23303         the type of the expression to the return type of the method if
23304         we have an overloaded operator match ! The regression tests pass again !
23305         (Unary::ResolveOperator): Ditto.
23306
23307         * expression.cs (Invocation::ConversionExists): Correct the member lookup
23308         to find "op_Implicit", not "implicit" ;-)
23309         (UserImplicitCast): New class to take care of user-defined implicit conversions.
23310         (ConvertImplicit, ForceConversion): Take TypeContainer argument
23311
23312         * everywhere : Correct calls to the above accordingly.
23313
23314         * expression.cs (UserImplicitCast::Resolve, ::Emit): Implement.
23315         (ConvertImplicit): Do user-defined conversion if it exists.
23316
23317 2001-09-24  Miguel de Icaza  <miguel@ximian.com>
23318
23319         * assign.cs: track location.
23320         (Resolve): Use implicit conversions on assignment.
23321
23322         * literal.cs: Oops.  Not good, Emit of short access values should
23323         pass (Bytes) or the wrong argument will be selected.
23324
23325         * expression.cs (Unary::Emit): Emit code for -expr.
23326
23327         (Unary::ResolveOperator): Handle `Substract' for non-constants
23328         (substract from zero from the non-constants).
23329         Deal with Doubles as well. 
23330
23331         (Expression::ConvertImplicitRequired): New routine that reports an
23332         error if no implicit conversion exists. 
23333
23334         (Invocation::OverloadResolve): Store the converted implicit
23335         expressions if we make them
23336
23337 2001-09-24  Ravi Pratap  <ravi@ximian.com>
23338
23339         * class.cs (ConstructorInitializer): Take a Location argument.
23340         (ConstructorBaseInitializer): Same here.
23341         (ConstructorThisInitializer): Same here.
23342
23343         * cs-parser.jay : Update all calls accordingly.
23344
23345         * expression.cs (Unary, Binary, New): Take location argument.
23346         Update accordingly everywhere.
23347
23348         * cs-parser.jay : Update all calls to the above to take a location
23349         argument.
23350
23351         * class.cs : Ditto.
23352
23353 2001-09-24  Ravi Pratap  <ravi@ximian.com>
23354
23355         * expression.cs (Invocation::BetterFunction): Take TypeContainer argument
23356         (Invocation::BetterConversion): Same here
23357         (Invocation::ConversionExists): Ditto.
23358
23359         (Invocation::ConversionExists): Implement.
23360
23361 2001-09-22  Ravi Pratap  <ravi@ximian.com>
23362
23363         * expression.cs (OverloadResolve): Improve some more to catch errors 1502 and 1503
23364         Also take an additional TypeContainer argument.
23365
23366         * All over : Pass in TypeContainer as argument to OverloadResolve.
23367
23368         * typemanager.cs (CSharpName): Update to check for the string type and return
23369         that too.
23370
23371         * expression.cs (Invocation::FullMethodDesc): New static method to return a string fully describing
23372         a given method.
23373
23374 2001-09-21  Ravi Pratap  <ravi@ximian.com>
23375
23376         * expression.cs (Invocation::OverloadResolve): Re-write to conform more to the spec.
23377         (Invocation::BetterFunction): Implement.
23378         (Invocation::BetterConversion): Implement.
23379         (Invocation::ConversionExists): Skeleton, no implementation yet.
23380
23381         Okay, things work fine !
23382
23383 2001-09-21  Miguel de Icaza  <miguel@ximian.com>
23384
23385         * typemanager.cs: declare and load enum_type, delegate_type and
23386         void_type. 
23387
23388         * expression.cs (Expression::Emit): Now emit returns a value that
23389         tells whether a value is left on the stack or not.  This strategy
23390         might be reveted tomorrow with a mechanism that would address
23391         multiple assignments.
23392         (Expression::report118): Utility routine to report mismatches on
23393         the ExprClass.
23394
23395         (Unary::Report23): Report impossible type/operator combination
23396         utility function.
23397
23398         (Unary::IsIncrementableNumber): Whether the type can be
23399         incremented or decremented with add.
23400         (Unary::ResolveOperator): Also allow enumerations to be bitwise
23401         complemented. 
23402         (Unary::ResolveOperator): Implement ++, !, ~,
23403
23404         (Invocation::Emit): Deal with new Emit convetion.
23405
23406         * All Expression derivatives: Updated their Emit method to return
23407         whether they leave values on the stack or not.
23408
23409         * codegen.cs (CodeGen::EmitStatement): Pop values left on the
23410         stack for expressions that are statements. 
23411
23412 2001-09-20  Miguel de Icaza  <miguel@ximian.com>
23413
23414         * expression.cs (LValue): New interface.  Must be implemented by
23415         LValue objects.
23416         (LocalVariableReference, ParameterReference, FieldExpr): Implement
23417         LValue interface.
23418
23419         * assign.cs (Assign::Emit, Assign::Resolve): Use new LValue
23420         interface for generating code, simplifies the code.
23421
23422 2001-09-20  Ravi Pratap  <ravi@ximian.com>
23423
23424         * expression.cs (everywhere): Comment out return statements in ::Resolve
23425         methods to avoid the warnings.
23426
23427 2001-09-20  Miguel de Icaza  <miguel@ximian.com>
23428
23429         * driver.cs (parse): Report error 2001 if we can not open the
23430         source file.
23431
23432         * expression.cs (SimpleName::ResolveSimpleName): Error if we can
23433         not resolve it.
23434
23435         * cs-parser.jay (QualifierIdentifier): Pass location to SimpleName
23436         object. 
23437
23438         * statement.cs (Block::EmitMeta): Reuse the count across all the variables,
23439         otherwise nested blocks end up with the same index.
23440
23441         * codegen.cs (CodeGen::EmitTopBlock): Pass initial sequence
23442
23443         * expression.cs:  Instead of having FIXMEs in the Resolve
23444         functions, throw exceptions so it is obvious that we are facing a
23445         bug. 
23446
23447         * cs-parser.jay (invocation_expression): Pass Location information.
23448
23449         * codegen.cs (CodeGen::Save, CodeGen::CodeGen, CodeGen::Basename):
23450         Use a basename for those routines because .NET does not like paths
23451         on them. 
23452
23453         * class.cs (TypeContainer::AddMethod): Do not call DefineName if the name was
23454         already defined.
23455
23456 2001-09-19  Miguel de Icaza  <miguel@ximian.com>
23457
23458         * typemanager.cs (TypeManager::CoreLookupType): A function to make sure that we
23459         are loading the correct data types (throws an exception if not).
23460         (TypeManager::InitCoreTypes): Use CoreLookupType
23461
23462         * expression.cs (Unary::ResolveOperator): return the child
23463         expression for expressions which are just +expr.
23464         (Unary::ResolveOperator): Return negative literals for -LITERAL
23465         expressions (otherwise they are Unary {Literal}).
23466         (Invocation::Badness): Take into account `Implicit constant
23467         expression conversions'.
23468
23469         * literal.cs (LongLiteral): Implement long literal class.
23470         (IntLiteral): export the `Value' of the intliteral. 
23471
23472 2001-09-19  Ravi Pratap  <ravi@ximian.com>
23473
23474         * expression.cs (Binary::Emit): Finally get the emission right ! Woo!
23475
23476         * class.cs (Operator::Define): Change the methodname prefix to 'op_' 
23477         instead of 'Operator'
23478
23479         * expression.cs (Binary::ResolveOperator): Update accordingly.
23480         (Unary::Operator): Change names to 'Add' and 'Subtract' instead 'Plus'
23481         and 'Minus'
23482
23483         * cs-parser.jay (unary_expression): Update to use the new names.
23484
23485         * gen-treedump.cs (GetUnary): Same here.
23486
23487         * expression.cs (Unary::Resolve): Implement.
23488         (Binary::ResolveOperator): Re-write bits to quietly continue if no overloaded 
23489         operators are found instead of making noise ;-)
23490         (Unary::ResolveOperator): New method to do precisely the same thing which
23491         Binary::ResolveOperator does for Binary expressions.
23492         (Unary.method, .Arguments): Add.
23493         (Unary::OperName): Implement.   
23494         (Unary::ForceConversion): Copy and Paste !
23495
23496         * class.cs (Operator::Define): Fix a small bug for the case when we have 
23497         a unary operator.
23498
23499         * expression.cs (Unary::Emit): Implement. Need to find the right Opcodes
23500         for the inbuilt operators. Only overloading works for now ;-)
23501
23502 2001-09-18  Miguel de Icaza  <miguel@ximian.com>
23503
23504         * expression.cs (CheckedExpr::Resolve, CheckedExpr::Emit,
23505         UnCheckedExpr::Resolve, UnCheckedExpr::Emit): Implement.
23506
23507         * expression.cs (This::Emit): Implement. 
23508         (This::Resolve): Implement.
23509         (TypeOf:Resolve): Implement.
23510         (Expression::ResolveSimpleName): Add an implicit this to instance
23511         field references. 
23512         (MemberAccess::Resolve): Deal with Parameters and Fields. 
23513         Bind instance variable to Field expressions.
23514         (FieldExpr::Instance): New field used to track the expression that
23515         represents the object instance.
23516         (FieldExpr::Resolve): Track potential errors from MemberLookup not
23517         binding 
23518         (FieldExpr::Emit): Implement.
23519
23520         * codegen.cs (EmitIf, EmitStatement, EmitBlock): Propagate whether
23521         the last instruction contains a return opcode to avoid generating
23522         the last `ret' instruction (this generates correct code, and it is
23523         nice to pass the peverify output).
23524
23525         * class.cs (TypeContainer::EmitFieldInitializers): Implement field
23526         initializer for static and instance variables.
23527         (Constructor::Emit): Allow initializer to be null in the case of
23528         static constructors.  Only emit initializer for instance
23529         constructors. 
23530
23531         (TypeContainer::FindMembers): Return a null array if there are no
23532         matches.
23533
23534         Also fix the code for the MemberTypes.Method branch, as it was not
23535         scanning that for operators (or tried to access null variables before).
23536
23537         * assign.cs (Assign::Emit): Handle instance and static fields. 
23538
23539         * TODO: Updated.
23540
23541         * driver.cs: Stop compilation if there are parse errors.
23542
23543         * cs-parser.jay (constructor_declaration): Provide default base
23544         initializer for non-static constructors.
23545         (constructor_declarator): Do not provide a default base
23546         initializers if none was specified.
23547         Catch the fact that constructors should not have parameters.
23548
23549         * class.cs: Do not emit parent class initializers for static
23550         constructors, that should be flagged as an error.
23551
23552 2001-09-18  Ravi Pratap  <ravi@ximian.com>
23553
23554         * class.cs (RegisterMethodBuilder): Remove : it's unnecessary.
23555         Move back code into TypeContainer::Populate.
23556
23557 2001-09-18  Ravi Pratap  <ravi@ximian.com>
23558
23559         * class.cs (TypeContainer::AddConstructor): Fix the check to
23560         compare against Name, not Basename. 
23561         (Operator::OpType): Change Plus and Minus to Add and Subtract.
23562
23563         * cs-parser.jay : Update accordingly.
23564
23565         * class.cs (TypeContainer::FindMembers): For the case where we are searching
23566         for methods, don't forget to look into the operators too.
23567         (RegisterMethodBuilder): Helper method to take care of this for
23568         methods, constructors and operators.
23569         (Operator::Define): Completely revamp.
23570         (Operator.OperatorMethod, MethodName): New fields.
23571         (TypeContainer::Populate): Move the registering of builders into
23572         RegisterMethodBuilder.
23573         (Operator::Emit): Re-write.
23574
23575         * expression.cs (Binary::Emit): Comment out code path to emit method
23576         invocation stuff for the case when we have a user defined operator. I am
23577         just not able to get it right !
23578
23579 2001-09-17  Miguel de Icaza  <miguel@ximian.com>
23580
23581         * expression.cs (Expression::OverloadResolve): Drop TypeContainer
23582         argument. 
23583
23584         (Expression::MemberLookup): Provide a version that allows to
23585         specify the MemberTypes and BindingFlags. 
23586
23587         * statement.cs (Block::GetVariableInfo): Forgot to recurse here,
23588         so it was not fetching variable information from outer blocks.
23589
23590         * modifiers.cs: (Modifiers::TypeAttr): Invert condition on
23591         Beforefieldinit as it was buggy.
23592
23593         * rootcontext.cs (::LookupInterfaceOrClass): Removed an Error -200
23594         that Ravi put here.  
23595
23596         * class.cs (Constructor::Emit): Only emit if block is not null.
23597         (TypeContainer::EmitDefaultConstructor): Removed routine, now we
23598         deal with this by semantically definining it as if the user had
23599         done it.
23600
23601         (TypeContainer::FindMembers): Removed ad-hoc hack to deal with
23602         constructors as we now "emit" them at a higher level.
23603
23604         (TypeContainer::DefineDefaultConstructor): Used to define the
23605         default constructors if none was provided.
23606
23607         (ConstructorInitializer): Add methods Resolve and Emit. 
23608
23609         * expression.cs: Cast to ConstructorInfo instead of MethodInfo
23610
23611 2001-09-17  Ravi Pratap  <ravi@ximian.com>
23612
23613         * class.cs (TypeContainer::EmitDefaultConstructor): Register
23614         the default constructor builder with our hashtable for methodbuilders
23615         to methodcores.
23616
23617         * expression.cs (Invocation::OverloadResolve): Add a check for pd == null
23618         and argument_count is 0 in which case we have a match.
23619         (Binary::ResolveOperator): More null checking and miscellaneous coding
23620         style cleanup.
23621
23622 2001-09-17  Ravi Pratap  <ravi@ximian.com>
23623
23624         * rootcontext.cs (IsNameSpace): Compare against null.
23625
23626         * everywhere : Correct spelling to 'Greater' and to 'Subtract'
23627
23628         * class.cs (Operator::OpType): Change names to match the ones in Binary::Operator
23629         and Unary::Operator.
23630
23631         * cs-parser.jay (operator_declaration, CheckBinaryOperator, CheckUnaryOperator): Update
23632         accordingly.
23633
23634         * expression.cs (Binary::method): New member to hold the MethodBase for the case when
23635         we have overloaded operators.
23636         (Binary::ResolveOperator): Implement the part which does the operator overload
23637         resolution.
23638
23639         * class.cs (Operator::Emit): Implement.
23640         (TypeContainer::Emit): Emit the operators we have too.
23641
23642         * expression.cs (Binary::Emit): Update to emit the appropriate code for
23643         the case when we have a user-defined operator.
23644
23645 2001-09-17  Miguel de Icaza  <miguel@ximian.com>
23646
23647         * rootcontext.cs: Fix bug: tree.Namespaces might be null.
23648
23649 2001-09-16  Ravi Pratap  <ravi@ximian.com>
23650
23651         * class.cs (EmitStaticFieldInitializers, EmitFieldInitializers): Make public.
23652         (TypeContainer::EmitConstructor): Remove and move code into Contructor::Emit.
23653         (Constructor::Emit): Implement.
23654         (EmitStaticFieldInitializers, EmitFieldInitializers): Ensure we return immediately
23655         if we have no work to do. 
23656         (TypeContainer::Emit): Pass in TypeContainer as argument to the constructor's 
23657         Emit method.
23658
23659         * interface.cs (Interface::InterfaceAttr): Re-write to be more correct and complete.
23660         (Interface::IsTopLevel): Add. Same as TypeContainer::IsTopLevel.
23661
23662         * class.cs (TypeContainer::IsTopLevel): Modify to use parent.Parent instead
23663         of parent.parent.
23664
23665 2001-09-15  Ravi Pratap  <ravi@ximian.com>
23666
23667         * tree.cs (Tree::namespaces): New hashtable to keep track of namespaces
23668         in the source.
23669         (Tree::RecordNamespace): Method to do what the name says ;-)
23670         (Tree::Namespaces): Property to get at the namespaces hashtable.
23671
23672         * cs-parser.jay (namespace_declaration): Call RecordNamespace to 
23673         keep track.
23674
23675         * rootcontext.cs (IsNamespace): Fixed it :-)
23676
23677 2001-09-14  Miguel de Icaza  <miguel@ximian.com>
23678
23679         * class.cs (TypeContainer::FindMembers): Add support for
23680         constructors. 
23681         (MethodCore): New class that encapsulates both the shared aspects
23682         of a Constructor and a Method.  
23683         (Method, Constructor): Factored pieces into MethodCore.
23684
23685         * driver.cs: Added --fatal which makes errors throw exceptions.
23686         Load System assembly as well as part of the standard library.
23687
23688         * report.cs: Allow throwing exceptions on errors for debugging.
23689
23690         * modifiers.cs: Do not use `parent', instead use the real type
23691         container to evaluate permission settings.
23692
23693         * class.cs: Put Ravi's patch back in.  He is right, and we will
23694         have to cope with the
23695
23696 2001-09-14  Ravi Pratap  <ravi@ximian.com>
23697
23698         * modifiers.cs (TypeAttr, MethodAttr, FieldAttr): Map protected internal to
23699         FamORAssem, not FamANDAssem.
23700
23701 2001-09-14  Miguel de Icaza  <miguel@ximian.com>
23702
23703         * driver.cs: Added --parse option that only parses its input files
23704         and terminates.
23705
23706         * class.cs: Reverted last change from Ravi to IsTopLevel.  That is
23707         incorrect.  IsTopLevel is not used to tell whether an object is
23708         root_types or not (that can be achieved by testing this ==
23709         root_types).  But to see if this is a top-level *class* (not
23710         necessarly our "toplevel" container). 
23711
23712 2001-09-14  Ravi Pratap  <ravi@ximian.com>
23713
23714         * enum.cs (Enum::Define): Modify to call the Lookup method on the
23715         parent instead of a direct call to GetType.
23716
23717 2001-09-14  Ravi Pratap  <ravi@ximian.com>
23718
23719         * class.cs (TypeContainer::TypeAttr): Remove property code and move it into
23720         Modifiers.TypeAttr. This should just be a call to that method.
23721
23722         * modifiers.cs (TypeAttr): Re-write and take an extra argument, the TypeContainer
23723         object so that we can determine if we are top-level or not.
23724
23725         * delegate.cs (Delegate::Define): Update call to TypeAttr method to pass in the 
23726         TypeContainer too.
23727
23728         * enum.cs (Enum::Define): Ditto.
23729
23730         * modifiers.cs (FieldAttr): Re-write.
23731
23732         * class.cs (TypeContainer::IsTopLevel): Change accessibility to public.
23733         (TypeContainer::HaveStaticConstructor): New property to provide access
23734         to precisely that info.
23735
23736         * modifiers.cs (MethodAttr): Re-write.
23737         (EventAttr): Remove altogether as there seems to be no ostensible use for it.
23738
23739         * class.cs (TypeContainer::IsTopLevel): Re-write. root_types doesn't seem to be the parent
23740         of top-level types as claimed.
23741
23742 2001-09-13  Miguel de Icaza  <miguel@ximian.com>
23743
23744         * expression.cs (MemberLookup): Fruitless attempt to lookup
23745         constructors.  Maybe I need to emit default constructors?  That
23746         might be it (currently .NET emits this for me automatically).
23747         (Invocation::OverloadResolve): Cope with Arguments == null.
23748         (Invocation::EmitArguments): new function, shared by the new
23749         constructor and us.
23750         (Invocation::Emit): Handle static and instance methods.  Emit
23751         proper call instruction for virtual or non-virtual invocations.
23752         (New::Emit): Implement.
23753         (New::Resolve): Implement.
23754         (MemberAccess:Resolve): Implement.
23755         (MethodGroupExpr::InstanceExpression): used conforming to the spec
23756         to track instances.
23757         (FieldExpr::Resolve): Set type.
23758
23759         * support.cs: Handle empty arguments.
23760                 
23761         * cs-parser.jay (CompositeLookup, QualifierIdentifier,
23762         SimpleLookup): Auxiliary routines to help parse a qualifier
23763         identifier.  
23764
23765         Update qualifier_identifier rule.
23766
23767         * codegen.cs: Removed debugging messages.
23768
23769         * class.cs: Make this a global thing, this acts just as a "key" to
23770         objects that we might have around.
23771
23772         (Populate): Only initialize method_builders_to_methods once.
23773
23774         * expression.cs (PropertyExpr): Initialize type from the
23775         PropertyType. 
23776
23777         * codegen.cs (EmitContext::EmitBoolExpression): Use propper
23778         Resolve pattern.  Attempt to implicitly convert value to boolean.
23779         Emit code.
23780
23781         * expression.cs: Set the type for the int32/int32 argument case.
23782         (Binary::ResolveOperator): Set the return type to boolean for
23783         comparission operators
23784
23785         * typemanager.cs: Remove debugging print code.
23786
23787         (Invocation::Resolve): resolve type.
23788
23789         * class.cs: Allocate a MemberInfo of the correct size, as the code
23790         elsewhere depends on the test to reflect the correct contents.
23791
23792         (Method::) Keep track of parameters, due to System.Reflection holes
23793
23794         (TypeContainer::Populate): Keep track of MethodBuilders to Method
23795         mapping here.
23796
23797         (TypeContainer::FindMembers): Use ArrayList and then copy an array
23798         of the exact size and return that.
23799
23800         (Class::LookupMethodByBuilder): New function that maps
23801         MethodBuilders to its methods.  Required to locate the information
23802         on methods because System.Reflection bit us again.
23803
23804         * support.cs: New file, contains an interface ParameterData and
23805         two implementations: ReflectionParameters and InternalParameters
23806         used to access Parameter information.  We will need to grow this
23807         as required.
23808
23809         * expression.cs (Invocation::GetParameterData): implement a cache
23810         and a wrapper around the ParameterData creation for methods. 
23811         (Invocation::OverloadResolve): Use new code.
23812
23813 2001-09-13  Ravi Pratap  <ravi@ximian.com>
23814
23815         * class.cs (TypeContainer::EmitField): Remove and move into 
23816         (Field::Define): here and modify accordingly.
23817         (Field.FieldBuilder): New member.
23818         (TypeContainer::Populate): Update accordingly.
23819         (TypeContainer::FindMembers): Implement.
23820
23821 2001-09-13  Miguel de Icaza  <miguel@ximian.com>
23822
23823         * statement.cs: (VariableInfo::VariableType): New field to be
23824         initialized with the full type once it is resolved. 
23825
23826 2001-09-12  Miguel de Icaza  <miguel@ximian.com>
23827
23828         * parameter.cs (GetParameterInfo): Use a type cache to compute
23829         things only once, and to reuse this information
23830
23831         * expression.cs (LocalVariableReference::Emit): Implement.
23832         (OpcodeCast::Emit): fix.
23833
23834         (ParameterReference::Resolve): Implement.
23835         (ParameterReference::Emit): Implement.
23836
23837         * cs-parser.jay: Fix bug introduced by Ravi, variable initializers
23838         that are expressions need to stay as Expressions.
23839
23840         * typemanager.cs (CSharpName): Returns the C# name of a type if
23841         possible. 
23842
23843         * expression.cs (Expression::ConvertImplicit): New function that
23844         implements implicit type conversions.
23845
23846         (Expression::ImplicitReferenceConversion): Implements implicit
23847         reference conversions.
23848
23849         (EmptyCast): New type for transparent casts.
23850
23851         (OpcodeCast): New type for casts of types that are performed with
23852         a sequence of bytecodes.
23853
23854         (BoxedCast): New type used for casting value types into reference
23855         types.  Emits a box opcode.
23856
23857         (Binary::DoNumericPromotions): Implements numeric promotions of
23858         and computation of the Binary::Type.
23859
23860         (Binary::EmitBranchable): Optimization.
23861
23862         (Binary::Emit): Implement code emission for expressions.
23863
23864         * typemanager.cs (TypeManager): Added two new core types: sbyte
23865         and byte.
23866
23867 2001-09-12  Ravi Pratap  <ravi@ximian.com>
23868
23869         * class.cs (TypeContainer::FindMembers): Method which does exactly
23870         what Type.FindMembers does, only we don't have to use reflection. No
23871         implementation yet.
23872
23873         * typemanager.cs (typecontainers): New hashtable to hold the corresponding
23874         typecontainer objects as we need to get at them.
23875         (TypeManager::AddUserType): Overload to take an extra argument, the TypeContainer.
23876
23877         * rootcontext.cs : Correspondingly modify called to AddUserType to pass the
23878         typecontainer object.
23879
23880         * expression.cs (MemberLookup): Modify signature to take a RootContext object instead
23881         of just a Report object.
23882
23883 2001-09-11  Ravi Pratap  <ravi@ximian.com>
23884
23885         * class.cs (Event::Define): Go back to using the prefixes "add_" and
23886         "remove_"
23887         (TypeContainer::Populate): Now define the delegates of the type too.
23888         (TypeContainer.Delegates): Property to access the list of delegates defined
23889         in the type.
23890
23891         * delegates.cs (Delegate::Define): Implement partially.
23892
23893         * modifiers.cs (TypeAttr): Handle more flags.
23894
23895 2001-09-11  Ravi Pratap  <ravi@ximian.com>
23896
23897         * class.cs (Indexer::Define): Fix for loop iteration condition to be just <
23898         and not <=
23899         (Operator::Define): Re-write logic to get types by using the LookupType method
23900         instead of blindly doing a Type.GetType ! How stupid can I get ;-) ?
23901         (Indexer::Define): Ditto.
23902         (Event::Define): Ditto.
23903         (Property::Define): Ditto.
23904
23905 2001-09-10  Ravi Pratap  <ravi@ximian.com>
23906
23907         * class.cs (TypeContainer::Populate): Now define operators too. 
23908         (TypeContainer.Operators): New property to access the list of operators
23909         in a type.
23910         (Operator.OperatorMethodBuilder): New member to hold the method builder
23911         for the operator we are defining.
23912         (Operator::Define): Implement.
23913
23914 2001-09-10  Ravi Pratap  <ravi@ximian.com>
23915
23916         * class.cs (Event::Define): Make the prefixes of the accessor methods
23917         addOn_ and removeOn_ 
23918
23919         * genericparser.cs (GenericParser::error): Overloaded method to handle the case
23920         of the location being passed in too. Ideally, this should go later since all
23921         error reporting should be done through the Report object.
23922
23923         * class.cs (TypeContainer.Indexers): New property to access the list of indexers.
23924         (Populate): Iterate thru the indexers we have and define them too.
23925         (Indexer.GetMethodBuilder, .SetMethodBuilder): New members to hold the method builders
23926         for the get and set accessors.
23927         (Indexer::Define): Implement.
23928
23929 2001-09-09  Miguel de Icaza  <miguel@ximian.com>
23930
23931         * expression.cs (Binary::Resolve): Beginning of it.  I scratched
23932         my previous implementation, did not work.
23933
23934         * typemanager.cs: Add a couple of missing types (the longs).
23935
23936         * literal.cs: Use TypeManager.bool_type instead of getting it.
23937
23938         * expression.cs (EventExpr): New kind of expressions.
23939         (Expressio::ExprClassFromMemberInfo): finish
23940
23941 2001-09-08  Miguel de Icaza  <miguel@ximian.com>
23942
23943         * assign.cs: Emit stores to static fields differently.
23944
23945 2001-09-08  Ravi Pratap  <ravi@ximian.com>
23946
23947         * Merge in changes and adjust code to tackle conflicts. Backed out my
23948         code in Assign::Resolve ;-) 
23949
23950 2001-09-08  Ravi Pratap  <ravi@ximian.com>
23951
23952         * cs-parser.jay (CheckAttributeTarget): Modify call to error to use
23953         instead Report.Error and also pass in the location.
23954         (CSharpParser::Lexer): New readonly property to return the reference
23955         to the Tokenizer object.
23956         (declare_local_variables): Use Report.Error with location instead of plain 
23957         old error.
23958         (CheckDef): Ditto.
23959
23960         * class.cs (Operator::CheckUnaryOperator): Move into cs-parser.jay.
23961         (Operator.CheckBinaryOperator): Ditto.
23962
23963         * cs-parser.jay (operator_declarator): Update accordingly.
23964
23965         * cs-parser.jay (CheckUnaryOperator): Modify to use Report.Error
23966         (CheckBinaryOperator): Same here.
23967
23968         * rootcontext.cs (LookupType): Add an extra lookup which simply does a lookup
23969         on the name without any prefixes of namespace names etc. This is because we
23970         already might have something already fully qualified like 
23971         'System.Console.WriteLine'
23972
23973         * assign.cs (Resolve): Begin implementation. Stuck ;-)
23974
23975 2001-09-07  Ravi Pratap  <ravi@ximian.com>
23976
23977         * cs-tokenizer.cs (location): Return a string which also contains
23978         the file name.
23979
23980         * expression.cs (ElementAccess): New class for expressions of the
23981         type 'element access.'
23982         (BaseAccess): New class for expressions of the type 'base access.'
23983         (CheckedExpr, UnCheckedExpr): New classes for Checked and Unchecked expressions
23984         respectively.
23985
23986         * cs-parser.jay (element_access): Implement action.
23987         (base_access): Implement actions.
23988         (checked_expression, unchecked_expression): Implement.
23989
23990         * cs-parser.jay (local_variable_type): Correct and implement.
23991         (type_suffixes, type_suffix_list, type_suffix): Implement actions.
23992
23993         * cs-tokenizer.cs (real_type_suffix): Comment out the extra getchar.
23994
23995         * cs-parser.jay (rank_specifiers): Remove space while concatenating the type's
23996         name and the specifiers.
23997
23998         * interface.cs (InterfaceAttr): New property to return the corresponding TypeAttributes
23999
24000         * rootcontext.cs (CreateInterface): Use the InterfaceAttr property instead of 
24001         making them all public ;-)
24002
24003         * cs-parser.jay (error): Remove entirely as we have an implementation in the base
24004         class anyways.
24005
24006 2001-09-07  Miguel de Icaza  <miguel@ximian.com>
24007
24008         * expression.cs (ExprClassFromMemberInfo): Return FieldExpr and
24009         PropertyExprs.
24010         (FieldExpr, PropertyExprs): New resolved expressions.
24011         (SimpleName::MemberStaticCheck): Perform static checks for access
24012         to non-static fields on static methods. Maybe this should be
24013         generalized for MemberAccesses. 
24014         (SimpleName::ResolveSimpleName): More work on simple name
24015         resolution. 
24016
24017         * cs-parser.jay (primary_expression/qualified_identifier): track
24018         the parameter index.
24019
24020         * codegen.cs (CodeGen::Save): Catch save exception, report error.
24021         (EmitContext::EmitBoolExpression): Chain to expression generation
24022         instead of temporary hack.
24023         (::EmitStatementExpression): Put generic expression code generation.
24024
24025         * assign.cs (Assign::Emit): Implement variable assignments to
24026         local variables, parameters and fields.
24027
24028 2001-09-06  Miguel de Icaza  <miguel@ximian.com>
24029
24030         * statement.cs (Block::GetVariableInfo): New method, returns the
24031         VariableInfo for a variable name in a block.
24032         (Block::GetVariableType): Implement in terms of GetVariableInfo
24033
24034         * literal.cs (IntLiteral::Emit, FloatLiteral::Emit,
24035         DoubleLiteral::Emit, CharLiteral::Emit, BoolLiteral::Emit): Implement
24036
24037 2001-09-06  Ravi Pratap  <ravi@ximian.com>
24038
24039         * cs-parser.jay (operator_declaration): Continue on my quest : update
24040         to take attributes argument.
24041         (event_declaration): Ditto.
24042         (enum_declaration): Ditto.
24043         (indexer_declaration): Ditto.
24044
24045         * class.cs (Operator::Operator): Update constructor accordingly.
24046         (Event::Event): Ditto.
24047
24048         * delegate.cs (Delegate::Delegate): Same here.
24049
24050         * enum.cs (Enum::Enum): Same here.
24051
24052 2001-09-05  Ravi Pratap  <ravi@ximian.com>
24053
24054         * cs-parser.jay (CheckAttributeTarget): Update to use the right error number.
24055
24056         * ../tests/cs0658.cs : New file to demonstrate error 0658.
24057
24058         * attribute.cs (Attributes): New class to encapsulate all attributes which were
24059         being passed around as an arraylist.
24060         (Attributes::AddAttribute): Method to add attribute sections.
24061
24062         * cs-parser.jay (opt_attributes): Modify actions to use the new Attributes class.
24063         (struct_declaration): Update accordingly.
24064         (constant_declaration): Update.
24065         (field_declaration): Update.
24066         (method_header): Update.
24067         (fixed_parameter): Update.
24068         (parameter_array): Ditto.
24069         (property_declaration): Ditto.
24070         (destructor_declaration): Ditto.
24071
24072         * class.cs (Struct::Struct): Update constructors accordingly.
24073         (Class::Class): Ditto.
24074         (Field::Field): Ditto.
24075         (Method::Method): Ditto.
24076         (Property::Property): Ditto.
24077         (TypeContainer::OptAttribute): update property's return type.
24078
24079         * interface.cs (Interface.opt_attributes): New member.
24080         (Interface::Interface): Update to take the extra Attributes argument.
24081
24082         * parameter.cs (Parameter::Parameter): Ditto.
24083
24084         * constant.cs (Constant::Constant): Ditto.
24085
24086         * interface.cs (InterfaceMemberBase): New OptAttributes field.
24087         (InterfaceMemberBase::InterfaceMemberBase): Update constructor to take 
24088         the attributes as a parameter.
24089         (InterfaceProperty): Update constructor call.
24090         (InterfaceEvent): Ditto.
24091         (InterfaceMethod): Ditto.
24092         (InterfaceIndexer): Ditto.
24093
24094         * cs-parser.jay (interface_indexer_declaration): Update call to constructor to 
24095         pass the attributes too.
24096         (interface_event_declaration): Ditto.
24097         (interface_property_declaration): Ditto.
24098         (interface_method_declaration): Ditto.
24099         (interface_declaration): Ditto.
24100
24101 2001-09-05  Miguel de Icaza  <miguel@ximian.com>
24102
24103         * class.cs (Method::Define): Track the "static Main" definition to
24104         create an entry point. 
24105
24106         * rootcontext.cs (RootContext::EntryPoint): MethodInfo that holds the
24107         EntryPoint if we find it. 
24108
24109         * codegen.cs (EmitContext::EmitInvocation): Emit invocations.
24110         (EmitContext::ig): Make this variable public.
24111
24112         * driver.cs: Make the default output file be the first file name
24113         with the .exe extension.  
24114
24115         Detect empty compilations
24116
24117         Handle various kinds of output targets.  Handle --target and
24118         rename -t to --dumper.
24119
24120         * expression.cs, literal.cs, assign.cs, constant.cs: All `Resolve'
24121         methods inherited from Expression return now an Expression.  This
24122         will is used during the tree rewriting as we resolve them during
24123         semantic analysis.
24124
24125         (Expression::MemberLookup): Implements the MemberLookup (7.3) from
24126         the spec.  Missing entirely is the information about
24127         accessability of elements of it.
24128
24129         (Expression::ExprClassFromMemberInfo): New constructor for
24130         Expressions that creates a fully initialized Expression based on
24131         a MemberInfo that is one of Eventinfo, FieldINfo, PropertyInfo or
24132         a Type.
24133
24134         (Invocation::Resolve): Begin implementing resolution of invocations.
24135
24136         * literal.cs (StringLiteral):  Implement Emit.
24137
24138 2001-09-05  Ravi Pratap  <ravi@ximian.com>
24139
24140         * cs-parser.jay (error): Add new modifier because we are hiding an inherited
24141         member.
24142
24143 2001-09-04  Ravi Pratap  <ravi@ximian.com>
24144
24145         * cs-parser.jay (attribute_arguments): Implement actions.
24146         (attribute): Fix bug in production. Implement action.
24147         (attribute_list): Implement.
24148         (attribute_target): Implement.
24149         (attribute_target_specifier, opt_target_specifier): Implement
24150         (CheckAttributeTarget): New method to check if the attribute target
24151         is valid.
24152         (attribute_section): Implement.
24153         (opt_attributes): Implement.
24154
24155         * attribute.cs : New file to handle attributes.
24156         (Attribute): Class to hold attribute info.
24157
24158         * cs-parser.jay (opt_attribute_target_specifier): Remove production
24159         (attribute_section): Modify production to use 2 different rules to 
24160         achieve the same thing. 1 s/r conflict down !
24161         Clean out commented, useless, non-reducing dimension_separator rules.
24162
24163         * class.cs (TypeContainer.attributes): New member to hold list
24164         of attributes for a type.
24165         (Struct::Struct): Modify to take one more argument, the attribute list.
24166         (Class::Class): Ditto.
24167         (Field::Field): Ditto.
24168         (Method::Method): Ditto.
24169         (Property::Property): Ditto.
24170
24171         * cs-parser.jay (struct_declaration): Update constructor call to
24172         pass in the attributes too.
24173         (class_declaration): Ditto.
24174         (constant_declaration): Ditto.
24175         (field_declaration): Ditto.
24176         (method_header): Ditto.
24177         (fixed_parameter): Ditto.
24178         (parameter_array): Ditto.
24179         (property_declaration): Ditto.
24180
24181         * constant.cs (Constant::Constant): Update constructor similarly.
24182         Use System.Collections.
24183
24184         * parameter.cs (Parameter::Parameter): Update as above.
24185
24186 2001-09-02  Ravi Pratap  <ravi@ximian.com>
24187
24188         * class.cs (TypeContainer::AddDelegate): New method to add a delegate.
24189         (TypeContainer.delegates): New member to hold list of delegates.
24190
24191         * cs-parser.jay (delegate_declaration): Implement the action correctly 
24192         this time as I seem to be on crack ;-)
24193
24194 2001-09-02  Miguel de Icaza  <miguel@ximian.com>
24195
24196         * rootcontext.cs (RootContext::IsNamespace): new function, used to
24197         tell whether an identifier represents a namespace.
24198
24199         * expression.cs (NamespaceExpr): A namespace expression, used only
24200         temporarly during expression resolution.
24201         (Expression::ResolveSimpleName, ::ResolvePrimary, ::ResolveName):
24202         utility functions to resolve names on expressions.
24203
24204 2001-09-01  Miguel de Icaza  <miguel@ximian.com>
24205
24206         * codegen.cs: Add hook for StatementExpressions. 
24207
24208         * class.cs: Fix inverted test for static flag in methods.
24209
24210 2001-09-02  Ravi Pratap  <ravi@ximian.com>
24211
24212         * class.cs (Operator::CheckUnaryOperator): Correct error number used
24213         to make it coincide with MS' number.
24214         (Operator::CheckBinaryOperator): Ditto.
24215
24216         * ../errors/errors.txt : Remove error numbers added earlier.
24217
24218         * ../errors/cs1019.cs : Test case for error # 1019
24219
24220         * ../errros/cs1020.cs : Test case for error # 1020
24221
24222         * cs-parser.jay : Clean out commented cruft.
24223         (dimension_separators, dimension_separator): Comment out. Ostensibly not
24224         used anywhere - non-reducing rule.
24225         (namespace_declarations): Non-reducing rule - comment out.
24226
24227         * enum.cs (Enum::AddEnum): Rename to AddEnumMember as I was getting confused
24228         with TypeContainer::AddEnum.
24229
24230         * delegate.cs : New file for delegate handling classes.
24231         (Delegate): Class for declaring delegates.
24232
24233         * makefile : Update.
24234
24235         * cs-parser.jay (delegate_declaration): Implement.
24236
24237 2001-09-01  Ravi Pratap  <ravi@che.iitm.ac.in>
24238
24239         * class.cs (Event::Define): Implement.
24240         (Event.EventBuilder): New member.
24241
24242         * class.cs (TypeContainer::Populate): Update to define all enums and events
24243         we have.
24244         (Events): New property for the events arraylist we hold. Shouldn't we move to using
24245         readonly fields for all these cases ?
24246
24247 2001-08-31  Ravi Pratap  <ravi@che.iitm.ac.in>
24248
24249         * class.cs (Property): Revamp to use the convention of making fields readonly.
24250         Accordingly modify code elsewhere.
24251
24252         * class.cs : Apply patch from Mr. Mandar <go_mono@hotmail.com> for implementing
24253         the Define method of the Property class.
24254
24255         * class.cs : Clean up applied patch and update references to variables etc. Fix 
24256         trivial bug.
24257         (TypeContainer::Populate): Update to define all the properties we have. Also
24258         define all enumerations.
24259
24260         * enum.cs (Define): Implement.
24261
24262 2001-08-31  Ravi Pratap  <ravi@che.iitm.ac.in>
24263
24264         * cs-parser.jay (overloadable_operator): The semantic value is an
24265         enum of the Operator class.
24266         (operator_declarator): Implement actions.
24267         (operator_declaration): Implement.
24268
24269         * class.cs (Operator::CheckUnaryOperator): New static method to help in checking
24270         validity of definitions.
24271         (Operator::CheckBinaryOperator): Static method to check for binary operators
24272         (TypeContainer::AddOperator): New method to add an operator to a type.
24273
24274         * cs-parser.jay (indexer_declaration): Added line to actually call the
24275         AddIndexer method so it gets added ;-)
24276
24277         * ../errors/errors.txt : Update to include new error numbers. Are these numbers 
24278         already taken care of by the MS compiler ?  
24279
24280 2001-08-29  Ravi Pratap  <ravi@che.iitm.ac.in>
24281
24282         * class.cs (Operator): New class for operator declarations.
24283         (Operator::OpType): Enum for the various operators.
24284
24285 2001-08-29  Ravi Pratap  <ravi@che.iitm.ac.in>
24286
24287         * class.cs (TypeContainer::AddIndexer): Remove FIXME comment. We
24288         ostensibly handle this in semantic analysis.
24289
24290         * cs-parser.jay (general_catch_clause): Comment out
24291         (specific_catch_clauses, specific_catch_clause): Ditto.
24292         (opt_general_catch_clause, opt_specific_catch_clauses): Ditto
24293         (catch_args, opt_catch_args): New productions.
24294         (catch_clause): Rewrite to use the new productions above
24295         (catch_clauses): Modify accordingly.
24296         (opt_catch_clauses): New production to use in try_statement
24297         (try_statement): Revamp. Basically, we get rid of one unnecessary rule
24298         and re-write the code in the actions to extract the specific and
24299         general catch clauses by being a little smart ;-)
24300
24301         * ../tests/try.cs : Fix. It's not 'finalize' my friend, it's 'finally' !
24302         Hooray, try and catch statements parse fine !
24303
24304 2001-08-28  Ravi Pratap  <ravi@che.iitm.ac.in>
24305
24306         * statement.cs (Block::GetVariableType): Fix logic to extract the type
24307         string from the hashtable of variables.
24308
24309         * cs-parser.jay (event_accessor_declarations): Trivial fix. Man, how did
24310         I end up making that mistake ;-)
24311         (catch_clauses): Fixed gross error which made Key and Value of the 
24312         DictionaryEntry the same : $1 !!
24313
24314 2001-08-28  Ravi Pratap  <ravi@che.iitm.ac.in>
24315
24316         * cs-tokenizer.cs (initTokens): Add keywords 'add' and 'remove'
24317
24318         * cs-parser.jay (event_declaration): Correct to remove the semicolon
24319         when the add and remove accessors are specified. 
24320
24321 2001-08-28  Ravi Pratap  <ravi@che.iitm.ac.in>
24322
24323         * cs-parser.jay (IndexerDeclaration): New helper class to hold
24324         information about indexer_declarator.
24325         (indexer_declarator): Implement actions.
24326         (parsing_indexer): New local boolean used to keep track of whether
24327         we are parsing indexers or properties. This is necessary because 
24328         implicit_parameters come into picture even for the get accessor in the 
24329         case of an indexer.
24330         (get_accessor_declaration, set_accessor_declaration): Correspondingly modified.
24331
24332         * class.cs (Indexer): New class for indexer declarations.
24333         (TypeContainer::AddIndexer): New method to add an indexer to a type.
24334         (TypeContainer::indexers): New member to hold list of indexers for the
24335         type.
24336
24337 2001-08-27  Ravi Pratap  <ravi@che.iitm.ac.in>
24338
24339         * cs-parser.jay (add_accessor_declaration): Implement action.
24340         (remove_accessor_declaration): Implement action.
24341         (event_accessors_declaration): Implement
24342         (variable_declarators): swap statements for first rule - trivial.
24343
24344         * class.cs (Event): New class to hold information about event
24345         declarations.
24346         (TypeContainer::AddEvent): New method to add an event to a type
24347         (TypeContainer::events): New member to hold list of events.
24348
24349         * cs-parser.jay (event_declaration): Implement actions.
24350
24351 2001-08-27  Ravi Pratap  <ravi@che.iitm.ac.in>
24352
24353         * cs-parser.jay (dim_separators): Implement. Make it a string
24354         concatenating all the commas together, just as they appear.
24355         (opt_dim_separators): Modify accordingly
24356         (rank_specifiers): Update accordingly. Basically do the same
24357         thing - instead, collect the brackets here.
24358         (opt_rank_sepcifiers): Modify accordingly.
24359         (array_type): Modify to actually return the complete type string
24360         instead of ignoring the rank_specifiers.
24361         (expression_list): Implement to collect the expressions
24362         (variable_initializer): Implement. We make it a list of expressions
24363         essentially so that we can handle the array_initializer case neatly too.
24364         (variable_initializer_list): Implement.
24365         (array_initializer): Make it a list of variable_initializers
24366         (opt_array_initializer): Modify accordingly.
24367
24368         * expression.cs (New::NType): Add enumeration to help us
24369         keep track of whether we have an object/delegate creation
24370         or an array creation.
24371         (New:NewType, New::Rank, New::Indices, New::Initializers): New
24372         members to hold data about array creation.
24373         (New:New): Modify to update NewType
24374         (New:New): New Overloaded contructor for the array creation
24375         case.
24376
24377         * cs-parser.jay (array_creation_expression): Implement to call
24378         the overloaded New constructor.
24379
24380 2001-08-26  Ravi Pratap  <ravi@che.iitm.ac.in>
24381
24382         * class.cs (TypeContainer::Constructors): Return member
24383         constructors instead of returning null.
24384
24385 2001-08-26  Miguel de Icaza  <miguel@ximian.com>
24386
24387         * typemanager.cs (InitCoreTypes): Initialize the various core
24388         types after we have populated the type manager with the user
24389         defined types (this distinction will be important later while
24390         compiling corlib.dll)
24391
24392         * expression.cs, literal.cs, assign.cs, constant.cs: Started work
24393         on Expression Classification.  Now all expressions have a method
24394         `Resolve' and a method `Emit'.
24395
24396         * codegen.cs, cs-parser.jay: Fixed the bug that stopped code
24397         generation from working.     Also add some temporary debugging
24398         code. 
24399
24400 2001-08-24  Miguel de Icaza  <miguel@ximian.com>
24401
24402         * codegen.cs: Lots of code generation pieces.  This is only the
24403         beginning, will continue tomorrow with more touches of polish.  We
24404         handle the fundamentals of if, while, do, for, return.  Others are
24405         trickier and I need to start working on invocations soon.
24406
24407         * gen-treedump.cs: Bug fix, use s.Increment here instead of
24408         s.InitStatement. 
24409
24410         * codegen.cs (EmitContext): New struct, used during code
24411         emission to keep a context.   Most of the code generation will be
24412         here. 
24413
24414         * cs-parser.jay: Add embedded blocks to the list of statements of
24415         this block.  So code generation proceeds in a top down fashion.
24416
24417 2001-08-23  Miguel de Icaza  <miguel@ximian.com>
24418
24419         * statement.cs: Add support for multiple child blocks.
24420
24421 2001-08-22  Miguel de Icaza  <miguel@ximian.com>
24422
24423         * codegen.cs (EmitCode): New function, will emit the code for a
24424         Block of code given a TypeContainer and its ILGenerator. 
24425
24426         * statement.cs (Block): Standard public readonly optimization.
24427         (Block::Block constructors): Link children. 
24428         (Block::Child): Child Linker.
24429         (Block::EmitVariables): Emits IL variable declarations.
24430
24431         * class.cs: Drop support for MethodGroups here, delay until
24432         Semantic Analysis.
24433         (Method::): Applied the same simplification that I did before, and
24434         move from Properties to public readonly fields.
24435         (Method::ParameterTypes): Returns the parameter types for the
24436         function, and implements a cache that will be useful later when I
24437         do error checking and the semantic analysis on the methods is
24438         performed.
24439         (Constructor::GetCallingConvention): Renamed from CallingConvetion
24440         and made a method, optional argument tells whether this is a class
24441         or a structure to apply the `has-this' bit.
24442         (Method::GetCallingConvention): Implement, returns the calling
24443         convention. 
24444         (Method::Define): Defines the type, a second pass is performed
24445         later to populate the methods.
24446
24447         (Constructor::ParameterTypes): implement a cache similar to the
24448         one on Method::ParameterTypes, useful later when we do semantic
24449         analysis. 
24450
24451         (TypeContainer::EmitMethod):  New method.  Emits methods.
24452
24453         * expression.cs: Removed MethodGroup class from here.
24454
24455         * parameter.cs (Parameters::GetCallingConvention): new method.
24456
24457 2001-08-21  Miguel de Icaza  <miguel@ximian.com>
24458
24459         * class.cs (TypeContainer::Populate): Drop RootContext from the
24460         argument. 
24461
24462         (Constructor::CallingConvention): Returns the calling convention.
24463         (Constructor::ParameterTypes): Returns the constructor parameter
24464         types. 
24465
24466         (TypeContainer::AddConstructor): Keep track of default constructor
24467         and the default static constructor.
24468
24469         (Constructor::) Another class that starts using `public readonly'
24470         instead of properties. 
24471
24472         (Constructor::IsDefault): Whether this is a default constructor. 
24473
24474         (Field::) use readonly public fields instead of properties also.
24475
24476         (TypeContainer::TypeAttr, TypeContainer::AddConstructor): Keep
24477         track of static constructors;  If none is used, turn on
24478         BeforeFieldInit in the TypeAttributes. 
24479
24480         * cs-parser.jay (opt_argument_list): now the return can be null
24481         for the cases where there are no arguments. 
24482
24483         (constructor_declarator): If there is no implicit `base' or
24484         `this', then invoke the default parent constructor. 
24485
24486         * modifiers.cs (MethodAttr): New static function maps a set of
24487         modifiers flags into a MethodAttributes enum
24488         (FieldAttr): renamed from `Map'.  So now we have FieldAttr,
24489         MethodAttr, TypeAttr to represent the various mappings where the
24490         modifiers are used.
24491         (FieldAttr): Map also `readonly' to `FieldAttributes.InitOnly'  
24492
24493 2001-08-19  Miguel de Icaza  <miguel@ximian.com>
24494
24495         * parameter.cs (GetParameterInfo): Fix bug where there would be no
24496         method arguments.
24497
24498         * interface.cs (PopulateIndexer): Implemented the code generator
24499         for interface indexers.
24500
24501 2001-08-17  Miguel de Icaza  <miguel@ximian.com>
24502
24503         * interface.cs (InterfaceMemberBase): Now we track the new status
24504         here.  
24505
24506         (PopulateProperty): Implement property population.  Woohoo!  Got
24507         Methods and Properties going today. 
24508
24509         Removed all the properties for interfaces, and replaced them with
24510         `public readonly' fields. 
24511
24512 2001-08-16  Miguel de Icaza  <miguel@ximian.com>
24513
24514         * interface.cs (AddEvent, AddMethod, AddIndexer, AddProperty):
24515         initialize their hashtables/arraylists only when they are needed
24516         instead of doing this always.
24517
24518         * parameter.cs: Handle refs and out parameters.
24519
24520         * cs-parser.jay: Use an ArrayList to construct the arguments
24521         instead of the ParameterCollection, and then cast that to a
24522         Parameter[] array.
24523
24524         * parameter.cs: Drop the use of ParameterCollection and use
24525         instead arrays of Parameters.
24526
24527         (GetParameterInfo): Use the Type, not the Name when resolving
24528         types. 
24529
24530 2001-08-13  Miguel de Icaza  <miguel@ximian.com>
24531
24532         * parameter.cs: Eliminate the properties Name, Type and ModFlags,
24533         and instead use public readonly fields.
24534
24535         * class.cs: Put back walking code for type containers.
24536
24537 2001-08-11  Miguel de Icaza  <miguel@ximian.com>
24538
24539         * class.cs (MakeConstant): Code to define constants.
24540
24541         * rootcontext.cs (LookupType): New function.  Used to locate types 
24542
24543
24544 2001-08-08  Miguel de Icaza  <miguel@ximian.com>
24545
24546         * rootcontext.cs: OH MY!  My trick works!   It is amazing how nice
24547         this System.Reflection code is.  Kudos to Microsoft
24548
24549         * typemanager.cs: Implement a type cache and avoid loading all
24550         types at boot time.  Wrap in LookupType the internals.  This made
24551         the compiler so much faster.  Wow.  I rule!
24552
24553         * driver.cs: Make sure we always load mscorlib first (for
24554         debugging purposes, nothing really important).
24555
24556         * Renamespaced things that were on `CSC' to `CIR'.  Maybe I should
24557         have moved to `CSC' rather than `CIR'.  Oh man!  The confussion!  
24558
24559         * rootcontext.cs: Lookup types on their namespace;  Lookup types
24560         on namespaces that have been imported using the `using' keyword.
24561
24562         * class.cs (TypeContainer::TypeAttr): Virtualize.
24563         (Class::TypeAttr): Return attributes suitable for this bad boy.
24564         (Struct::TypeAttr): ditto.
24565         Handle nested classes.
24566         (TypeContainer::) Remove all the type visiting code, it is now
24567         replaced with the rootcontext.cs code
24568
24569         * rootcontext.cs (GetClassBases): Added support for structs. 
24570
24571 2001-08-06  Miguel de Icaza  <miguel@ximian.com>
24572
24573         * interface.cs, statement.cs, class.cs, parameter.cs,
24574         rootcontext.cs, gen-treedump.cs, enum.cs, cs-parse.jay:
24575         Drop use of TypeRefs, and use strings instead.
24576
24577 2001-08-04  Miguel de Icaza  <miguel@ximian.com>
24578
24579         * rootcontext.cs: 
24580
24581         * class.cs (Struct::Struct): set the SEALED flags after
24582         checking the modifiers.
24583         (TypeContainer::TypeAttr): new property, returns the
24584         TypeAttributes for a class.  
24585
24586         * cs-parser.jay (type_list): Oops, list production was creating a
24587         new list of base types.
24588
24589         * rootcontext.cs (StdLib): New property.
24590         (GetInterfaceTypeByName): returns an interface by type name, and
24591         encapsulates error handling here.
24592         (GetInterfaces): simplified.
24593         (ResolveTree): Encapsulated all the tree resolution here.
24594         (CreateClass, GetClassBases, GetInterfaceOrClass): Create class
24595         types. 
24596
24597         * driver.cs: Add support for --nostdlib, to avoid loading the
24598         default assemblies.
24599         (Main): Do not put tree resolution here. 
24600
24601         * rootcontext.cs: Beginning of the class resolution.
24602
24603 2001-08-03  Miguel de Icaza  <miguel@ximian.com>
24604
24605         * rootcontext.cs: Provide better error reporting. 
24606
24607         * cs-parser.jay (interface_base): set our $$ to be interfaces.
24608
24609         * rootcontext.cs (CreateInterface): Handle the case where there
24610         are no parent interfaces.
24611
24612         (CloseTypes): Routine to flush types at the end.
24613         (CreateInterface): Track types.
24614         (GetInterfaces): Returns an array of Types from the list of
24615         defined interfaces.
24616
24617         * typemanager.c (AddUserType): Mechanism to track user types (puts
24618         the type on the global type hash, and allows us to close it at the
24619         end). 
24620
24621 2001-08-02  Miguel de Icaza  <miguel@ximian.com>
24622
24623         * tree.cs: Removed RecordType, added RecordClass, RecordStruct and
24624         RecordInterface instead.
24625
24626         * cs-parser.jay: Updated to reflect changes above.
24627
24628         * decl.cs (Definition): Keep track of the TypeBuilder type that
24629         represents this type here.  Not sure we will use it in the long
24630         run, but wont hurt for now.
24631
24632         * driver.cs: Smaller changes to accomodate the new code.
24633
24634         Call ResolveInterfaceBases, Call ResolveClassBases, Save assembly
24635         when done. 
24636
24637         * rootcontext.cs (CreateInterface):  New method, used to create
24638         the System.TypeBuilder type for interfaces.
24639         (ResolveInterfaces): new entry point to resolve the interface
24640         hierarchy. 
24641         (CodeGen): Property, used to keep track of the code generator.
24642
24643 2001-07-26  Miguel de Icaza  <miguel@ximian.com>
24644
24645         * cs-parser.jay: Add a second production for delegate_declaration
24646         with `VOID'.
24647
24648         (enum_body): Put an opt_comma here instead of putting it on
24649         enum_body or enum_member_declarations so we can handle trailing
24650         commas on enumeration members.  Gets rid of a shift/reduce.
24651
24652         (type_list): Need a COMMA in the middle.
24653
24654         (indexer_declaration): Tell tokenizer to recognize get/set
24655
24656         * Remove old targets.
24657
24658         * Re-add the parser target.
24659
24660 2001-07-13  Simon Cozens <simon@simon-cozens.org>
24661
24662         * cs-parser.jay: Add precendence rules for a number of operators
24663         ot reduce the number of shift/reduce conflicts in the grammar.
24664
24665 2001-07-17  Miguel de Icaza  <miguel@ximian.com>
24666
24667         * tree.cs: moved IGenerator interface and renamed it to ITreeDump
24668         and put it here.
24669
24670         Get rid of old crufty code.
24671
24672         * rootcontext.cs: Use this to keep track of the parsed
24673         representation and the defined types available to the program. 
24674
24675         * gen-treedump.cs: adjust for new convention.
24676
24677         * type.cs: Split out the type manager, and the assembly builder
24678         from here. 
24679
24680         * typemanager.cs: the type manager will live here now.
24681
24682         * cil-codegen.cs: And the code generator here. 
24683
24684 2001-07-14  Sean MacIsaac  <macisaac@ximian.com>
24685
24686         * makefile: Fixed up for easy making.
24687
24688 2001-07-13  Simon Cozens <simon@simon-cozens.org>
24689
24690         * cs-parser.jay (rank_specifier): Remove a conflict by reordering
24691         the 
24692
24693         (unary_expression): Expand pre_increment_expression and
24694         post_decrement_expression to reduce a shift/reduce.
24695
24696 2001-07-11  Simon Cozens
24697
24698         * cs-tokenizer.cs: Hex numbers should begin with a 0.
24699
24700         Improve allow_keyword_as_indent name.
24701
24702 2001-06-19  Miguel de Icaza  <miguel@ximian.com>
24703
24704         * Adjustments for Beta2. 
24705
24706 2001-06-13  Miguel de Icaza  <miguel@ximian.com>
24707
24708         * decl.cs: Added `Define' abstract method.
24709         (InTransit): new property, used to catch recursive definitions. 
24710
24711         * interface.cs: Implement `Define'. 
24712
24713         * modifiers.cs: Map Modifiers.constants to
24714         System.Reflection.TypeAttribute flags.
24715
24716         * class.cs: Keep track of types and user-defined types.
24717         (BuilderInit): New method for creating an assembly
24718         (ResolveType): New function to launch the resolution process, only
24719         used by interfaces for now.
24720
24721         * cs-parser.jay: Keep track of Classes, Structs and Interfaces
24722         that are inserted into the name space. 
24723
24724 2001-06-08  Miguel de Icaza  <miguel@ximian.com>
24725
24726         * ARGH.  I have screwed up my tree so many times due to the use of
24727         rsync rather than using CVS.  Going to fix this at once. 
24728
24729         * driver.cs: Objetify driver.  Load assemblies, use assemblies to
24730         load types.
24731
24732 2001-06-07  Miguel de Icaza  <miguel@ximian.com>
24733
24734         * Experiment successful: Use System.Type rather that our own
24735         version of Type.  
24736
24737 2001-05-25  Miguel de Icaza  <miguel@ximian.com>
24738
24739         * cs-parser.jay: Removed nsAliases from here.
24740
24741         Use new namespaces, handle `using XXX;' 
24742
24743         * namespace.cs: Reimplemented namespace handling, use a recursive
24744         definition of the class.  Now we can keep track of using clauses
24745         and catch invalid using clauses.
24746
24747 2001-05-24  Miguel de Icaza  <miguel@ximian.com>
24748
24749         * gen-treedump.cs: Adapted for all the renaming.
24750
24751         * expression.cs (Expression): this class now has a Type property
24752         which returns an expression Type.
24753
24754         (Probe::, New::, TypeOf::, SizeOf::, Constant::): renamed from
24755         `Type', as this has a different meaning now in the base
24756
24757 2001-05-22  Miguel de Icaza  <miguel@ximian.com>
24758
24759         * interface.cs, class.cs: Removed from all the sources the
24760         references to signature computation, as we can not do method
24761         signature computation during the parsing time, as we are not
24762         trying to solve at that point distinguishing:
24763
24764         class X {
24765                 void a (Blah x) {}
24766                 void a (NS.Blah x) {}
24767         }
24768
24769         Which depending on the context might be valid or not, as we do not
24770         know if Blah is the same thing as NS.Blah at that point.
24771
24772         * Redid everything so the code uses TypeRefs now instead of
24773         Types.  TypeRefs are just temporary type placeholders, that need
24774         to be resolved.  They initially have a pointer to a string and the
24775         current scope in which they are used.  This is used later by the
24776         compiler to resolve the reference to an actual Type. 
24777
24778         * DeclSpace is no longer a CIR.Type, and neither are
24779         TypeContainers (Class and Struct) nor Interfaces nor Enums.  They
24780         are all DeclSpaces, but no Types. 
24781
24782         * type.cs (TypeRefManager): This implements the TypeRef manager,
24783         which keeps track of all the types that need to be resolved after
24784         the parsing has finished. 
24785
24786 2001-05-13  Miguel de Icaza  <miguel@ximian.com>
24787
24788         * ARGH.  We are going to have to store `foreach' as a class rather
24789         than resolving it, as we need to verify error 1579 after name
24790         resolution.   *OR* we could keep a flag that says `This request to
24791         IEnumerator comes from a foreach statement' which we can then use
24792         to generate the error.
24793
24794 2001-05-10  Miguel de Icaza  <miguel@ximian.com>
24795
24796         * class.cs (TypeContainer.AddMethod): we now add methods to the
24797         MethodGroup instead of the method hashtable.  
24798
24799         * expression.cs: Add MethodGroup abstraction, which gets us one
24800         step closer to the specification in the way we handle method
24801         declarations.  
24802
24803         * cs-parser.jay (primary_expression): qualified_identifier now
24804         tried to match up an identifier to a local variable reference or
24805         to a parameter reference.
24806
24807         current_local_parameters is now a parser global variable that
24808         points to the current parameters for the block, used during name
24809         lookup.
24810
24811         (property_declaration): Now creates an implicit `value' argument to
24812         the set accessor.
24813
24814 2001-05-09  Miguel de Icaza  <miguel@ximian.com>
24815
24816         * parameter.cs: Do not use `param' arguments as part of the
24817         signature, per the spec.
24818
24819 2001-05-08  Miguel de Icaza  <miguel@ximian.com>
24820
24821         * decl.cs: Base class for classes, structs and interfaces.  This
24822         is the "Declaration Space" 
24823
24824         * cs-parser.jay: Use CheckDef for checking declaration errors
24825         instead of having one on each function.
24826
24827         * class.cs: Factor out some code for handling error handling in
24828         accordance to the "Declarations" section in the "Basic Concepts"
24829         chapter in the ECMA C# spec.
24830
24831         * interface.cs: Make all interface member classes derive from
24832         InterfaceMemberBase.
24833
24834 2001-05-07  Miguel de Icaza  <miguel@ximian.com>
24835
24836         * Many things: all interfaces are parsed and generated in
24837         gen-treedump.  Support for member variables, constructors,
24838         destructors, properties, constants is there.
24839
24840         Beginning of the IL backend, but very little done, just there for
24841         testing purposes. 
24842
24843 2001-04-29  Miguel de Icaza  <miguel@ximian.com>
24844
24845         * cs-parser.jay: Fix labeled statement.
24846
24847         * cs-tokenizer.cs (escape): Escape " and ' always.
24848         ref_line, ref_name: keep track of the line/filename as instructed
24849         by #line by the compiler.
24850         Parse #line.
24851
24852 2001-04-27  Miguel de Icaza  <miguel@ximian.com>
24853
24854         * System.CodeDOM/CodeBinaryOperatorExpression.cs: Rearrange enum
24855         to match the values in System.CodeDOM.
24856
24857         Divid renamed to Divide.
24858
24859         * System.CodeDOM/CodeForLoopStatement.cs: Always have valid
24860         statements. 
24861         (Statements.set): remove.
24862
24863         * System.CodeDOM/CodeCatchClause.cs: always have a valid
24864         statements. 
24865
24866         * System.CodeDOM/CodeIfStatement.cs: trueStatements and
24867         falseStatements always have valid values. 
24868
24869         * cs-parser.jay: Use System.CodeDOM now.
24870