2003-10-14 Miguel de Icaza <miguel@ximian.com>
[mono.git] / mcs / mcs / ChangeLog
1 2003-10-14  Miguel de Icaza  <miguel@ximian.com>
2
3         * convert.cs: Fix error report.
4
5 2003-10-13 Jackson Harper <jackson@ximian.com>
6
7         * typemanager.cs (TypeToCoreType): Add float and double this fixes
8         bug #49611
9         
10 2003-10-09  Martin Baulig  <martin@ximian.com>
11
12         * class.cs (MethodCore): Added additional `DeclSpace ds' argument
13         to the .ctor.
14         (MethodCore.DoDefineParameters): Removed the TypeContainer
15         argument; use the DeclSpace which was passed to the .ctor instead.
16         (MethodCore.CheckParameter): Take a DeclSpace instead of a
17         TypeContainer; we only need a DeclSpace here.
18
19 2003-10-09  Martin Baulig  <martin@ximian.com>
20
21         * class.cs (MethodData): Added additional `DeclSpace ds' argument
22         to the .ctor.
23         (MethodData.Define, MethodData.Emit): Pass the `ds' to the
24         EmitContext's .ctor.    
25
26 2003-10-09  Martin Baulig  <martin@ximian.com>
27
28         * decl.cs (DeclSpace.AsAccessible): Moved here from TypeContainer.
29         (AccessLevel, CheckAccessLevel, GetAccessLevel): They're used by
30         AsAccessible(), moved them as well.
31
32         * class.cs (TypeContainer.AsAccessible): Moved to DeclSpace.
33
34 2003-10-08  Atsushi Enomoto <ginga@kit.hi-ho.ne.jp>
35
36         * cs-parser.jay : Renamed yyName to yyNames related to jay.
37
38 2003-10-07  Miguel de Icaza  <miguel@ximian.com>
39
40         * expression.cs (Binary.Emit.GreatherThanOrEqual): Fix the code
41         generation for >=, as spotted by Paolo, bug 48679.  
42         Patch from David Waite.
43
44         * cs-tokenizer.cs: Add handling for #pragma.
45
46         * cs-parser.jay: Allow for both yield and yield return in the
47         syntax.  The anti-cobolization of C# fight will go on!
48
49         * class.cs (TypeBuilder.DefineType): Catch error condition here
50         (Parent.DefineType erroring out and returning null).
51
52         * expression.cs (ArrayCreation.EmitDynamicInitializers): When
53         coping with enumerations variables, we were mistakenly processing
54         them as a regular value type instead of built-in types.  Fixes the
55         bug #48063
56
57         * typemanager.cs (IsBuiltinOrEnum): New method.
58
59 2003-09-30  Miguel de Icaza  <miguel@ximian.com>
60
61         * cs-parser.jay: Upgrade: yield now needs the return clause.
62
63 2003-09-19  Martin Baulig  <martin@ximian.com>
64
65         * decl.cs (MemberCache.SetupCacheForInterface): Take a
66         `MemberCache parent' argument.  Normally, an interface doesn't
67         have a parent type except System.Object, but we use this in gmcs
68         for generic type parameters.
69
70 2003-09-18  Martin Baulig  <martin@ximian.com>
71
72         * typemanager.cs (TypeHandle.ctor): Set `IsInterface' solely based
73         on `type.IsInterface'; don't check whether the type has a parent
74         to determine whether it's an interface.
75
76 2003-09-15  Martin Baulig  <martin@ximian.com>
77
78         * class.cs (TypeContainer.DefineType): Added an error flag to
79         avoid reporting duplicate CS0146's ("class definition is
80         circular.").
81
82         * driver.cs (Driver.MainDriver): Abort if
83         RootContext.ResolveTree() reported any errors.
84
85 2003-09-07  Martin Baulig  <martin@ximian.com>
86
87         * report.cs (Error, Warning): Added overloaded versions which take
88         a `params object[] args' and call String.Format().
89
90 2003-09-07  Martin Baulig  <martin@ximian.com>
91
92         * decl.cs (DeclSpace..ctor): Don't call
93         NamespaceEntry.DefineName() here; do it in RecordDecl() which is
94         called from Tree.RecordDecl().  Fixes the CS0101 reporting.
95         (DeclSpace.RecordDecl): New method.
96
97         * tree.cs (Tree.RecordDecl): Call ds.RecordDecl().
98
99 2003-09-02  Ravi Pratap  <ravi@ximian.com>
100
101         * attribute.cs (CheckAttributeTarget): Ensure that we allow return
102         value attributes to be applied to ParameterBuilders.
103
104         * class.cs (MethodCore.LabelParameters): Make static and more
105         generic so that it can be used from other places - like interface
106         methods, for instance.
107
108         * interface.cs (Interface.Emit): Call LabelParameters before
109         emitting attributes on the InterfaceMethod.
110
111 2003-08-26  Martin Baulig  <martin@ximian.com>
112
113         * ecore.cs (SimpleName.SimpleNameResolve): Look for members before
114         resolving aliases; fixes #47927.
115
116 2003-08-26  Martin Baulig  <martin@ximian.com>
117
118         * statement.cs (Using.DoResolve): This is internally emitting a
119         try/finally clause, so we need to set ec.NeedExplicitReturn if we
120         do not always return.  Fixes #47681.
121
122 2003-08-26  Martin Baulig  <martin@ximian.com>
123
124         * decl.cs (MemberCore): Moved WarningNotHiding(),
125         Error_CannotChangeAccessModifiers() and CheckMethodAgainstBase()
126         into MemberBase.
127         (AdditionResult): Make this nested in DeclSpace.
128         (DeclSpace.ctor): The .ctor now takes an additional NamespaceEntry
129         argument; call NamespaceEntry.Define() unless we're nested in a
130         class or struct.
131
132         * namespace.cs (Namespace.DefineName): New public function.  This
133         is called from DeclSpace's .ctor to add 
134         (Namespace.Lookup): Include DeclSpaces in the lookup.
135
136         * class.cs (Operator): Derive from MemberBase, not MemberCore.
137
138         * const.cs (Const): Derive from MemberBase, not MemberCore.     
139
140 2003-08-25  Martin Baulig  <martin@ximian.com>
141
142         * convert.cs (Convert.ExplicitReferenceConversion): When
143         converting from an interface type to a class, unbox if the target
144         type is a struct type.  Fixes #47822.
145
146 2003-08-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
147
148         * typemanager.cs: fixed the values of MethodFlags. Closes #47855 and
149         #47854.
150
151 2003-08-22  Martin Baulig  <martin@ximian.com>
152
153         * class.cs (TypeManager.DefineType): When defining a nested type,
154         call DefineType() on our parent; fixes #47801.
155
156 2003-08-22  Martin Baulig  <martin@ximian.com>
157
158         * class.cs (MethodData.Define): While checking if a method is an
159         interface implementation, improve the test a bit more to fix #47654.
160
161 2003-08-22  Martin Baulig  <martin@ximian.com>
162
163         * expression.cs (Probe.DoResolve): Check whether `expr' resolved
164         correctly; fixes #47722.
165
166 2003-08-22  Martin Baulig  <martin@ximian.com>
167
168         * expression.cs (UnaryMutator.ResolveVariable): If the target is a
169         LocalVariableReference, ensure it's not read-only.  Fixes #47536.
170
171         * statement.cs (Fixed.DoResolve): Make all variables read-only. 
172
173 2003-08-22  Martin Baulig  <martin@ximian.com>
174
175         * ecore.cs (FieldExpr.DoResolveLValue): Static read-only fields
176         can only be assigned in static constructors.  Fixes #47161.
177
178 2003-08-22  Martin Baulig  <martin@ximian.com>
179
180         Rewrote and improved the flow analysis code.
181
182         * flowbranching.cs (FlowBranching): Make this class abstract.
183         (FlowBranching.CreateBranching): New static function to create a
184         new flow branching.
185         (FlowBranchingBlock, FlowBranchingException): New classes.
186         (FlowBranching.UsageVector.Type): New public readonly field.
187         (FlowBranching.UsageVector.Breaks): Removed the setter.
188         (FlowBranching.UsageVector.Returns): Removed the setter.
189         (FlowBranching.UsageVector): Added Break(), Return(),
190         NeverReachable() and Throw() methods to modify the reachability.
191         (FlowBranching.UsageVector.MergeChildren): Removed, this is now
192         done by FlowBranching.Merge().
193         (FlowBranching.UsageVector.MergeChild): New method; merges the
194         merge result into the current vector.
195         (FlowBranching.Merge): New abstract method to merge a branching.
196
197 2003-08-12  Martin Baulig  <martin@ximian.com>
198
199         * expression.cs (Indirection.CacheTemporaries): Create the
200         LocalTemporary with the pointer type, not its element type.
201
202 2003-08-10  Miguel de Icaza  <miguel@ximian.com>
203
204         * cs-parser.jay: FIRST_KEYWORD, LAST_KEYWORD: used to know if a
205         token was a keyword or not.
206
207         Add `error' options where an IDENTIFIER was expected;  Provide
208         CheckToken and CheckIdentifierToken convenience error reporting
209         functions. 
210
211         Do not use `DeclSpace.Namespace', use `DeclSpace.NamespaceEntry'.
212
213         * decl.cs: Rename `NamespaceEntry Namespace' public field into
214         NameSpaceEntry NameSpaceEntry.
215
216         (LookupInterfaceOrClass): Avoid creating a full qualified name
217         from namespace and name: avoid doing lookups when we know the
218         namespace is non-existant.   Use new Tree.LookupByNamespace which
219         looks up DeclSpaces based on their namespace, name pair.
220
221         * driver.cs: Provide a new `parser verbose' to display the
222         exception thrown during parsing.  This is turned off by default
223         now, so the output of a failure from mcs is more graceful.
224
225         * namespace.cs: Track all the namespaces defined in a hashtable
226         for quick lookup.
227         
228         (IsNamespace): New method
229
230 2003-08-09  Miguel de Icaza  <miguel@ximian.com>
231
232         * namespace.cs: Remove redundant call;  Avoid using MakeFQN when
233         we know that we need to concatenate (full typename can never be
234         null). 
235
236         * class.cs: ditto.
237
238         * statement.cs: Use a bitfield;  Do not initialize to null things
239         which are done by the constructor by default.
240
241         * cs-parser.jay: bug fix, parameter was 4, not 3.
242
243         * expression.cs: Just use the property;
244
245         * statement.cs: No need for GetVariableInfo method.
246
247 2003-08-08  Martin Baulig  <martin@ximian.com>
248
249         * flowanalysis.cs (FlowReturns): This is now nested in the
250         `FlowBranching' class.
251         (MyBitVector): Moved this here from statement.cs.
252         (FlowBranching.SiblingType): New enum type.
253         (FlowBranching.CreateSibling): Added `SiblingType' argument.
254
255 2003-08-07  Martin Baulig  <martin@ximian.com>
256
257         * flowanalysis.cs (FlowBranchingType): This is now nested in the
258         `FlowBranching' class and called `BranchingType'.
259
260 2003-08-07  Martin Baulig  <martin@ximian.com>
261
262         * flowanalysis.cs: Moved all the control flow analysis code into
263         its own file.
264
265 2003-08-07  Martin Baulig  <martin@ximian.com>
266
267         * assign.cs (Assign.DoResolve): `target' must either be an
268         IAssignMethod or an EventAccess; report a CS0131 otherwise.  Fixes
269         #37319.
270
271 2003-08-07  Miguel de Icaza  <miguel@ximian.com>
272
273         * expression.cs (BinaryMethod): This kind of expression is created by the
274         Binary class if it determines that the operator has to be handled
275         by a method.
276
277         (BinaryDelegate): This kind of expression is created if we are
278         dealing with a + or - operator on delegates.
279
280         (Binary): remove method, argumetns, and DelegateOperator: when
281         dealing with methods, 
282         
283         * ecore.cs (EventExpr.EmitAddOrRemove): Update to new layout.
284
285         * statement.cs (Block): use bitfields for the three extra booleans
286         we had in use.   Remove unused topblock parameter.
287
288         * codegen.cs: Remove unecessary argument to Block.EmitTopBlock
289
290         * assign.cs: Drop extra unneeded tests.
291
292 2003-08-06  Miguel de Icaza  <miguel@ximian.com>
293
294         * iterators.cs (Mapvariable): provide a mechanism to use prefixes.
295
296         * statement.cs (Foreach): Use VariableStorage instead of
297         LocalBuilders.   
298
299         * codegen.cs (VariableStorage): New class used by clients that
300         require a variable stored: locals or fields for variables that
301         need to live across yield.
302
303         Maybe provide a convenience api for EmitThis+EmitLoad?
304
305         (GetTemporaryLocal, FreeTemporaryLocal): Recycle
306         these bad boys.
307
308 2003-08-05  Miguel de Icaza  <miguel@ximian.com>
309
310         * codegen.cs (RemapLocal, RemapLocalLValue, RemapParameter,
311         RemapParameterLValue): New methods that are used to turn a
312         precomputed FieldInfo into an expression like this:
313
314                 instance.FieldInfo
315
316         The idea is to use this instead of making LocalVariableReference
317         have more than one meaning.
318
319         * cs-parser.jay: Add error production to BASE.
320
321         * ecore.cs: Deal with TypeManager.GetField returning null, which
322         is now a valid return value.
323
324         (FieldExprNoAddress): New expression for Fields whose address can
325         not be taken.
326
327         * expression.cs (LocalVariableReference): During the resolve
328         phases, create new expressions if we are in a remapping context.
329         Remove code that dealt with remapping here.
330
331         (ParameterReference): same.
332
333         (ProxyInstance): New expression, like the `This' expression, but
334         it is born fully resolved.  We know what we are doing, so remove
335         the errors that are targeted to user-provided uses of `this'.
336
337         * statement.cs (Foreach): our variable is now stored as an
338         Expression;  During resolution, follow the protocol, dont just
339         assume it will return this.
340         
341 2003-08-06  Martin Baulig  <martin@ximian.com>
342
343         * support.cs (SeekableStreamReader.cs): New public class.
344
345         * cs-tokenizer.cs, cs-parser.jay, driver.cs: Use the new
346         SeekableStreamReader instead of the normal StreamReader.
347
348 2003-08-04  Martin Baulig  <martin@ximian.com>
349
350         * cs-parser.jay (CLOSE_PARENS_CAST, CLOSE_PARENS_NO_CAST,
351         CLOSE_PARENS_OPEN_PARENS, CLOSE_PARENS_MINUS): New tokens to
352         deambiguate casts and delegate invocations.
353         (parenthesized_expression): Use the new tokens to ensure this is
354         not a cast of method invocation.
355
356         * cs-tokenizer.cs (is_punct): Return one of the new special tokens
357         when reading a `)' and Deambiguate_CloseParens () was previously
358         called.
359
360         * expression.cs (ParenthesizedExpression): New class.  This is
361         just used for the CS0075 test.
362         (Binary.DoResolve): Check for CS0075.   
363
364 2003-07-29  Ravi Pratap  <ravi@ximian.com>
365
366         * expression.cs (Invocation.MakeUnionSet): Patch from Lluis
367         Sanchez : use TypeManager.ArrayContainsMethod instead of a direct
368         reference comparison.
369
370         (TypeManager.ArrayContainsMethod): When we have a MethodInfo, also
371         examine the ReturnType for equality - this is necessary in the
372         cases of implicit and explicit operators whose signature also
373         includes the return type.
374
375 2003-07-26  Miguel de Icaza  <miguel@ximian.com>
376
377         * namespace.cs: Cache the result of the namespace computation,
378         instead of computing it every time.
379
380 2003-07-24  Miguel de Icaza  <miguel@ximian.com>
381
382         * decl.cs: Use a global arraylist that we reuse over invocations
383         to avoid excesive memory consumption.  Reduces memory usage on an
384         mcs compile by one meg (45 average).
385
386         * typemanager.cs (LookupTypeReflection): In .NET pointers are
387         private, work around that.
388
389 2003-07-23  Miguel de Icaza  <miguel@ximian.com>
390
391         * literal.cs (IntLiteral): Define Zero and One static literals. 
392
393         * cs-parser.jay (integer_literal): use static literals to reduce
394         memory usage for the most used literals (0, 1 and -1).  211kb
395         reduced in memory usage.
396
397         Replace all calls to `new ArrayList' with `new
398         ArrayList(4)' which is a good average number for most allocations,
399         and also requires only 16 bytes of memory for its buffer by
400         default. 
401
402         This reduced MCS memory usage in seven megabytes for the RSS after
403         bootstrapping.
404
405 2003-07-28  Ravi Pratap  <ravi@ximian.com>
406
407         * expression.cs (Invocation.OverloadResolve): Fix the algorithm to
408         handle params methods the correct way by forming only one
409         applicable set with params and normal methods in them. Earlier we
410         were looking at params methods only if we found no normal methods
411         which was not the correct thing to do.
412
413         (Invocation.BetterFunction): Take separate arguments indicating
414         when candidate and the best method are params methods in their
415         expanded form.
416
417         This fixes bugs #43367 and #46199.
418
419         * attribute.cs: Documentation updates.
420
421         (CheckAttribute): Rename to CheckAttributeTarget.
422         (GetValidPlaces): Rename to GetValidTargets.
423
424         * expression.cs (Invocation.IsParamsMethodApplicable): Fix trivial
425         bug - use Convert.ImplicitConversion, not ImplicitUserConversion!
426
427         Fixes bug #44468.
428
429 2003-07-28  Martin Baulig  <martin@ximian.com>
430
431         * class.cs (TypeContainer.DefineMembers): Use the base type's full
432         name when looking up the base class of a nested class.  Fixes #46977.
433
434 2003-07-26  Martin Baulig  <martin@ximian.com>
435
436         * expression.cs (Indexers.Indexer): New nested struct; contains
437         getter, setter and the indexer's type.
438         (Indexers.Properties): This is now an ArrayList of
439         Indexers.Indexer's.
440         (IndexerAccess.DoResolveLValue): Correctly set the type if the
441         indexer doesn't have any getters.
442
443         * assign.cs (Assign.DoResolve): Also do the implicit conversions
444         for embedded property and indexer assignments.
445
446 2003-07-26  Martin Baulig  <martin@ximian.com>
447
448         * cs-tokenizer.cs (Tokenizer.xtoken): Report a CS1040 if a
449         preprocessor directive is not the first non-whitespace character
450         on a line.
451
452 2003-07-26  Martin Baulig  <martin@ximian.com>
453
454         * namespace.cs (NamespaceEntry.Lookup): New method; rewrote the
455         namespace parsing, follow the spec more closely.
456
457         * rootcontext.cs (RootContext.NamespaceLookup): Use the new
458         NamespaceEntry.Lookup().
459
460 2003-07-25  Martin Baulig  <martin@ximian.com>
461
462         * MethodCore.cs (OverridesSomething): New public field; it's set
463         from TypeContainer.DefineMembers if this method overrides
464         something (which doesn't need to be a method).  Fix #39462.
465
466 2003-07-25  Ravi Pratap  <ravi@ximian.com>
467
468         * typemanager.cs (GetMembers): Ensure that the list of members is
469         reversed. This keeps things in sync.
470
471         * attribute.cs (Attribute.CheckAttribute): Break as soon as we
472         find an AttributeUsage attribute.
473
474         * expression.cs (Invocation.OverloadResolve): Perform the check
475         which disallows Invoke to be directly called on a Delegate.
476
477         (Error_InvokeOnDelegate): Report error cs1533.
478         
479 2003-07-25  Martin Baulig  <martin@ximian.com>
480
481         * expression.cs (Indexers.GetIndexersForType): Only look in the
482         interface hierarchy if the requested type is already an
483         interface.  Fixes #46788 while keeping #46502 fixed.
484
485 2003-07-25  Martin Baulig  <martin@ximian.com>
486
487         * class.cs (TypeContainer.DefineMembers): Check whether all
488         readonly fields have been assigned and report warning CS0649 if
489         not.
490
491         * statement.cs (LocalInfo.IsFixed): Always return true if this is
492         a valuetype.
493
494 2003-07-24  Ravi Pratap  <ravi@ximian.com>
495
496         * decl.cs (MemberCache.AddMethods): Reverse the order of the array
497         returned from GetMethods to make things consistent with the
498         assumptions MCS makes about ordering of methods.
499
500         This should comprehensively fix bug #45127 and it does :-)
501
502         * ecore.cs (MethodGroupExpr.DeclaringType): Correct bug - the
503         ordering is actually reverse.
504
505         * Clean up some debug messages I left lying around.
506
507         * interface.cs (Populate*): Get rid of code which emits attributes
508         since the stage in which we emit attributes is the 'Emit' stage,
509         not the define stage.
510
511         (Emit): Move attribute emission for interface members here.
512         
513 2003-07-22  Ravi Pratap  <ravi@ximian.com>
514
515         * expression.cs (Invocation.OverloadResolve): Follow the spec more
516         closely: we eliminate methods in base types when we have an
517         applicable method in a top-level type.
518
519         Please see section 14.5.5.1 for an exact description of what goes
520         on. 
521
522         This fixes bug #45127 and a host of other related to corlib compilation.
523
524         * ecore.cs (MethodGroupExpr.DeclaringType): The element in the
525         array is the method corresponding to the top-level type (this is
526         because of the changes made to icall.c) so we change this
527         accordingly.
528
529         (MethodGroupExpr.Name): This too.
530
531         * typemanager.cs (GetElementType): New method which does the right
532         thing when compiling corlib. 
533
534         * everywhere: Make use of the above in the relevant places.
535
536 2003-07-22  Martin Baulig  <martin@ximian.com>
537
538         * cs-parser.jay (invocation_expression): Moved
539         `OPEN_PARENS expression CLOSE_PARENS unary_expression' here from
540         `cast_expression', but create a InvocationOrCast which later
541         resolves to either an Invocation or a Cast.
542
543         * ecore.cs (ExpressionStatement.ResolveStatement): New virtual
544         method; call this before EmitStatement() to make sure that this
545         expression can be used as a statement.
546
547         * expression.cs (InvocationOrCast): New class; resolves to either
548         an Invocation or a Cast.
549
550         * statement.cs (StatementExpression): Call ResolveStatement() on
551         the ExpressionStatement before emitting it.
552
553 2003-07-21  Martin Baulig  <martin@ximian.com>
554
555         * expression.cs (Invocation.VerifyArgumentsCompat): Check whether
556         `ref' and `out' attributes match; fixes #46220.
557         (MemberAccess.ResolveMemberAccess): You can't reference a type
558         through an expression; fixes #33180.
559         (Indexers.GetIndexersForType): Don't return the indexers from
560         interfaces the class implements; fixes #46502.
561
562 2003-07-21  Martin Baulig  <martin@ximian.com>
563
564         * class.cs (TypeContainer.CheckPairedOperators): Added CS0660 and
565         CS0661 checks; fixes bug #30442.
566
567 2003-07-21  Martin Baulig  <martin@ximian.com>
568
569         * decl.cs (AdditionResult): Added `Error'.
570
571         * enum.cs (AddEnumMember): Report a CS0076 if name is `value__'.
572
573         * typemanager.cs (TypeManager.ChangeType): Catch exceptions;
574         makes cs0031.cs actually work.
575
576 2003-07-20  Martin Baulig  <martin@ximian.com>
577
578         * namespace.cs: Fixed that bug which caused a crash when compiling
579         the debugger's GUI.
580
581 2003-07-20  Miguel de Icaza  <miguel@ximian.com>
582
583         * typemanager.cs (LookupTypeReflection): Never expose types which
584         are NotPublic, NestedPrivate, NestedAssembly, or
585         NestedFamANDAssem.  We used to return these, and later do a check
586         that would report a meaningful error, but the problem is that we
587         would not get the real match, if there was a name override.
588
589 2003-07-18  Miguel de Icaza  <miguel@ximian.com>
590
591         * namespace.cs (Namespace, Name): Do not compute the namespace
592         name dynamically, compute it in the constructor.  This reduced
593         memory usage by 1697 KB.
594
595         * driver.cs: Use --pause to pause at the end.
596
597 2003-07-17  Peter Williams  <peter@newton.cx>
598
599         * Makefile: Change the name of the test target so that it doesn't
600         conflict with the recursive test target.
601
602 2003-07-17  Miguel de Icaza  <miguel@ximian.com>
603
604         * expression.cs (LocalVariableReference.Emit, EmitAssign,
605         AddressOf): Do not use EmitThis, that was wrong, use the actual
606         this pointer.
607
608 2003-07-15  Miguel de Icaza  <miguel@ximian.com>
609
610         * class.cs (MethodData.Define): While checking if a method is an
611         interface implementation, improve the test: If we are not public
612         (use new test here: use the computed MethodAttributes directly,
613         instead of the parsed modifier flags) check if the `implementing'
614         method comes from an interface or not.
615
616         * pending.cs (VerifyPendingMethods): Slightly better error
617         message.
618
619         * makefile: add test target that does the mcs bootstrap.
620
621 2003-07-16  Ravi Pratap  <ravi@ximian.com>
622
623         * interface.cs (Define): Do nothing here since there are no
624         members to populate etc. Move the attribute emission out of here
625         since this was just totally the wrong place to put it. Attribute
626         application happens during the 'Emit' phase, not in the 'Define'
627         phase.
628
629         (Emit): Add this method and move the attribute emission here
630
631         * rootcontext.cs (EmitCode): Call the Emit method on interface
632         types too.
633
634 2003-07-14  Ravi Pratap M  <ravi@ximian.com>
635
636         * expression.cs (OverloadResolve): Report error only if Location
637         is not 'Null' which means that there was a probe going on.
638
639 2003-07-14  Martin Baulig  <martin@ximian.com>
640
641         * expression.cs (ConditionalLogicalOperator): New public class to
642         implement user defined conditional logical operators.
643         This is section 14.11.2 in the spec and bug #40505.
644
645 2003-07-14  Martin Baulig  <martin@ximian.com>
646
647         * ecore.cs (FieldExpr.DoResolveLValue): Fixed bug #46198.
648
649 2003-07-14  Martin Baulig  <martin@ximian.com>
650
651         * codegen.cs (EmitContext.InFixedInitializer): New public field.
652
653         * ecore.cs (IVariable.VerifyFixed): New interface method.
654
655         * expression.cs (Unary.ResolveOperator): When resolving the `&'
656         operator, check whether the variable is actually fixed.  Fixes bug
657         #36055.  Set a variable definitely assigned when taking its
658         address as required by the spec.
659
660         * statement.cs (LocalInfo.IsFixed): New field.
661         (LocalInfo.MakePinned): Set `IsFixed' to true.
662
663 2003-07-14  Ravi Pratap M  <ravi@ximian.com>
664
665         * attribute.cs (Attribute.Resolve): While doing a Member lookup
666         for .ctors, ensure that we only ask for members declared in the
667         attribute type (BindingFlags.DeclaredOnly).
668
669         Fixes bug #43632.
670
671         * expression.cs (Error_WrongNumArguments): Report error 1501
672         correctly the way CSC does.
673
674 2003-07-13  Martin Baulig  <martin@ximian.com>
675
676         * expression.cs (MemberAccess.ResolveAsTypeStep): Try to do a type
677         lookup on the fully qualified name, to make things like "X.X" work
678         where "X.X" is a fully qualified type name, but we also have a
679         namespace "X" in the using list.  Fixes #41975.
680
681 2003-07-13  Martin Baulig  <martin@ximian.com>
682
683         * assign.cs (Assign.GetEmbeddedAssign): New protected virtual
684         function. If we're a CompoundAssign, we need to create an embedded
685         CompoundAssign, not an embedded Assign.
686         (Assign.DoResolve): Make this work for embedded CompoundAssign's.
687         Fixes #45854.
688
689 2003-07-13  Martin Baulig  <martin@ximian.com>
690
691         * typemanager.cs (TypeManager.IsNestedChildOf): Make this actually
692         work to fix bug #46088.
693
694 2003-07-13  Ravi Pratap <ravi@ximian.com>
695
696         * class.cs (Operator.Emit): Do not emit attributes here - it is
697         taken care of by the Method class that we delegate too. This takes
698         care of bug #45876.
699         
700 2003-07-10  Martin Baulig  <martin@ximian.com>
701
702         * expression.cs (TypeOfVoid): New class.
703         (TypeOf): Report a CS0673 if it's System.Void.  Fixes #42264.
704
705 2003-07-10  Martin Baulig  <martin@ximian.com>
706
707         * class.cs (MethodCore.DoDefineParameters): Added CS0225 check;
708         bug #35957.
709
710 2003-07-10  Martin Baulig  <martin@ximian.com>
711
712         * rootcontext.cs (RootContext.NamespaceLookup): Take a DeclSpace,
713         not a NamespaceEntry, so we can use DeclSpace.CheckAccessLevel().
714
715         * decl.cs (DeclSpace.FindType): Use DeclSpace.CheckAccessLevel().
716
717         * typemanager.cs (TypeManager.IsAccessibleFrom): Removed.
718
719 2003-07-10  Martin Baulig  <martin@ximian.com>
720
721         * expression.cs (ArrayCreation): Don't use a byte blob for arrays
722         of decimal.  Fixes #42850.
723
724         NOTE: I also fixed the created byte blob, but this doesn't work on
725         the MS runtime and csc never produces any byte blobs for decimal
726         arrays.
727
728 2003-07-10  Martin Baulig  <martin@ximian.com>
729
730         * statement.cs (StructInfo.GetStructInfo): Catch deep cycles in
731         structs; fixes #32068.
732         (Block.AddChildVariableNames): Fixed #44302.
733
734 2003-07-07  Gonzalo Paniagua Javier <gonzalo@ximian.com>
735
736         * namespace.cs: fixed compilation with csc. It's bugzilla #44302.
737         
738 2003-07-07  Miguel de Icaza  <miguel@ximian.com>
739
740         * attribute.cs: And this test is onger needed.
741
742 2003-07-08  Martin Baulig  <martin@ximian.com>
743
744         * rootcontext.cs (RootContext.NamespaceLookup): Ignore
745         inaccessible types.  Fixes #36313.
746
747         * decl.cs (DeclSpace.FindType): Ignore inaccessible types.
748
749         * namespace.cs (NamespaceEntry): Create implicit entries for all
750         namespaces; ie. if we have `namespace N1.N2.N3 { ... }', we create
751         implicit entries for N1.N2 and N1.
752
753 2003-07-08  Martin Baulig  <martin@ximian.com>
754
755         Rewrote the handling of namespaces to fix a lot of the issues
756         wrt. `using' aliases etc.
757
758         * namespace.cs (Namespace): Splitted this class into a
759         per-assembly `Namespace' and a per-file `NamespaceEntry'.
760
761         * typemanager.cs (TypeManager.IsNamespace): Removed.
762         (TypeManager.ComputeNamespaces): Only compute namespaces from
763         loaded assemblies here, not the namespaces from the assembly we're
764         currently compiling.
765
766 2003-07-08  Martin Baulig  <martin@ximian.com>
767
768         * rootcontext.cs, class.cs: Fixed the CS1530 reporting.
769
770 2003-07-07  Miguel de Icaza  <miguel@ximian.com>
771
772         * typemanager.cs: Reverted patch from Gonzalo, my previous patch
773         already fixed it.  
774
775         I thought about the memory savings here, but LookupTypeReflection
776         is used under already very constrained scenarios.  Compiling
777         corlib or mcs only exposes one hit, so it would not really reduce
778         any memory consumption.
779
780 2003-07-07  Gonzalo Paniagua Javier <gonzalo@ximian.com>
781
782         * typemanager.cs: fixes bug #45889 by only adding public types from
783         other assemblies to the list of known types.
784
785 2003-07-07  Miguel de Icaza  <miguel@ximian.com>
786
787         * attribute.cs (Attribute.Resolve): Add call to CheckAccessLevel
788         on the type we resolved.
789
790 2003-07-05  Martin Baulig  <martin@ximian.com>
791
792         * pending.cs (PendingImplementation.ParentImplements): Don't
793         create the proxy if the parent is abstract.
794
795         * class.cs (TypeContainer.DefineIndexers): Process explicit
796         interface implementations first.  Fixes #37714.
797
798 2003-07-04  Miguel de Icaza  <miguel@ximian.com>
799
800         * expression.cs (MemberAccess.ResolveMemberAccess): Events are
801         defined recursively;  but since we modify the input parameters
802         (left is set to `this' temporarily), we reset this value if the
803         left_is_explicit is false, which gives the original semantics to
804         the code.  
805
806         * literal.cs (NullPointer): new class used to represent a null
807         literal in a pointer context.
808
809         * convert.cs (Convert.ImplicitReferenceConversion): Is the target
810         type is a pointer, use a NullPointer object instead of a
811         NullLiteral.   Closes 43687
812
813         (ExplicitConversion): Convert pointer values using
814         the conv opcode to the proper type.
815
816         * ecore.cs (New): change ValueTypeVariable property into a method,
817         that returns whether the valuetype is suitable for being used.
818
819         * expression.cs (Binary.DoNumericPromotions): Only return if we
820         the int constant was a valid uint, and we can return both left and
821         right as uints.  If not, we continue processing, to trigger the
822         type conversion.  This fixes 39018.
823
824         * statement.cs (Block.EmitMeta): During constant resolution, set
825         the CurrentBlock property on the emitcontext, so that we resolve
826         constants propertly.
827
828 2003-07-02  Martin Baulig  <martin@ximian.com>
829
830         * codegen.cs (EmitContext.NeedExplicitReturn): New public variable.
831         (EmitContext.EmitTopBlock): Emit an explicit return if it's set.
832
833         * statement.cs (Try.Resolve): Set ec.NeedExplicitReturn rather
834         than emitting it here.
835
836         * statement.cs: Fixed some more flow analysis bugs.
837
838 2003-07-02  Martin Baulig  <martin@ximian.com>
839
840         * class.cs (MethodData.Define): When implementing interface
841         methods, set Final unless we're Virtual.
842
843         * decl.cs (MemberCore.CheckMethodAgainstBase): Make the CS0506
844         check work for interface methods.
845
846 2003-07-01  Martin Baulig  <martin@ximian.com>
847
848         * ecore.cs (EmitContext.This): Replaced this property with a
849         GetThis() method which takes a Location argument.  This ensures
850         that we get the correct error location for a CS0188.
851
852 2003-07-01  Miguel de Icaza  <miguel@ximian.com>
853
854         * ecore.cs: (Convert.ConvertIntLiteral): Add test for
855         ImplicitStandardConversion.
856
857         * class.cs (TypeContainer.GetClassBases): Small bug fix for 45649.
858
859 2003-07-01  Zoltan Varga  <vargaz@freemail.hu>
860
861         * expression.cs (ResolveOperator): Fix Concat (string, string, string)
862         optimization.
863
864 2003-06-30  Miguel de Icaza  <miguel@ximian.com>
865
866         * class.cs (Constructor.Define): Turn off initlocals for unsafe
867         constructors.
868
869         (MethodData.Define): Turn off initlocals for unsafe methods.
870
871 2003-06-29  Miguel de Icaza  <miguel@ximian.com>
872
873         * decl.cs (DeclSpace.CheckAccessLevel): Make this routine
874         complete;  Fixes #37521.
875
876         * delegate.cs: Use Modifiers.TypeAttr to compute the
877         TypeAttributes, instead of rolling our own.  This makes the flags
878         correct for the delegates.
879
880 2003-06-28  Miguel de Icaza  <miguel@ximian.com>
881
882         * class.cs (Constructor.Define): Set the private flag for static
883         constructors as well.
884
885         * cs-parser.jay (statement_expression): Set the return value to
886         null, to avoid a crash when we catch an error.
887
888 2003-06-24  Miguel de Icaza  <miguel@ximian.com>
889
890         * cs-parser.jay: Applied patch from Jackson that adds support for
891         extern and unsafe modifiers to destructor declarations.
892
893         * expression.cs: Report error 21 if the user is trying to index a
894         System.Array.
895
896         * driver.cs: Add an error message, suggested by the bug report.
897
898         * class.cs (TypeContainer.Emit): Only call EmitFieldInitializers
899         if we do not have a ": this ()" constructor initializer.  Fixes 45149
900
901 2003-06-14  Miguel de Icaza  <miguel@ximian.com>
902
903         * namespace.cs: Add some information to reduce FAQs.
904
905 2003-06-13  Miguel de Icaza  <miguel@ximian.com>
906
907         * cfold.cs (BinaryFold): BitwiseAnd, BitwiseOr: handle other
908         underlying enumeration types.  Fixes #43915.
909
910         * expression.cs: Treat ushort/short as legal values to be used in
911         bitwise operations.
912
913 Wed Jun 4 13:19:04 CEST 2003 Paolo Molaro <lupus@ximian.com>
914
915         * delegate.cs: transfer custom attributes for paramenters from
916         the delegate declaration to Invoke and BeginInvoke.
917
918 Tue Jun 3 11:11:08 CEST 2003 Paolo Molaro <lupus@ximian.com>
919
920         * attribute.cs: handle custom marshalers and emit marshal info
921         for fields, too.
922
923 2003-05-28  Hector E. Gomez Morales  <hgomez_36@flashmail.com>
924
925         * makefile.gnu: Added anonymous.cs to the compiler sources.
926
927 2003-05-28  Miguel de Icaza  <miguel@ximian.com>
928
929         * iterators.cs: Change the name of the proxy class to include two
930         underscores.
931
932         * cs-parser.jay: Update grammar to include anonymous methods.
933         
934         * anonymous.cs: new file.
935
936 2003-05-27  Miguel de Icaza  <miguel@ximian.com>
937
938         * class.cs (Field.Define): Add missing test for pointers and
939         safety. 
940
941 2003-05-27  Ravi Pratap  <ravi@ximian.com>
942
943         * expression.cs (ArrayAccess.GetStoreOpCode): For System.IntPtr,
944         we use the stobj opcode.
945
946         (ArrayCreation.EmitDynamicInitializers): Revert Miguel's patch
947         since it wasn't the correct fix. 
948
949         It still is puzzling that we are required to use stobj for IntPtr
950         which seems to be a ValueType.
951
952 2003-05-26  Miguel de Icaza  <miguel@ximian.com>
953
954         * ecore.cs (SimpleName.SimpleNameResolve): Consider using aliases
955         during regular simple name resolution.   Now, the trick is that
956         instead of returning for processing the simplename, we do a
957         TypeManager.LookupType (ie, a rooted lookup as opposed to a
958         contextual lookup type).   If a match is found, return that, if
959         not, return for further composition.
960
961         This fixes long-standing 30485.
962
963         * expression.cs (ArrayCreation.EmitDynamicInitializers): When
964         using the address to initialize an object, do an Stobj instead of
965         using the regular Stelem.
966
967         (IndexerAccess.Emit, IndexerAccess.EmitAssign):
968         Pass `is_base_indexer' to Invocation.EmitCall instead of false.
969         Because if we are a BaseIndexerAccess that value will be true.
970         Fixes 43643.
971
972         * statement.cs (GotoCase.Resolve): Return after reporting an
973         error, do not attempt to continue. 
974
975         * expression.cs (PointerArithmetic.Emit): If our operand is a
976         long, convert our constants to match the operand before
977         multiplying.  Convert to I type before adding.   Fixes 43670.
978         
979 2003-05-14  Ravi Pratap  <ravi@ximian.com>
980
981         * enum.cs (ImplicitConversionExists) : Rename to
982         ImplicitEnumConversionExists to remove ambiguity. 
983
984         * ecore.cs (NullCast): New type of cast expression class which
985         basically is very similar to EmptyCast with the difference being
986         it still is a constant since it is used only to cast a null to
987         something else
988         (eg. (string) null)
989
990         * convert.cs (ImplicitReferenceConversion): When casting a null
991         literal, we return a NullCast.
992
993         * literal.cs (NullLiteralTyped): Remove - I don't see why this
994         should be around anymore.
995
996         The renaming (reported was slightly wrong). Corrections:
997
998         ConvertImplicitStandard -> ImplicitConversionStandard
999         ConvertExplicitStandard -> ExplicitConversionStandard
1000
1001         * expression.cs (StaticCallExpr.MakeSimpleCall): Resolve arguments
1002         before passing them in !
1003
1004         * convert.cs (ImplicitConversionStandard): When comparing for
1005         equal expr and target types, ensure that expr is not a
1006         NullLiteral.
1007
1008         In general, we must not be checking (expr_type ==
1009         target_type) in the top level conversion methods
1010         (ImplicitConversion, ExplicitConversion etc). This checking is
1011         done in the methods that they delegate to.
1012
1013 2003-05-20  Miguel de Icaza  <miguel@ximian.com>
1014
1015         * convert.cs: Move Error_CannotConvertType,
1016         ImplicitReferenceConversion, ImplicitReferenceConversionExists,
1017         ImplicitNumericConversion, ImplicitConversionExists,
1018         ImplicitUserConversionExists, StandardConversionExists,
1019         FindMostEncompassedType, FindMostSpecificSource,
1020         FindMostSpecificTarget, ImplicitUserConversion,
1021         ExplicitUserConversion, GetConversionOperators,
1022         UserDefinedConversion, ConvertImplicit, ConvertImplicitStandard,
1023         TryImplicitIntConversion, Error_CannotConvertImplicit,
1024         ConvertImplicitRequired, ConvertNumericExplicit,
1025         ExplicitReferenceConversionExists, ConvertReferenceExplicit,
1026         ConvertExplicit, ConvertExplicitStandard from the ecore.cs into
1027         its own file.
1028
1029         Perform the following renames:
1030         
1031         StandardConversionExists -> ImplicitStandardConversionExists
1032         ConvertImplicit -> ImplicitConversion
1033         ConvertImplicitStandard -> ImplicitStandardConversion
1034         TryImplicitIntConversion -> ImplicitIntConversion
1035         ConvertImplicitRequired -> ImplicitConversionRequired
1036         ConvertNumericExplicit -> ExplicitNumericConversion
1037         ConvertReferenceExplicit -> ExplicitReferenceConversion
1038         ConvertExplicit -> ExplicitConversion
1039         ConvertExplicitStandard -> ExplicitStandardConversion
1040
1041 2003-05-19  Martin Baulig  <martin@ximian.com>
1042
1043         * statement.cs (TypeInfo.StructInfo): Made this type protected.
1044         (TypeInfo): Added support for structs having structs as fields.
1045
1046         * ecore.cs (FieldExpr): Implement IVariable.
1047         (FieldExpr.DoResolve): Call VariableInfo.GetSubStruct() to get the
1048         VariableInfo for the field.
1049
1050 2003-05-18  Martin Baulig  <martin@ximian.com>
1051
1052         * expression.cs (This.DoResolve): Report a CS0027 if we're
1053         emitting a field initializer.
1054
1055 2003-05-18  Martin Baulig  <martin@ximian.com>
1056
1057         * expression.cs (This.ResolveBase): New public function.
1058         (This.DoResolve): Check for CS0188.
1059
1060         * codegen.cs (EmitContext.This): Just call This.ResolveBase(), not
1061         This.Resolve().
1062
1063         * ecore.cs (MethodGroupExpr.DoResolve): Set the
1064         `instance_expression' to null if we don't have any non-static
1065         methods.
1066
1067 2003-05-18  Martin Baulig  <martin@ximian.com>
1068
1069         Reworked the way how local variables and parameters are handled by
1070         the flow analysis code.
1071
1072         * statement.cs (TypeInfo, VariableMap): New public classes.
1073         (VariableInfo): New public class.  This is now responsible for
1074         checking whether a variable has been assigned.  It is used for
1075         parameters and local variables.
1076         (Block.EmitMeta): Take the InternalParameters as argument; compute
1077         the layout of the flow vectors here.
1078         (Block.LocalMap, Block.ParameterMap): New public properties.
1079         (FlowBranching): The .ctor doesn't get the InternalParameters
1080         anymore since Block.EmitMeta() now computes the layout of the flow
1081         vector.
1082         (MyStructInfo): This class is now known as `StructInfo' and nested
1083         in `TypeInfo'; we don't access this directly anymore.
1084
1085         * ecore.cs (IVariable): Added `VariableInfo VariableInfo'
1086         property and removed IsAssigned(), IsFieldAssigned(),
1087         SetAssigned() and SetFieldAssigned(); we now call them on the
1088         VariableInfo so we don't need to duplicate this code everywhere.
1089
1090         * expression.cs (ParameterReference): Added `Block block' argument
1091         to the .ctor.
1092         (LocalVariableReference, ParameterReference, This): The new
1093         VariableInfo class is now responsible for all the definite
1094         assignment stuff.
1095
1096         * codegen.cs (EmitContext.IsVariableAssigned, SetVariableAssigned,
1097         IsParameterAssigned, SetParameterAssigned): Removed.
1098
1099 2003-05-18  Martin Baulig  <martin@ximian.com>
1100
1101         * typemanager.cs (InitCoreTypes): Try calling
1102         SetCorlibTypeBuilders() with 4 args; if that fails, fall back to
1103         the 3-args-version.  Corlib now also needs our `void_type'.
1104         (GetMethod): Added overloaded version which takes an optional
1105         `bool report_errors' to allow lookups of optional methods.
1106
1107 2003-05-12  Martin Baulig  <martin@ximian.com>
1108
1109         * statement.cs (VariableInfo): Renamed to LocalInfo since it's
1110         only used for locals and not for parameters.
1111
1112 2003-05-12  Miguel de Icaza  <miguel@ximian.com>
1113
1114         * support.cs (InternalParameters.ParameterType): Return the
1115         ExternalType of the parameter.
1116
1117         * parameter.cs (Parameter.ExternalType): drop the two arguments,
1118         they were unused.
1119
1120 2003-05-11  Miguel de Icaza  <miguel@ximian.com>
1121
1122         * class.cs (MethodData.Define): Do not set the `newslot' on
1123         interface members, if they are also flagged as "override".
1124
1125         * expression.cs (UnaryMutator.EmitCode): Simple workaround to emit
1126         better code for ++i and i++.  This only works for static fields
1127         and local variables.
1128
1129         * typemanager.cs (LookupDeclSpace): Add new method, sometimes we
1130         want to pull the DeclSpace out of the builder_to_declspace instead
1131         of the TypeBuilder (like in TypeContainer.FindMembers).
1132
1133         * class.cs (TypeContainer.FindMembers): Use LookupDeclSpace
1134         instead of LookupTypeContainer.  Fixes the crash on .NET for
1135         looking up interface members.
1136
1137         * const.cs: Create our own emit context during the Definition
1138         stage, so that constants are evaluated in the proper context, when
1139         a recursive definition happens.
1140
1141 2003-05-11  Martin Baulig  <martin@ximian.com>
1142
1143         * statement.cs (Block.CreateSwitchBlock): New method.  Creates a
1144         new block for a switch section.
1145         (Block.AddLabel, Block.LookupLabel): If we're a switch section, do
1146         the adding/lookup in the switch block.  Fixes #39828.
1147
1148 2003-05-09  Miguel de Icaza  <miguel@ximian.com>
1149
1150         * expression.cs (UnaryMutator.LoadOneAndEmitOp): Missing
1151         functionality: I needed to convert the data after I had performed
1152         the add/sub operation into the operands type size.
1153
1154         * ecore.cs (ImplicitReferenceConversion): When boxing an interface
1155         pass the type for the box operation, otherwise the resulting
1156         object would have been of type object.
1157
1158         (BoxedCast): Add constructor to specify the type to box as.
1159
1160 2003-05-07  Miguel de Icaza  <miguel@ximian.com>
1161
1162         * iterators.cs: I was reusing the `count' variable inadvertently,
1163         take steps to not allow this to happen.
1164
1165 2003-05-06  Miguel de Icaza  <miguel@ximian.com>
1166
1167         * attribute.cs (Attribute.Resolve): Params attributes are encoded
1168         by creating an array at the point where the params starts and
1169         putting all those arguments there, then adjusting the size of the
1170         array.
1171
1172 2003-05-05  Miguel de Icaza  <miguel@ximian.com>
1173
1174         * expression.cs (New.AddressOf): Implement interface
1175         IMemoryLocation.  This is used when the `new' operator is used in
1176         the context of an invocation to a method on a value type.
1177
1178         See http://bugzilla.ximian.com/show_bug.cgi?id=#42390 for an
1179         example. 
1180
1181         * namespace.cs: Also check the using aliases here.
1182
1183         * driver.cs: Move the test for using validity after the types have
1184         been entered, so we do a single pass that also includes the using
1185         aliases. 
1186
1187         * statement.cs (Try.Resolve): Avoid crashing if there is a failure
1188         in the regular case.   CreateSiblingForFinally is doing extra
1189         error checking.
1190
1191         * attribute.cs (GetAttributeArgumentExpression): Store the result
1192         on an out value, and use the return value to indicate failure
1193         instead of using null (which is a valid return for Constant.GetValue).
1194
1195         * statement.cs: Perform the analysis flow for the increment
1196         portion after the statement, because this will be the real flow of
1197         execution.  Fixes #42385
1198
1199         * codegen.cs (EmitContext.EmitArgument,
1200         EmitContext.EmitStoreArgument): New helper functions when the
1201         RemapToProxy flag is set.
1202
1203         * expression.cs (ParameterReference.EmitLdarg): Expose this useful
1204         function.
1205
1206         Add support for remapping parameters. 
1207
1208         * iterators.cs: Propagate parameter values;  Store parameter
1209         values in the proxy classes.
1210         
1211 2003-05-04  Miguel de Icaza  <miguel@ximian.com>
1212
1213         * ecore.cs (FieldExpr): Fix an obvious bug.  static fields do not
1214         need a proxy reference;  I do not know what I was thinking
1215
1216         * cs-parser.jay (constructor_initializer): catch another error,
1217         and display nice message.
1218         
1219         (field_declaration): catch void field declaration
1220         to flag a better error. 
1221
1222         * class.cs (MemberBase.CheckBase): Report an error instead of a
1223         warning if a new protected member is declared in a struct. 
1224         (Field.Define): catch the error of readonly/volatile.
1225
1226         * ecore.cs (FieldExpr.EmitAssign): reuse the field lookup.
1227
1228         (FieldExpr.AddressOf): ditto.  Catch error where the address of a
1229         volatile variable is taken
1230
1231 2003-05-02  Miguel de Icaza  <miguel@ximian.com>
1232
1233         * statement.cs (Fixed.Resolve): Report an error if we are not in
1234         an unsafe context.
1235
1236 2003-05-01  Miguel de Icaza  <miguel@ximian.com>
1237
1238         * typemanager.cs: reuse the code that handles type clashes for
1239         delegates and enumerations.
1240
1241         * class.cs (Report28): Always report.
1242
1243         * expression.cs (EncodeAsAttribute): Allow nulls here.
1244
1245 2003-04-28  Miguel de Icaza  <miguel@ximian.com>
1246
1247         * attribute.cs (Attribute.GetAttributeArgumentExpression): Moved
1248         the functionality for testing whether an expression is valid for
1249         an attribute here.  Also handle the case of arrays of elements
1250         being stored. 
1251
1252         * expression.cs (ArrayCreation.EncodeAsAttribute): Add support for
1253         encoding a linear array into an array of objects that are suitable
1254         to be passed to an CustomAttributeBuilder.
1255
1256         * delegate.cs: Check unsafe types being used outside of an Unsafe context.
1257
1258         * ecore.cs: (FieldExpr): Handle field remapping here.
1259
1260         * iteratators.cs: Pass the instance variable (if the method is an
1261         instance method) to the constructors, so we can access the field
1262         variables on the class.
1263
1264         TODO: Test this with structs.  I think the THIS variable on
1265         structs might have to be a pointer, and not a refenrece
1266
1267 2003-04-27  Miguel de Icaza  <miguel@ximian.com>
1268
1269         * codegen.cs (EmitContext.Mapvariable): Adds a mechanism to map
1270         local variables to fields in a proxy class.
1271
1272         * iterators.cs (PopulateProxy): Rename our internal fields to
1273         <XXX>.  
1274         Create a <THIS> field if we are an instance method, so we can
1275         reference our parent container variables.
1276         (MapVariable): Called back from the EmitContext code to enter a
1277         new variable to field mapping into the proxy class (we just create
1278         a FieldBuilder).
1279
1280         * expression.cs
1281         (LocalVariableReference.{Emit,EmitAssign,AddressOf}): Add support
1282         for using the remapped locals to fields.
1283
1284         I placed the code here, because that gives the same semantics to
1285         local variables, and only changes the Emit code.
1286
1287         * statement.cs (Fixed.Resolve): it is not allowed to have fixed
1288         statements inside iterators.
1289         (VariableInfo): Add a FieldBuilder for the cases when we are
1290         remapping local variables to fields in a proxy class
1291
1292         * ecore.cs (SimpleNameResolve): Avoid testing two times for
1293         current_block != null.
1294
1295         * statement.cs (Swithc.SimpleSwitchEmit): Removed code that did
1296         not cope with strings, as it has been moved to the
1297         TableSwitchEmit.  Fixed bug in switch generation.
1298
1299         * expression.cs (New.DoResolve): Provide more context for the user
1300         when reporting an error.
1301
1302         * ecore.cs (Expression.LoadFromPtr): Use ldind_i when loading
1303         pointers. 
1304
1305         * expression.cs (MemberAccess.DoResolve): When we get a type back,
1306         check the permissions for it.  Note than in a type-resolution
1307         context the check was already present in DeclSpace.ResolveType,
1308         but was missing from the MemberAccess.
1309
1310         (ArrayCreation.CheckIndices): warn if the user has
1311         more nested levels of expressions, but there are no more
1312         dimensions specified.  Avoids crash on bug 41906.
1313
1314 2003-04-26  Miguel de Icaza  <miguel@ximian.com>
1315
1316         * statement.cs (Block): replace Implicit bool, for a generic
1317         flags.   
1318         New flag: `Unchecked'.  This is used during the EmitMeta phase
1319         (which is out-of-line with the regular Resolve/Emit process for a
1320         statement, as this is done ahead of time, but still gets a chance
1321         to call constant resolve).
1322         
1323         (Block.Flags): new enum for adding a new flag.
1324
1325         (Block.EmitMeta): track the state of unchecked.
1326         
1327         (Unchecked): Set the "UnChecked" flags on any blocks we enclose,
1328         to enable constant resolution to work there as well.
1329
1330 2003-04-22  Miguel de Icaza  <miguel@ximian.com>
1331
1332         * typemanager.cs (ienumerable_type): Also look up
1333         System.Collections.IEnumerable. 
1334
1335 2003-04-21  Miguel de Icaza  <miguel@ximian.com>
1336
1337         TODO: Test more than one conditional per method.
1338         
1339         * class.cs (Indexer.Define): Report the location where the user is
1340         referencing the unsupported feature.
1341
1342         (MethodData): Overload the use of `conditionals' to
1343         minimize the creation of needless ArrayLists.   This saves roughly
1344         212kb on my machine.
1345
1346         (Method): Implement the new IIteratorContainer interface.
1347         (Method.SetYields): Implement the method by setting the ModFlags
1348         to contain METHOD_YIELDS.
1349         
1350         * expression.cs (Unary.ResolveOperator): Use expr_type, not Expr,
1351         which just got set to null.
1352
1353         * iterators.cs: New file.
1354
1355         (Yield, YieldBreak): New statements.
1356
1357         * statement.cs (Return.Resolve): Flag an error if we are used in
1358         an iterator method.
1359
1360         * codegen.cs (InIterator): New flag set if the code is being
1361         compiled in an iterator method.
1362
1363         * modifiers.cs: New flag METHOD_YIELDS.  This modifier is an
1364         internal modifier, and we just use it to avoid adding extra
1365         fields, as this is seldom used.  
1366
1367         * cs-parser.jay: Add yield_statement (yield and yield break).
1368
1369         * driver.cs: New flag -v2 to turn on version 2 features. 
1370
1371         * cs-tokenizer.cs (Tokenizer): Add yield and __yield to the
1372         hashtable when v2 is enabled.
1373
1374 2003-04-20  Miguel de Icaza  <miguel@ximian.com>
1375
1376         * typemanager.cs (TypeManager.NamespaceClash): Use to check if
1377         there is already a namespace defined with this name.
1378
1379         (TypeManager.InitCoreTypes): Remove the temporary workaround, as
1380         people upgraded their corlibs.
1381
1382         (TypeManager.CoreLookupType): Use LookupTypeDirect, as we
1383         always use fully qualified types, no need to use the compiler
1384         front end.
1385
1386         (TypeManager.IsNamespace): Use binarysearch.
1387         
1388         * class.cs (AddClass, AddStruct, AddInterface, AddEvent,
1389         AddDelegate): I did not quite use the new IsValid API properly: I
1390         have to pass the short-name and the fullname.  I was passing only
1391         the basename instead of the fullname sometimes. 
1392
1393         (TypeContainer.DefineType): call NamespaceClash.
1394
1395         * interface.cs (Interface.DefineType): use NamespaceClash before
1396         defining the type.
1397
1398         * delegate.cs (Delegate.DefineType): use NamespaceClash before
1399         defining the type.
1400
1401         * enum.cs: (Enum.DefineType): use NamespaceClash before
1402         defining the type.
1403
1404         * typemanager.cs (: 3-line patch that gives us some tasty 11%
1405         speed increase.  First, use the negative_hits cache when we get a
1406         negative.  Second, add the type with its full original name
1407         instead of the new . and + encoded name (reflection uses + to
1408         separate type from a nested type).  Use LookupTypeReflection
1409         directly which bypasses the type->name hashtable (that we already
1410         know does not contain the type.
1411         
1412         * decl.cs (DeclSpace.ResolveTypeExpr): track the
1413         location/container type. 
1414
1415         * driver.cs: When passing utf8, use directly the UTF8Encoding.
1416
1417 2003-04-19  Miguel de Icaza  <miguel@ximian.com>
1418
1419         * decl.cs (ResolveTypeExpr): Mirror check acess here too.
1420
1421         * delegate.cs (NewDelegate.Resolve): Test whether an instance
1422         method is being referenced in the method group from a static
1423         context, and report error 120 if so.
1424
1425         * expression.cs, ecore.cs (Error_UnexpectedKind): New name for
1426         Error118. 
1427
1428         * typemanager.cs: Add intermediate namespaces (if a namespace A.B
1429         is created, we create the A namespace).
1430
1431         * cs-parser.jay: A namespace also introduces a DeclarationFound.
1432         Fixes #41591
1433
1434 2003-04-18  Miguel de Icaza  <miguel@ximian.com>
1435
1436         * typemanager.cs (GetReferenceType, GetPointerType): In .NET each
1437         invocation to ModuleBuilder.GetType with the same values will
1438         return a new type instance, so we need to cache its return
1439         values. 
1440
1441         * expression.cs (Binary.ResolveOperator): Only allow the compare
1442         operators on enums if they are of the same type.
1443
1444         * ecore.cs (Expression.ImplicitReferenceConversion): handle target
1445         types of ValueType on their own case.  Before we were giving them
1446         the same treatment as objects.
1447
1448         * decl.cs (DeclSpace.IsValid): IsValid takes the short name and
1449         fullname.  Short name is used to compare against container name.
1450         Fullname is used to check against defined namespace names.
1451         
1452         * class.cs (AddProperty, AddField, AddClass, AddStruct, AddEnum,
1453         AddDelegate, AddEvent): Pass new parameter to DeclSpace.IsValid
1454
1455         (Method.CheckBase): Call parent.
1456         (MemberBase.CheckBase): Check for protected members on sealed
1457         classes.
1458         (PropertyBase.CheckBase): Call parent.
1459         (Field.Define): Call parent.
1460
1461         * report.cs: Negative error codes are now mapped to 8000 - code,
1462         so that the display is render more nicely.
1463
1464         * typemanager.cs: Do not use try/catch, instead report a regular
1465         error. 
1466
1467         (GetPointerType, GetReferenceType): These methods provide
1468         mechanisms to obtain the T* and T& from a T.  We had the code
1469         previously scattered around the code base, and it also used
1470         TypeManager.LookupType that would go through plenty of caches.
1471         This one goes directly to the type source.
1472
1473         In some places we did the Type.GetType followed by
1474         ModuleBuilder.GetType, but not in others, so this unifies the
1475         processing as well.
1476
1477         * namespace.cs (VerifyUsing): Perform a non-lazy approach to using
1478         statements now that we have namespace information.
1479
1480         * typemanager.cs (IsNamespace): New method, returns whether the
1481         string presented is a namespace or not.
1482
1483         (ComputeNamespaces): New public entry point, computes the list of
1484         available namespaces, using the GetNamespaces API call in Mono, or
1485         the slower version in MS.NET.   
1486
1487         Now before we start the semantic analysis phase, we have a
1488         complete list of namespaces including everything that the user has
1489         provided.
1490
1491         Deleted old code to cache namespaces in .nsc files.
1492
1493 2003-04-17  Miguel de Icaza  <miguel@ximian.com>
1494
1495         * class.cs: (TypeContainer.DefineDefaultConstructor): Use the
1496         class/struct location definition Location for the implicit
1497         constructor location.
1498
1499         (Operator.Define): Use the location of the operator for the
1500         implicit Method definition.
1501
1502         (Constructor.Emit): use the constructor location for the implicit
1503         base initializer constructor.
1504
1505         * ecore.cs: Remove ITypeExpression.  This interface is now gone,
1506         and the Expression class now contains two new methods:
1507
1508         ResolveAsTypeStep and ResolveAsTypeTerminal.  This is used to
1509         isolate type lookup from the rest of the resolution process.
1510
1511         Since we use Expressions to hold type definitions due to the way
1512         we parse the input we have historically overloaded Resolve to
1513         perform the Type lookups if a special flag is passed.  Now this is
1514         eliminated and two methods take their place. 
1515         
1516         The differences in the two methods between xStep and xTerminal is
1517         that xStep is involved in our current lookup system that uses
1518         SimpleNames to compose a name, while xTerminal is used just to
1519         catch the case where the simplename lookup failed.
1520         
1521 2003-04-16  Miguel de Icaza  <miguel@ximian.com>
1522
1523         * expression.cs (ResolveMemberAccess): Remove redundant code.
1524         TypeExpr expressions are always born fully resolved.
1525
1526         * interface.cs (PopulateMethod): Do not lookup the types twice.
1527         We were doing it once during SemanticAnalysis and once during
1528         PopulateMethod.
1529
1530         * cs-parser.jay: Due to our hack in the grammar, things like A.B[]
1531         in local variable type definitions, were being returned as a
1532         SimpleName (we decomposed everything into a string), that is
1533         because primary_expression was being used instead of a type in the
1534         grammar (reduce/reduce conflicts).
1535
1536         The part that was wrong is that we converted the expression into a
1537         string (an oversimplification in one hand, compounded with primary
1538         expressions doing string concatenation).
1539
1540         So things like:
1541
1542         A.B.C [] x;
1543
1544         Would return "A.B.C[]" as a SimpleName.  This stopped things like
1545         using clauses from working on this particular context.  And a type
1546         was being matched directly against "A.B.C[]".
1547
1548         We now use the correct approach, and allow for ComposedCast to be
1549         part of the unary expression.  So the "A.B.C []" become a composed
1550         cast of "A.B.C" (as a nested group of MemberAccess with a
1551         SimpleName at the end) plus the rank composition "[]". 
1552
1553         Also fixes 35567
1554         
1555 2003-04-10  Miguel de Icaza  <miguel@ximian.com>
1556
1557         * decl.cs (CheckAccessLevel): Implement the NestedPrivate rules
1558         for the access level checking.
1559
1560         * class.cs: Cosmetic changes.  Renamed `TypeContainer parent' to
1561         `TypeContainer container', because I kept getting confused when I
1562         was debugging this code.
1563
1564         * expression.cs (Indexers): Instead of tracking getters/setters,
1565         we now track them in parallel.  We create one arraylist less, but
1566         most importantly it is possible now for the LValue code to find a
1567         matching get for a set.
1568
1569         (IndexerAccess.DoResolveLValue): Update the code.
1570         GetIndexersForType has been modified already to extract all the
1571         indexers from a type.  The code assumed it did not.
1572
1573         Also make the code set the correct return type for the indexer.
1574         This was fixed a long time ago for properties, but was missing for
1575         indexers.  It used to be void_type.
1576
1577         (Binary.Emit): Test first for doubles instead of
1578         floats, as they are more common.
1579
1580         (Binary.EmitBranchable): Use the .un version of the branch opcodes
1581         when dealing with floats and the <=, >= operators.  This fixes bug
1582         #39314 
1583
1584         * statement.cs (Foreach.EmitArrayForeach): bug fix: The code used
1585         to load the array value by emitting a load on the foreach variable
1586         type.  This was incorrect.  
1587
1588         We now emit the code to load an element using the the array
1589         variable type, and then we emit the conversion operator.
1590
1591         Fixed #40176
1592
1593 2003-04-10  Zoltan Varga  <vargaz@freemail.hu>
1594
1595         * attribute.cs: Avoid allocation of ArrayLists in the common case.
1596
1597 2003-04-09  Miguel de Icaza  <miguel@ximian.com>
1598
1599         * class.cs (MethodSignature.InheritableMemberSignatureCompare):
1600         test for protection before we test for signatures. 
1601
1602         (MethodSignature.ToString): implement.
1603
1604         * expression.cs (Unary.TryReduceNegative): Add missing minus sign
1605         to the case where we reduced into a LongConstant.
1606
1607         * decl.cs (CheckAccessLevel): If the type is an array, we can not
1608         depend on whether the information is acurrate, because the
1609         Microsoft runtime will always claim that the array type is public,
1610         regardless of the real state.
1611
1612         If the type is a pointer, another problem happens: the type is
1613         reported as non-public in Microsoft.  
1614
1615         In both cases we have to call CheckAccessLevel recursively with
1616         the underlying type as the argument to be tested.
1617
1618 2003-04-08  Miguel de Icaza  <miguel@ximian.com>
1619
1620         * assign.cs (Assign.Emit): If we are dealing with a compound
1621         assignment expression, we should use the code path that stores the
1622         intermediate result in a temporary value.  This fixes #40903.
1623
1624         *expression.cs (Indirection.ToString): Provide ToString method for
1625         debugging. 
1626         
1627 2003-04-08  Zoltan Varga  <vargaz@freemail.hu>
1628
1629         * class.cs: Null out fields holding references to Block objects so
1630         they can be garbage collected.
1631
1632         * expression.cs (OverloadResolve): Remove unused local.
1633
1634 2003-04-07  Martin Baulig  <martin@ximian.com>
1635
1636         * codegen.cs (EmitContext.CurrentFile): New public field.
1637         (EmitContext.Mark): Use the CurrentFile to check whether the
1638         location is in the correct file.
1639         (EmitContext.EmitTopBlock): Initialize CurrentFile here.
1640
1641 2003-04-07  Martin Baulig  <martin@ximian.com>
1642
1643         * ecore.cs (Expression.ResolveBoolean): Don't call ec.Mark().
1644
1645         * codegen.cs (EmitContext.EmitTopBlock): Don't call Mark() on the
1646         location.  [FIXME: The location argument which gets passed to this
1647         method is sometimes wrong!]
1648
1649 2003-04-07  Nick Drochak <ndrochak@gol.com>
1650
1651         * codegen.cs: Be more verbose when we can't find the symbol writer dll.
1652
1653 2003-04-07  Miguel de Icaza  <miguel@ximian.com>
1654
1655         * expression.cs (Indirection.EmitAssign): We were using the
1656         temporary, but returning immediately instead of continuing the
1657         EmitAssing flow.
1658
1659 2003-04-06  Martin Baulig  <martin@ximian.com>
1660
1661         * ecore.cs (SimpleName.SimpleNameResolve): Don't report an error
1662         if it's a nested child, but also deriving from the outer class.
1663         See test 190.cs.
1664
1665         * typemanager.cs (IsNestedChildOf): Make this work if it's a
1666         nested child, but also deriving from the outer class.  See
1667         test-190.cs.
1668         (FilterWithClosure): We may access private members of the outer
1669         class if we're a nested child and deriving from the outer class.
1670         (RealMemberLookup): Only set `closure_private_ok' if the
1671         `original_bf' contained BindingFlags.NonPublic.
1672
1673 2003-04-05  Martin Baulig  <martin@ximian.com>
1674
1675         * statement.cs (FlowBranching.UsageVector.MergeChildren): Fix bug #40670.
1676
1677 2003-04-02  Miguel de Icaza  <miguel@ximian.com>
1678
1679         * class.cs (Event.Define): Do not allow abstract events to have
1680         initializers. 
1681
1682 2003-04-01  Miguel de Icaza  <miguel@ximian.com>
1683
1684         * cs-parser.jay: Add error productions for ADD/REMOVE missing a
1685         block in event declarations.
1686
1687         * ecore.cs (FieldExpr.AddressOf): If our instance expression is a
1688         value type, get its address.
1689
1690         * expression.cs (Is.Emit): For action `LeaveOnStack' we were
1691         leaving a class on the stack instead of a boolean value (int
1692         0/1).  Change the code so we compare against null, and then the
1693         result against zero.
1694
1695         * class.cs (TypeContainer.GetClassBases): We were checking for the
1696         parent class being sealed too late.
1697
1698         * expression.cs (Binary.Emit): For <= and >= when dealing with
1699         floating point values, use cgt.un and clt.un instead of cgt and
1700         clt alone.
1701
1702 2003-04-01  Zoltan Varga  <vargaz@freemail.hu>
1703
1704         * statement.cs: Apply the same optimization as MS: skip the 
1705         GetEnumerator returning an IEnumerator, and use the one returning a 
1706         CharEnumerator instead. This allows us to avoid the try-finally block 
1707         and the boxing.
1708
1709 2003-03-31  Gaurav Vaish <gvaish_mono@lycos.com>
1710
1711         * cs-parser.jay: Attributes cannot be applied to
1712                          namespaces. Fixes #40473
1713
1714 2003-03-31  Gonzalo Paniagua Javier <gonzalo@ximian.com>
1715
1716         * class.cs:
1717         (Add*): check if the name is valid using the full name for constants,
1718         fields, properties and events.
1719
1720 2003-03-28  Miguel de Icaza  <miguel@ximian.com>
1721
1722         * enum.cs (Enum.DefineType, Enum.IsValidEnumConstant): Also allow
1723         char constants to be part of the enumeration.
1724
1725         * expression.cs (Conditional.DoResolve): Add support for operator
1726         true. Implements the missing functionality from 14.12
1727
1728         * class.cs (TypeContainer.CheckPairedOperators): Report error for missmatch on
1729         operator true/false as required by the spec.
1730
1731         * expression.cs (Unary.ResolveOperator): In LogicalNot, do an
1732         implicit conversion to boolean.
1733
1734         * statement.cs (Statement.ResolveBoolean): A boolean expression is
1735         also one where the type implements `operator true'. 
1736
1737         * ecore.cs (Expression.GetOperatorTrue): New helper routine to
1738         get an expression that will invoke operator true based on an
1739         expression.  
1740
1741         (GetConversionOperators): Removed the hack that called op_True
1742         here.  
1743
1744         (Expression.ResolveBoolean): Move this from Statement.
1745
1746 2003-03-17  Miguel de Icaza  <miguel@ximian.com>
1747
1748         * ecore.cs (FieldExpr): do not allow initialization of initonly
1749         fields on derived classes
1750
1751 2003-03-13  Martin Baulig  <martin@ximian.com>
1752
1753         * statement.cs (Block.Emit): Call ig.BeginScope() and
1754         ig.EndScope() when compiling with debugging info; call
1755         LocalBuilder.SetLocalSymInfo _after_ opening the scope.
1756
1757 2003-03-08  Miguel de Icaza  <miguel@ximian.com>
1758
1759         * expression.cs (Indexers): Do not construct immediately, allow
1760         for new members to be appended as we go.  Fixes 38143
1761
1762 2003-03-07  Gonzalo Paniagua Javier <gonzalo@ximian.com>
1763
1764         * expression.cs: save/restore context when resolving an unchecked
1765         expression.
1766
1767 2003-03-05  Miguel de Icaza  <miguel@ximian.com>
1768
1769         * cfold.cs: Catch division by zero in modulus operator during
1770         constant folding.
1771
1772 2003-03-03  Miguel de Icaza  <miguel@ximian.com>
1773
1774         * interface.cs (Interface.DefineMembers): Avoid defining members
1775         twice. 
1776
1777 2003-02-27  Miguel de Icaza  <miguel@ximian.com>
1778
1779         * driver.cs: handle the +/- options for -noconfig
1780
1781         * statement.cs (Unckeched.Resolve): Also track the state of
1782         unchecked in the Resolve phase.
1783
1784 2003-02-27  Martin Baulig  <martin@ximian.com>
1785
1786         * ecore.cs (Expression.MemberLookup): Don't create a
1787         MethodGroupExpr for something which is not a method.  Fixes #38291.
1788
1789 2003-02-25  Miguel de Icaza  <miguel@ximian.com>
1790
1791         * class.cs (MemberBase.CheckParameters): Also check that the type
1792         is unmanaged if it is a pointer.
1793
1794         * expression.cs (SizeOf.Resolve): Add location information.
1795
1796         * statement.cs (Block.EmitMeta): Flag error (208) if a pointer to
1797         a managed type is declared.
1798
1799         * expression.cs (Invocation.VerifyArgumentsCompat): Check for the
1800         parameter modifiers as well.  Fixes bug 38606
1801
1802         * class.cs: Very sad.  Am backing out the speed up changes
1803         introduced by the ArrayList -> Array in the TypeContainer, as they
1804         were not actually that much faster, and introduced a bug (no error
1805         reports on duplicated methods).
1806
1807         * assign.cs (CompoundAssign.DoLResolve): Resolve the original
1808         source first, this will guarantee that we have a valid expression
1809         before calling in lower levels functions that will require a
1810         resolved object.  Then use this original_source in the
1811         target.ResolveLValue instead of the original source that was
1812         passed to us.
1813
1814         Another change.  Use target.Resolve instead of LValueResolve.
1815         Although we are resolving for LValues, we will let the Assign code
1816         take care of that (it will be called again from Resolve).  This
1817         basically allows code like this:
1818
1819         class X { X operator + (X x, object o) {} X this [int idx] { get; set; } }
1820         class Y { void A (X x) { x [0] += o; }
1821
1822         The problem was that the indexer was trying to resolve for
1823         set_Item (idx, object o) and never finding one.  The real set_Item
1824         was set_Item (idx, X).  By delaying the process we get the right
1825         semantics. 
1826
1827         Fixes bug 36505
1828         
1829 2003-02-23  Martin Baulig  <martin@ximian.com>
1830
1831         * statement.cs (Block.Emit): Override this and set ec.CurrentBlock
1832         while calling DoEmit ().
1833
1834         * codegen.cs (EmitContext.Mark): Don't mark locations in other
1835         source files; if you use the #line directive inside a method, the
1836         compiler stops emitting line numbers for the debugger until it
1837         reaches the end of the method or another #line directive which
1838         restores the original file.
1839
1840 2003-02-23  Martin Baulig  <martin@ximian.com>
1841
1842         * statement.cs (FlowBranching.UsageVector.MergeChildren): Fix bug #37708.
1843
1844 2003-02-23  Martin Baulig  <martin@ximian.com>
1845
1846         * statement.cs (Block.AddChildVariableNames): We need to call this
1847         recursively, not just for our immediate children.
1848
1849 2003-02-23  Martin Baulig  <martin@ximian.com>
1850
1851         * class.cs (Event.Define): Always make the field private, like csc does.
1852
1853         * typemanager.cs (TypeManager.RealMemberLookup): Make events
1854         actually work, fixes bug #37521.
1855
1856 2003-02-23  Miguel de Icaza  <miguel@ximian.com>
1857
1858         * delegate.cs: When creating the various temporary "Parameters"
1859         classes, make sure that we call the ComputeAndDefineParameterTypes
1860         on those new parameters (just like we do with the formal ones), to
1861         allow them to be resolved in the context of the DeclSpace.
1862
1863         This fixes the bug that Dick observed in Bugzilla #38530.
1864
1865 2003-02-22  Miguel de Icaza  <miguel@ximian.com>
1866
1867         * expression.cs (ResolveMemberAccess): When resolving a constant,
1868         do not attempt to pull a constant if the value was not able to
1869         generate a valid constant.
1870
1871         * const.cs (LookupConstantValue): Do not report more errors than required.
1872
1873 2003-02-19  Gonzalo Paniagua Javier <gonzalo@ximian.com>
1874
1875         * expression.cs: fixes bug #38328.
1876
1877 2003-02-18  Miguel de Icaza  <miguel@ximian.com>
1878
1879         * class.cs: Changed all the various members that can be part of a
1880         class from being an ArrayList to be an Array of the right type.
1881         During the DefineType type_list, interface_list, delegate_list and
1882         enum_list are turned into types, interfaces, delegates and enums
1883         arrays.  
1884
1885         And during the member population, indexer_list, event_list,
1886         constant_list, field_list, instance_constructor_list, method_list,
1887         operator_list and property_list are turned into their real arrays.
1888
1889         Although we could probably perform this operation earlier, for
1890         good error reporting we need to keep the lists and remove the
1891         lists for longer than required.
1892
1893         This optimization was triggered by Paolo profiling the compiler
1894         speed on the output of `gen-sample-program.pl' perl script. 
1895
1896         * decl.cs (DeclSpace.ResolveType): Set the ContainerType, so we do
1897         not crash in methods like MemberLookupFailed that use this field.  
1898
1899         This problem arises when the compiler fails to resolve a type
1900         during interface type definition for example.
1901
1902 2003-02-18  Miguel de Icaza  <miguel@ximian.com>
1903
1904         * expression.cs (Indexers.GetIndexersForType): Interfaces do not
1905         inherit from System.Object, so we have to stop at null, not only
1906         when reaching System.Object.
1907
1908 2003-02-17  Miguel de Icaza  <miguel@ximian.com>
1909
1910         * expression.cs: (Indexers.GetIndexersForType): Martin's fix used
1911         DeclaredOnly because the parent indexer might have had a different
1912         name, but did not loop until the top of the hierarchy was reached.
1913
1914         The problem this one fixes is 35492: when a class implemented an
1915         indexer from an interface, we were getting the interface method
1916         (which was abstract) and we were flagging an error (can not invoke
1917         abstract method).
1918
1919         This also keeps bug 33089 functioning, and test-148 functioning.
1920
1921         * typemanager.cs (IsSpecialMethod): The correct way of figuring
1922         out if a method is special is to see if it is declared in a
1923         property or event, or whether it is one of the predefined operator
1924         names.   This should fix correctly #36804.
1925
1926 2003-02-15  Miguel de Icaza  <miguel@ximian.com>
1927
1928         The goal here is to remove the dependency on EmptyCast.Peel ().
1929         Killing it completely.
1930         
1931         The problem is that currently in a number of places where
1932         constants are expected, we have to "probe" for an EmptyCast, and
1933         Peel, which is not the correct thing to do, as this will be
1934         repetitive and will likely lead to errors. 
1935
1936         The idea is to remove any EmptyCasts that are used in casts that
1937         can be reduced to constants, so we only have to cope with
1938         constants. 
1939
1940         This bug hunt was triggered by Bug 37363 and the desire to remove
1941         the duplicate pattern where we were "peeling" emptycasts to check
1942         whether they were constants.  Now constants will always be
1943         constants.
1944         
1945         * ecore.cs: Use an enumconstant here instead of wrapping with
1946         EmptyCast.  
1947
1948         * expression.cs (Cast.TryReduce): Ah, the tricky EnumConstant was
1949         throwing me off.  By handling this we can get rid of a few hacks.
1950         
1951         * statement.cs (Switch): Removed Peel() code.
1952
1953 2003-02-14  Miguel de Icaza  <miguel@ximian.com>
1954
1955         * class.cs: Location information for error 508
1956
1957         * expression.cs (New.DoResolve): Add a guard against double
1958         resolution of an expression.  
1959
1960         The New DoResolve might be called twice when initializing field
1961         expressions (see EmitFieldInitializers, the call to
1962         GetInitializerExpression will perform a resolve on the expression,
1963         and later the assign will trigger another resolution
1964
1965         This leads to bugs (#37014)
1966
1967         * delegate.cs: The signature for EndInvoke should contain any ref
1968         or out parameters as well.  We were not doing this in the past. 
1969
1970         * class.cs (Field.Define): Do not overwrite the type definition
1971         inside the `volatile' group.  Turns out that volatile enumerations
1972         were changing the type here to perform a validity test, which
1973         broke conversions. 
1974
1975 2003-02-12  Miguel de Icaza  <miguel@ximian.com>
1976
1977         * ecore.cs (FieldExpr.AddressOf): In the particular case of This
1978         and structs, we do not want to load the instance variable
1979
1980         (ImplicitReferenceConversion, ImplicitReferenceConversionExists):
1981         enum_type has to be handled like an object reference (implicit
1982         conversions exists from this to object), but the regular IsClass
1983         and IsValueType tests will never return true for this one.
1984
1985         Also we use TypeManager.IsValueType instead of type.IsValueType,
1986         just for consistency with the rest of the code (this is only
1987         needed if we ever use the construct exposed by test-180.cs inside
1988         corlib, which we dont today).
1989
1990 2003-02-12  Zoltan Varga  <vargaz@freemail.hu>
1991
1992         * attribute.cs (ApplyAttributes): apply all MethodImplAttributes, not
1993         just InternalCall.
1994
1995 2003-02-09  Martin Baulig  <martin@ximian.com>
1996
1997         * namespace.cs (Namespace..ctor): Added SourceFile argument.
1998         (Namespace.DefineNamespaces): New static public method; this is
1999         called when we're compiling with debugging to add all namespaces
2000         to the symbol file.
2001
2002         * tree.cs (Tree.RecordNamespace): Added SourceFile argument and
2003         pass it to the Namespace's .ctor.
2004
2005         * symbolwriter.cs (SymbolWriter.OpenMethod): Added TypeContainer
2006         and MethodBase arguments; pass the namespace ID to the symwriter;
2007         pass the MethodBase instead of the token to the symwriter.
2008         (SymbolWriter.DefineNamespace): New method to add a namespace to
2009         the symbol file.
2010
2011 2003-02-09  Martin Baulig  <martin@ximian.com>
2012
2013         * symbolwriter.cs: New file.  This is a wrapper around
2014         ISymbolWriter with a cleaner API.  We'll dynamically Invoke()
2015         methods here in near future.
2016
2017 2003-02-09  Martin Baulig  <martin@ximian.com>
2018
2019         * codegen.cs (EmitContext.Mark): Just pass the arguments to
2020         ILGenerator.MarkSequencePoint() which are actually used by the
2021         symbol writer.
2022
2023 2003-02-09  Martin Baulig  <martin@ximian.com>
2024
2025         * location.cs (SourceFile): New public sealed class.  This
2026         contains the name and an index which is used in the location's token.
2027         (Location): Reserve an appropriate number of bits in the token for
2028         the source file instead of walking over that list, this gives us a
2029         really huge performance improvement when compiling with debugging.
2030
2031         * driver.cs (Driver.parse, Driver.tokenize_file): Take a
2032         `SourceFile' argument instead of a string.
2033         (Driver.ProcessFile): Add all the files via Location.AddFile(),
2034         but don't parse/tokenize here, we need to generate the list of all
2035         source files before we do that.
2036         (Driver.ProcessFiles): New static function.  Parses/tokenizes all
2037         the files.
2038
2039         * cs-parser.jay (CSharpParser): Take a `SourceFile' argument
2040         instead of a string.
2041
2042         * cs-tokenizer.cs (Tokenizer): Take `SourceFile' argument instead
2043         of a string.
2044
2045 2003-02-09  Martin Baulig  <martin@ximian.com>
2046
2047         * cs-tokenizer.cs (Tokenizer.PreProcessLine): Also reset the
2048         filename on `#line default'.
2049
2050 Sat Feb 8 17:03:16 CET 2003 Paolo Molaro <lupus@ximian.com>
2051
2052         * statement.cs: don't clear the pinned var when the fixed statement
2053         returns from the method (fixes bug#37752).
2054
2055 Sat Feb 8 12:58:06 CET 2003 Paolo Molaro <lupus@ximian.com>
2056
2057         * typemanager.cs: fix from mathpup@mylinuxisp.com (Marcus Urban) 
2058         to IsValueType.
2059
2060 2003-02-07  Martin Baulig  <martin@ximian.com>
2061
2062         * driver.cs: Removed the `--debug-args' command line argument.
2063
2064         * codegen.cs (CodeGen.SaveSymbols): Removed, this is now done
2065         automatically by the AsssemblyBuilder.
2066         (CodeGen.InitializeSymbolWriter): We don't need to call any
2067         initialization function on the symbol writer anymore.  This method
2068         doesn't take any arguments.
2069
2070 2003-02-03  Miguel de Icaza  <miguel@ximian.com>
2071
2072         * driver.cs: (AddAssemblyAndDeps, LoadAssembly): Enter the types
2073         from referenced assemblies as well.
2074
2075 2003-02-02  Martin Baulig  <martin@ximian.com>
2076
2077         * class.cs (MethodData.Emit): Generate debugging info for external methods.
2078
2079 2003-02-02  Martin Baulig  <martin@ximian.com>
2080
2081         * class.cs (Constructor.Emit): Open the symbol writer before
2082         emitting the constructor initializer.
2083         (ConstructorInitializer.Emit): Call ec.Mark() to allow
2084         single-stepping through constructor initializers.
2085
2086 2003-01-30  Miguel de Icaza  <miguel@ximian.com>
2087
2088         * class.cs: Handle error 549: do not allow virtual methods in
2089         sealed classes. 
2090
2091 2003-02-01 Jackson Harper <jackson@latitudegeo.com>
2092
2093         * decl.cs: Check access levels when resolving types
2094         
2095 2003-01-31 Jackson Harper <jackson@latitudegeo.com>
2096
2097         * statement.cs: Add parameters and locals set in catch blocks that might 
2098         return to set vector
2099
2100 2003-01-29  Miguel de Icaza  <miguel@ximian.com>
2101
2102         * class.cs (Operator): Set the SpecialName flags for operators.
2103         
2104         * expression.cs (Invocation.DoResolve): Only block calls to
2105         accessors and operators on SpecialName methods.
2106
2107         (Cast.TryReduce): Handle conversions from char constants.
2108
2109
2110 Tue Jan 28 17:30:57 CET 2003 Paolo Molaro <lupus@ximian.com>
2111
2112         * statement.cs: small memory and time optimization in FlowBranching.
2113         
2114 2003-01-28  Pedro Mart  <yoros@wanadoo.es>
2115
2116         * expression.cs (IndexerAccess.DoResolveLValue): Resolve the same
2117         problem that the last fix but in the other sid (Set).
2118
2119         * expression.cs (IndexerAccess.DoResolve): Fix a problem with a null
2120         access when there is no indexer in the hierarchy.
2121         
2122 2003-01-27 Jackson Harper <jackson@latitudegeo.com>
2123
2124         * class.cs: Combine some if statements.
2125
2126 2003-01-27  Gonzalo Paniagua Javier <gonzalo@ximian.com>
2127
2128         * driver.cs: fixed bug #37187.
2129
2130 2003-01-27  Pedro Martinez Juliá  <yoros@wanadoo.es>
2131
2132         * expression.cs (IndexerAccess.DoResolve): Before trying to resolve
2133         any indexer, it's needed to build a list with all the indexers in the
2134         hierarchy (AllGetters), else we have problems. Fixes #35653.
2135
2136 2003-01-23  Miguel de Icaza  <miguel@ximian.com>
2137
2138         * class.cs (MethodData.Define): It is wrong for an interface
2139         implementation to be static in both cases: explicit and implicit.
2140         We were only handling this in one case.
2141
2142         Improve the if situation there to not have negations.
2143         
2144         * class.cs (Field.Define): Turns out that we do not need to check
2145         the unsafe bit on field definition, only on usage.  Remove the test.
2146
2147 2003-01-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
2148
2149         * driver.cs: use assembly.Location instead of Codebase (the latest
2150         patch made mcs fail when using MS assemblies).
2151
2152 2003-01-21  Tim Haynes <thaynes@openlinksw.com>
2153
2154         * driver.cs: use DirectorySeparatorChar instead of a hardcoded "/" to
2155         get the path to *corlib.dll.
2156
2157 2003-01-21  Nick Drochak <ndrochak@gol.com>
2158
2159         * cs-tokenizer.cs:
2160         * pending.cs:
2161         * typemanager.cs: Remove compiler warnings
2162
2163 2003-01-20  Duncan Mak  <duncan@ximian.com>
2164
2165         * AssemblyInfo.cs: Bump the version number to 0.19.
2166         
2167 2003-01-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
2168
2169         * cs-tokenizer.cs: little fixes to line numbering when #line is used.
2170
2171 2003-01-18  Zoltan Varga  <vargaz@freemail.hu>
2172
2173         * class.cs (Constructor::Emit): Emit debugging info for constructors.
2174
2175 2003-01-17  Miguel de Icaza  <miguel@ximian.com>
2176
2177         * cs-parser.jay: Small fix: we were not comparing the constructor
2178         name correctly.   Thanks to Zoltan for the initial pointer.
2179
2180 2003-01-16 Jackson Harper <jackson@latitudegeo.com>
2181
2182         * cs-tokenizer.cs: Set file name when specified with #line
2183
2184 2003-01-15  Miguel de Icaza  <miguel@ximian.com>
2185
2186         * cs-parser.jay: Only perform the constructor checks here if we
2187         are named like the class;  This will help provider a better
2188         error.  The constructor path is taken when a type definition is
2189         not found, but most likely the user forgot to add the type, so
2190         report that rather than the constructor error.
2191
2192 Tue Jan 14 10:36:49 CET 2003 Paolo Molaro <lupus@ximian.com>
2193
2194         * class.cs, rootcontext.cs: small changes to avoid unnecessary memory
2195         allocations.
2196
2197 2003-01-13 Jackson Harper <jackson@latitudegeo.com>
2198
2199         * cs-parser.jay: Add cleanup call.
2200
2201 2003-01-13  Duncan Mak  <duncan@ximian.com>
2202
2203         * cs-tokenizer.cs (Cleanup): Rename to 'cleanup' to make it more
2204         consistent with other methods.
2205
2206 2003-01-13 Jackson Harper <jackson@latitudegeo.com>
2207
2208         * cs-tokenizer.cs: Add Cleanup method, also fix #region error messages.
2209         
2210 Sun Jan 12 19:58:42 CET 2003 Paolo Molaro <lupus@ximian.com>
2211
2212         * attribute.cs: only set GuidAttr to true when we have a
2213         GuidAttribute.
2214
2215 2003-01-09  Gonzalo Paniagua Javier <gonzalo@ximian.com>
2216
2217         * ecore.cs:
2218         * expression.cs:
2219         * typemanager.cs: fixes to allow mcs compile corlib with the new
2220         Type.IsSubclassOf fix.
2221
2222 2003-01-08  Miguel de Icaza  <miguel@ximian.com>
2223
2224         * expression.cs (LocalVariableReference.DoResolve): Classify a
2225         constant as a value, not as a variable.   Also, set the type for
2226         the variable.
2227
2228         * cs-parser.jay (fixed_statement): take a type instead of a
2229         pointer_type, so we can produce a better error message later.
2230         
2231         * statement.cs (Fixed.Resolve): Flag types that are not pointers
2232         as an error.  
2233         
2234         (For.DoEmit): Make inifinite loops have a
2235         non-conditional branch back.
2236
2237         (Fixed.DoEmit): First populate the pinned variables, then emit the
2238         statement, then clear the variables.  Before I was emitting the
2239         code once for each fixed piece.
2240
2241
2242 2003-01-08  Martin Baulig  <martin@ximian.com>
2243
2244         * statement.cs (FlowBranching.MergeChild): A break in a
2245         SWITCH_SECTION does not leave a loop.  Fixes #36155.
2246
2247 2003-01-08  Martin Baulig  <martin@ximian.com>
2248
2249         * statement.cs (FlowBranching.CheckOutParameters): `struct_params'
2250         lives in the same number space than `param_map'.  Fixes #36154.
2251
2252 2003-01-07  Miguel de Icaza  <miguel@ximian.com>
2253
2254         * cs-parser.jay (constructor_declaration): Set the
2255         Constructor.ModFlags before probing for it.  This makes the
2256         compiler report 514, 515 and 132 (the code was there, but got
2257         broken). 
2258
2259         * statement.cs (Goto.Resolve): Set `Returns' to ALWAYS.
2260         (GotoDefault.Resolve): Set `Returns' to ALWAYS.
2261         (GotoCase.Resolve): Set `Returns' to ALWAYS.
2262
2263 Tue Jan 7 18:32:24 CET 2003 Paolo Molaro <lupus@ximian.com>
2264
2265         * enum.cs: create the enum static fields using the enum type.
2266
2267 Tue Jan 7 18:23:44 CET 2003 Paolo Molaro <lupus@ximian.com>
2268
2269         * class.cs: don't try to create the ParamBuilder for the return
2270         type if it's not needed (and handle it breaking for the ms runtime
2271         anyway).
2272
2273 2003-01-06 Jackson Harper <jackson@latitudegeo.com>
2274
2275         * cs-tokenizer.cs: Add REGION flag to #region directives, and add checks to make sure that regions are being poped correctly
2276
2277 2002-12-29  Miguel de Icaza  <miguel@ximian.com>
2278
2279         * cs-tokenizer.cs (get_cmd_arg): Fixups to allow \r to terminate
2280         the command.   This showed up while compiling the JANET source
2281         code, which used \r as its only newline separator.
2282
2283 2002-12-28  Miguel de Icaza  <miguel@ximian.com>
2284
2285         * class.cs (Method.Define): If we are an operator (because it
2286         reuses our code), then set the SpecialName and HideBySig.  #36128
2287
2288 2002-12-22  Miguel de Icaza  <miguel@ximian.com>
2289
2290         * ecore.cs (FieldExpr.DoResolve): Instead of throwing an
2291         exception, report error 120 `object reference required'.
2292
2293         * driver.cs: Add --pause option, used during to measure the size
2294         of the process as it goes with --timestamp.
2295
2296         * expression.cs (Invocation.DoResolve): Do not allow methods with
2297         SpecialName to be invoked.
2298
2299 2002-12-21  Miguel de Icaza  <miguel@ximian.com>
2300
2301         * cs-tokenizer.cs: Small fix to the parser: compute the ascii
2302         number before adding it.
2303
2304 2002-12-21  Ravi Pratap  <ravi@ximian.com>
2305
2306         * ecore.cs (StandardImplicitConversion): When in an unsafe
2307         context, we allow conversion between void * to any other pointer
2308         type. This fixes bug #35973.
2309
2310 2002-12-20 Jackson Harper <jackson@latitudegeo.com>
2311
2312         * codegen.cs: Use Path.GetFileNameWithoutExtension so an exception
2313         is not thrown when extensionless outputs are used 
2314
2315 2002-12-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
2316
2317         * rootcontext.cs: fixed compilation of corlib.
2318
2319 2002-12-19  Miguel de Icaza  <miguel@ximian.com>
2320
2321         * attribute.cs (Attributes.Contains): Add new method.
2322
2323         * class.cs (MethodCore.LabelParameters): if the parameter is an
2324         `out' parameter, check that no attribute `[In]' has been passed.
2325
2326         * enum.cs: Handle the `value__' name in an enumeration.
2327
2328 2002-12-14  Jaroslaw Kowalski <jarek@atm.com.pl>
2329
2330         * decl.cs: Added special case to allow overrides on "protected
2331         internal" methods
2332         
2333 2002-12-18  Ravi Pratap  <ravi@ximian.com>
2334
2335         * attribute.cs (Attributes.AddAttributeSection): Rename to this
2336         since it makes much more sense.
2337
2338         (Attributes.ctor): Don't require a Location parameter.
2339         
2340         * rootcontext.cs (AddGlobalAttributeSection): Rename again.
2341
2342         * attribute.cs (ApplyAttributes): Remove extra Location parameters
2343         since we already have that information per attribute.
2344
2345         * everywhere : make appropriate changes.
2346
2347         * class.cs (LabelParameters): Write the code which actually
2348         applies attributes to the return type. We can't do this on the MS
2349         .NET runtime so we flag a warning in the case an exception is
2350         thrown.
2351
2352 2002-12-18  Miguel de Icaza  <miguel@ximian.com>
2353
2354         * const.cs: Handle implicit null conversions here too.
2355
2356 2002-12-17  Ravi Pratap  <ravi@ximian.com>
2357
2358         * class.cs (MethodCore.LabelParameters): Remove the extra
2359         Type [] parameter since it is completely unnecessary. Instead
2360         pass in the method's attributes so that we can extract
2361         the "return" attribute.
2362
2363 2002-12-17  Miguel de Icaza  <miguel@ximian.com>
2364
2365         * cs-parser.jay (parse): Use Report.Error to flag errors instead
2366         of ignoring it and letting the compile continue.
2367
2368         * typemanager.cs (ChangeType): use an extra argument to return an
2369         error condition instead of throwing an exception.
2370
2371 2002-12-15  Miguel de Icaza  <miguel@ximian.com>
2372
2373         * expression.cs (Unary.TryReduce): mimic the code for the regular
2374         code path.  Perform an implicit cast in the cases where we can
2375         implicitly convert to one of the integral types, and then reduce
2376         based on that constant.   This fixes bug #35483.
2377
2378 2002-12-14  Gonzalo Paniagua Javier <gonzalo@ximian.com>
2379
2380         * typemanager.cs: fixed cut & paste error in GetRemoveMethod.
2381
2382 2002-12-13  Gonzalo Paniagua Javier <gonzalo@ximian.com>
2383
2384         * namespace.cs: fixed bug #35489.
2385
2386 2002-12-12  Miguel de Icaza  <miguel@ximian.com>
2387
2388         * class.cs: Remove some dead code.
2389
2390         * cs-parser.jay: Estimate the number of methods needed
2391         (RootContext.MethodCount);
2392
2393         * cs-tokenizer.cs: Use char arrays for parsing identifiers and
2394         numbers instead of StringBuilders.
2395
2396         * support.cs (PtrHashtable): Add constructor with initial size;
2397         We can now reduce reallocations of the method table.
2398
2399 2002-12-10  Ravi Pratap  <ravi@ximian.com>
2400
2401         * attribute.cs (ApplyAttributes): Keep track of the emitted
2402         attributes on a per-target basis. This fixes bug #35413.
2403
2404 2002-12-10  Miguel de Icaza  <miguel@ximian.com>
2405
2406         * driver.cs (MainDriver): On rotor encoding 28591 does not exist,
2407         default to the Windows 1252 encoding.
2408
2409         (UnixParseOption): Support version, thanks to Alp for the missing
2410         pointer. 
2411
2412         * AssemblyInfo.cs: Add nice assembly information.
2413
2414         * cs-tokenizer.cs: Add fix from Felix to the #if/#else handler
2415         (bug 35169).
2416
2417         * cs-parser.jay: Allow a trailing comma before the close bracked
2418         in the attribute_section production.
2419
2420         * ecore.cs (FieldExpr.AddressOf): Until I figure out why the
2421         address of the instance was being taken, I will take this out,
2422         because we take the address of the object immediately here.
2423
2424 2002-12-09  Ravi Pratap  <ravi@ximian.com>
2425
2426         * typemanager.cs (AreMultipleAllowed): Take care of the most
2427         obvious case where attribute type is not in the current assembly -
2428         stupid me ;-)
2429
2430 2002-12-08  Miguel de Icaza  <miguel@ximian.com>
2431
2432         * ecore.cs (SimpleName.DoResolve): First perform lookups on using
2433         definitions, instead of doing that afterwards.  
2434
2435         Also we use a nice little hack, depending on the constructor, we
2436         know if we are a "composed" name or a simple name.  Hence, we
2437         avoid the IndexOf test, and we avoid 
2438
2439         * codegen.cs: Add code to assist in a bug reporter to track down
2440         the source of a compiler crash. 
2441
2442 2002-12-07  Ravi Pratap  <ravi@ximian.com>
2443
2444         * attribute.cs (Attribute.ApplyAttributes) : Keep track of which attribute
2445         types have been emitted for a given element and flag an error
2446         if something which does not have AllowMultiple set is used more
2447         than once.
2448
2449         * typemanager.cs (RegisterAttributeAllowMultiple): Keep track of
2450         attribute types and their corresponding AllowMultiple properties
2451
2452         (AreMultipleAllowed): Check the property for a given type.
2453
2454         * attribute.cs (Attribute.ApplyAttributes): Register the AllowMultiple
2455         property in the case we have a TypeContainer.
2456
2457         (Attributes.AddAttribute): Detect duplicates and just skip on
2458         adding them. This trivial fix catches a pretty gross error in our
2459         attribute emission - global attributes were being emitted twice!
2460
2461         Bugzilla bug #33187 is now fixed.
2462
2463 2002-12-06  Miguel de Icaza  <miguel@ximian.com>
2464
2465         * cs-tokenizer.cs (pp_expr): Properly recurse here (use pp_expr
2466         instead of pp_and).
2467
2468         * expression.cs (Binary.ResolveOperator): I can only use the
2469         Concat (string, string, string) and Concat (string, string,
2470         string, string) if the child is actually a concatenation of
2471         strings. 
2472
2473 2002-12-04  Miguel de Icaza  <miguel@ximian.com>
2474
2475         * cs-tokenizer.cs: Small fix, because decimal_digits is used in a
2476         context where we need a 2-character lookahead.
2477
2478         * pending.cs (PendingImplementation): Rework so we can keep track
2479         of interface types all the time, and flag those which were
2480         implemented by parents as optional.
2481
2482 2002-12-03  Miguel de Icaza  <miguel@ximian.com>
2483
2484         * expression.cs (Binary.ResolveOperator): Use
2485         String.Concat(string,string,string) or
2486         String.Concat(string,string,string,string) when possible. 
2487
2488         * typemanager: More helper methods.
2489
2490
2491 Tue Dec 3 19:32:04 CET 2002 Paolo Molaro <lupus@ximian.com>
2492
2493         * pending.cs: remove the bogus return from GetMissingInterfaces()
2494         (see the 2002-11-06 entry: the mono runtime is now fixed in cvs).
2495
2496 2002-12-02  Gonzalo Paniagua Javier <gonzalo@ximian.com>
2497
2498         * namespace.cs: avoid duplicated 'using xxx' being added to
2499         using_clauses. This prevents mcs from issuing and 'ambiguous type' error
2500         when we get more than one 'using' statement for the same namespace.
2501         Report a CS0105 warning for it.
2502
2503 2002-11-30  Miguel de Icaza  <miguel@ximian.com>
2504
2505         * cs-tokenizer.cs (consume_identifier): use read directly, instead
2506         of calling getChar/putback, uses internal knowledge of it.    
2507
2508         (xtoken): Reorder tokenizer so most common patterns are checked
2509         first.  This reduces the compilation time in another 5% (from 8.11s
2510         average to 7.73s for bootstrapping mcs on my Mobile p4/1.8ghz).
2511
2512         The parsing time is 22% of the compilation in mcs, and from that
2513         64% is spent on the tokenization process.  
2514
2515         I tried using a binary search for keywords, but this is slower
2516         than the hashtable.  Another option would be to do a couple of
2517         things:
2518
2519                 * Not use a StringBuilder, instead use an array of chars,
2520                   with a set value.  Notice that this way we could catch
2521                   the 645 error without having to do it *afterwards*.
2522
2523                 * We could write a hand-parser to avoid the hashtable
2524                   compares altogether.
2525
2526         The identifier consumption process takes 37% of the tokenization
2527         time.  Another 15% is spent on is_number.  56% of the time spent
2528         on is_number is spent on Int64.Parse:
2529
2530                 * We could probably choose based on the string length to
2531                   use Int32.Parse or Int64.Parse and avoid all the 64-bit
2532                   computations. 
2533
2534         Another 3% is spend on wrapping `xtoken' in the `token' function.
2535
2536         Handle 0xa0 as whitespace (#34752)
2537         
2538 2002-11-26  Miguel de Icaza  <miguel@ximian.com>
2539
2540         * typemanager.cs (IsCLRType): New routine to tell whether a type
2541         is one of the builtin types.  
2542
2543         Maybe it needs to use TypeCodes to be faster.  Maybe we could use
2544         typecode in more places instead of doing pointer comparissions.
2545         We could leverage some knowledge about the way the typecodes are
2546         laid out.
2547
2548         New code to cache namespaces in assemblies, it is currently not
2549         invoked, to be used soon.
2550
2551         * decl.cs (DeclSpace.MakeFQN): Simple optimization.
2552
2553         * expression.cs (Binary.ResolveOperator): specially handle
2554         strings, and do not perform user-defined operator overloading for
2555         built-in types.
2556
2557 2002-11-24  Miguel de Icaza  <miguel@ximian.com>
2558
2559         * cs-tokenizer.cs: Avoid calling Char.IsDigit which is an
2560         internalcall as it is a pretty simple operation;  Avoid whenever
2561         possible to call Char.IsLetter.
2562
2563         (consume_identifier): Cut by half the number of
2564         hashtable calls by merging the is_keyword and GetKeyword behavior.
2565
2566         Do not short-circuit, because if we do, we
2567         report errors (ie, #if false && true would produce an invalid
2568         directive error);
2569         
2570
2571 2002-11-24  Martin Baulig  <martin@ximian.com>
2572
2573         * expression.cs (Cast.TryReduce): If we're in checked syntax,
2574         check constant ranges and report a CS0221.  Fixes #33186.
2575
2576 2002-11-24  Martin Baulig  <martin@ximian.com>
2577
2578         * cs-parser.jay: Make this work for uninitialized variable
2579         declarations in the `for' initializer.  Fixes #32416.
2580
2581 2002-11-24  Martin Baulig  <martin@ximian.com>
2582
2583         * ecore.cs (Expression.ConvertExplicit): Make casting from/to
2584         System.Enum actually work.  Fixes bug #32269, added verify-6.cs.
2585
2586 2002-11-24  Martin Baulig  <martin@ximian.com>
2587
2588         * expression.cs (Binary.DoNumericPromotions): Added `check_user_conv'
2589         argument; if true, we also check for user-defined conversions.
2590         This is only needed if both arguments are of a user-defined type.
2591         Fixes #30443, added test-175.cs.
2592         (Binary.ForceConversion): Pass the location argument to ConvertImplicit.
2593
2594         * ecore.cs (Expression.ImplicitUserConversionExists): New method.
2595
2596 2002-11-24  Martin Baulig  <martin@ximian.com>
2597
2598         * expression.cs (ArrayAccess.GetStoreOpcode): New public static
2599         function to get the store opcode.
2600         (Invocation.EmitParams): Call ArrayAccess.GetStoreOpcode() and
2601         only emit the Ldelema if the store opcode is Stobj.  You must run
2602         both test-34 and test-167 to test this.  Fixes #34529.
2603
2604 2002-11-23  Martin Baulig  <martin@ximian.com>
2605
2606         * ecore.cs (Expression.MemberLookup): Added additional
2607         `qualifier_type' argument which is used when we're being called
2608         from MemberAccess.DoResolve() and null if we're called from a
2609         SimpleName lookup.
2610         (Expression.MemberLookupFailed): New method to report errors; this
2611         does the CS1540 check and reports the correct error message.
2612
2613         * typemanager.cs (MemberLookup): Added additional `qualifier_type'
2614         argument for the CS1540 check and redone the way how we're dealing
2615         with private members.  See the comment in the source code for details.
2616         (FilterWithClosure): Reverted this back to revision 1.197; renamed
2617         `closure_start_type' to `closure_qualifier_type' and check whether
2618         it's not null.  It was not this filter being broken, it was just
2619         being called with the wrong arguments.
2620
2621         * expression.cs (MemberAccess.DoResolve): use MemberLookupFinal()
2622         and pass it the correct `qualifier_type'; this also does the error
2623         handling for us.
2624
2625 2002-11-22  Miguel de Icaza  <miguel@ximian.com>
2626
2627         * expression.cs (Invocation.EmitParams): If the we are dealing
2628         with a non-built-in value type, load its address as well.
2629
2630         (ArrayCreation): Use a a pretty constant instead
2631         of the hardcoded value 2.   Use 6 instead of 2 for the number of
2632         static initializers.  
2633
2634         (ArrayCreation.EmitDynamicInitializers): Peel enumerations,
2635         because they are not really value types, just glorified integers. 
2636
2637         * driver.cs: Do not append .exe, the CSC compiler does not do it.
2638
2639         * ecore.cs: Remove redundant code for enumerations, make them use
2640         the same code path as everything else, fixes the casting issue
2641         with enumerations in Windows.Forms.
2642
2643         * attribute.cs: Do only cast to string if it is a string, the
2644         validation happens later.
2645
2646         * typemanager.cs: Temproary hack to avoid a bootstrap issue until
2647         people upgrade their corlibs.
2648
2649         * ecore.cs: Oops, enumerations were not following the entire code path
2650
2651 2002-11-21  Miguel de Icaza  <miguel@ximian.com>
2652
2653         * typemanager.cs (FilterWithClosure): Commented out the test for
2654         1540 in typemanager.cs, as it has problems when accessing
2655         protected methods from a parent class (see test-174.cs). 
2656
2657         * attribute.cs (Attribute.ValidateGuid): new method.
2658         (Attribute.Resolve): Use above.
2659
2660 2002-11-19  Miguel de Icaza  <miguel@ximian.com>
2661
2662         * enum.cs: In FindMembers, perform a recursive lookup for values. (34308)
2663
2664         * ecore.cs (SimpleName.SimpleNameResolve): Remove the special
2665         handling for enumerations, as we only needed the TypeContainer
2666         functionality to begin with (this is required for the fix below to
2667         work for enums that reference constants in a container class for
2668         example). 
2669
2670         * codegen.cs (EmitContext): Make TypeContainer a DeclSpace.
2671
2672         * enum.cs (Enum.Define): Use `this' instead of parent, so we have
2673         a valid TypeBuilder to perform lookups on.o
2674
2675         * class.cs (InheritableMemberSignatureCompare): Use true in the
2676         call to GetGetMethod and GetSetMethod, because we are comparing
2677         the signature, and we need to get the methods *even* if they are
2678         private. 
2679
2680         (PropertyBase.CheckBase): ditto.
2681
2682         * statement.cs (Switch.ResolveAndReduce, Block.EmitMeta,
2683         GotoCase.Resolve): Use Peel on EmpytCasts.
2684
2685         * ecore.cs (EmptyCast): drop child, add Peel method.
2686
2687 2002-11-17  Martin Baulig  <martin@ximian.com>
2688
2689         * ecore.cs (EmptyCast.Child): New public property.
2690
2691         * statement.cs (SwitchLabel.ResolveAndReduce): Check whether the
2692         label resolved to an EmptyCast.  Fixes #34162.
2693         (GotoCase.Resolve): Likewise.
2694         (Block.EmitMeta): Likewise.
2695
2696 2002-11-17  Martin Baulig  <martin@ximian.com>
2697
2698         * expression.cs (Invocation.BetterConversion): Prefer int over
2699         uint; short over ushort; long over ulong for integer literals.
2700         Use ImplicitConversionExists instead of StandardConversionExists
2701         since we also need to check for user-defined implicit conversions.
2702         Fixes #34165.  Added test-173.cs.
2703
2704 2002-11-16  Martin Baulig  <martin@ximian.com>
2705
2706         * expression.cs (Binary.EmitBranchable): Eliminate comparisions
2707         with the `true' and `false' literals.  Fixes #33151.
2708
2709 2002-11-16  Martin Baulig  <martin@ximian.com>
2710
2711         * typemanager.cs (RealMemberLookup): Reverted Miguel's patch from
2712         October 22nd; don't do the cs1540 check for static members.
2713
2714         * ecore.cs (PropertyExpr.ResolveAccessors): Rewrote this; we're
2715         now using our own filter here and doing the cs1540 check again.
2716
2717 2002-11-16  Martin Baulig  <martin@ximian.com>
2718
2719         * support.cs (InternalParameters): Don't crash if we don't have
2720         any fixed parameters.  Fixes #33532.
2721
2722 2002-11-16  Martin Baulig  <martin@ximian.com>
2723
2724         * decl.cs (MemberCache.AddMethods): Use BindingFlags.FlattenHierarchy
2725         when looking up static methods to make this work on Windows.
2726         Fixes #33773.
2727
2728 2002-11-16  Martin Baulig  <martin@ximian.com>
2729
2730         * ecore.cs (PropertyExpr.VerifyAssignable): Check whether we have
2731         a setter rather than using PropertyInfo.CanWrite.
2732
2733 2002-11-15  Nick Drochak  <ndrochak@gol.com>
2734
2735         * class.cs: Allow acces to block member by subclasses. Fixes build
2736         breaker.
2737
2738 2002-11-14  Martin Baulig  <martin@ximian.com>
2739
2740         * class.cs (Constructor.Emit): Added the extern/block check.
2741         Fixes bug #33678.
2742
2743 2002-11-14  Martin Baulig  <martin@ximian.com>
2744
2745         * expression.cs (IndexerAccess.DoResolve): Do a DeclaredOnly
2746         iteration while looking for indexers, this is needed because the
2747         indexer may have a different name in our base classes.  Fixed the
2748         error reporting (no indexers at all, not get accessor, no
2749         overloaded match).  Fixes bug #33089.
2750         (IndexerAccess.DoResolveLValue): Likewise.
2751
2752 2002-11-14  Martin Baulig  <martin@ximian.com>
2753
2754         * class.cs (PropertyBase.CheckBase): Make this work for multiple
2755         indexers.  Fixes the first part of bug #33089.
2756         (MethodSignature.InheritableMemberSignatureCompare): Added support
2757         for properties.
2758
2759 2002-11-13  Ravi Pratap  <ravi@ximian.com>
2760
2761         * attribute.cs (Attribute.Resolve): Catch the
2762         NullReferenceException and report it since it isn't supposed to
2763         happen. 
2764         
2765 2002-11-12  Miguel de Icaza  <miguel@ximian.com>
2766
2767         * expression.cs (Binary.EmitBranchable): Also handle the cases for
2768         LogicalOr and LogicalAnd that can benefit from recursively
2769         handling EmitBranchable.  The code now should be nice for Paolo.
2770
2771 2002-11-08  Miguel de Icaza  <miguel@ximian.com>
2772
2773         * typemanager.cs (LookupType): Added a negative-hit hashtable for
2774         the Type lookups, as we perform quite a number of lookups on
2775         non-Types.  This can be removed once we can deterministically tell
2776         whether we have a type or a namespace in advance.
2777
2778         But this might require special hacks from our corlib.
2779
2780         * TODO: updated.
2781
2782         * ecore.cs (TryImplicitIntConversion): Handle conversions to float
2783         and double which avoids a conversion from an integer to a double.
2784
2785         * expression.cs: tiny optimization, avoid calling IsConstant,
2786         because it effectively performs the lookup twice.
2787
2788 2002-11-06  Miguel de Icaza  <miguel@ximian.com>
2789
2790         But a bogus return here to keep the semantics of the old code
2791         until the Mono runtime is fixed.
2792         
2793         * pending.cs (GetMissingInterfaces): New method used to remove all
2794         the interfaces that are already implemented by our parent
2795         classes from the list of pending methods. 
2796
2797         * interface.cs: Add checks for calls after ResolveTypeExpr.
2798
2799 2002-11-05  Miguel de Icaza  <miguel@ximian.com>
2800
2801         * class.cs (Class.Emit): Report warning 67: event not used if the
2802         warning level is beyond 3.
2803
2804         * ecore.cs (Expression.ConvertExplicit): Missed a check for expr
2805         being a NullLiteral.
2806
2807         * cs-parser.jay: Fix, Gonzalo reverted the order of the rank
2808         specifiers. 
2809
2810         * class.cs (TypeContainer.GetClassBases): Cover a missing code
2811         path that might fail if a type can not be resolved.
2812
2813         * expression.cs (Binary.Emit): Emit unsigned versions of the
2814         operators. 
2815
2816         * driver.cs: use error 5.
2817         
2818 2002-11-02  Gonzalo Paniagua Javier <gonzalo@gnome-db.org>
2819
2820         * cs-parser.jay: simplified a rule and 5 SR conflicts dissapeared.
2821
2822 2002-11-01  Miguel de Icaza  <miguel@ximian.com>
2823
2824         * cs-parser.jay (switch_section): A beautiful patch from Martin
2825         Baulig that fixed 33094.
2826
2827 2002-10-31  Miguel de Icaza  <miguel@ximian.com>
2828
2829         * ecore.cs (PropertyExpr.DoResolveLValue, PropertyExpr.DoResolve):
2830         Check whether the base is abstract and report an error if so.
2831
2832         * expression.cs (IndexerAccess.DoResolveLValue,
2833         IndexerAccess.DoResolve): ditto. 
2834
2835         (Invocation.DoResolve): ditto.
2836         
2837         (Invocation.FullMethodDesc): Improve the report string.
2838
2839         * statement.cs (Block): Eliminate IsVariableDefined as it is
2840         basically just a wrapper for GetVariableInfo.
2841
2842         * ecore.cs (SimpleName): Use new 
2843
2844         * support.cs (ReflectionParamter.ParameterType): We unwrap the
2845         type, as we return the actual parameter ref/unref state on a
2846         different call.
2847
2848 2002-10-30  Miguel de Icaza  <miguel@ximian.com>
2849
2850         * support.cs: Return proper flags REF/OUT fixing the previous
2851         commit.  
2852
2853         * expression.cs: Reverted last patch, that was wrong.  Is_ref is
2854         not used to mean `ref' but `ref or out' in ParameterReference
2855         
2856         * delegate.cs (FullDelegateDesc): use ParameterDesc to get the
2857         full type signature instead of calling TypeManger.CSharpName
2858         ourselves. 
2859
2860         * support.cs (InternalParameters.ParameterDesc): Do not compare
2861         directly to the modflags, because REF/OUT will actually be bitsets
2862         if set. 
2863
2864         * delegate.cs (VerifyMethod): Check also the modifiers.
2865
2866         * cs-tokenizer.cs: Fix bug where floating point values with an
2867         exponent where a sign was missing was ignored.
2868
2869         * driver.cs: Allow multiple assemblies to be specified in a single
2870         /r: argument
2871
2872 2002-10-28  Miguel de Icaza  <miguel@ximian.com>
2873
2874         * cs-parser.jay: Ugly.  We had to add a multiplicative_expression,
2875         because identifiers after a parenthesis would end up in this kind
2876         of production, and we needed to desamiguate it for having casts
2877         like:
2878
2879                 (UserDefinedType *) xxx
2880
2881 2002-10-24  Miguel de Icaza  <miguel@ximian.com>
2882
2883         * typemanager.cs (RealMemberLookup): when we deal with a subclass,
2884         we should set on the Bindingflags.NonPublic, but not turn on
2885         private_ok.  private_ok controls whether a Private member is
2886         returned (this is chekced on the filter routine), while the
2887         BindingFlags.NonPublic just controls whether private/protected
2888         will be allowed.   This fixes the problem part of the problem of
2889         private properties being allowed to be used in derived classes.
2890
2891         * expression.cs (BaseAccess): Provide an DoResolveLValue method,
2892         so we can call the children DoResolveLValue method (this will
2893         properly signal errors on lvalue assignments to base properties)
2894         
2895         * ecore.cs (PropertyExpr.ResolveAccessors): If both setter and
2896         getter are null, and we have a property info, we know that this
2897         happened because the lookup failed, so we report an error 122 for
2898         protection level violation.
2899
2900         We also silently return if setter and getter are null in the
2901         resolve functions, this condition only happens if we have flagged
2902         the error before.  This is the other half of the problem. 
2903
2904         (PropertyExpr.ResolveAccessors): Turns out that PropertyInfo does
2905         not have accessibility information, that is why we were returning
2906         true in the filter function in typemanager.cs.
2907
2908         To properly report 122 (property is inaccessible because of its
2909         protection level) correctly, we report this error in ResolveAccess
2910         by failing if both the setter and the getter are lacking (ie, the
2911         lookup failed). 
2912
2913         DoResolve and DoLResolve have been modified to check for both
2914         setter/getter being null and returning silently, the reason being
2915         that I did not want to put the knowledge about this error in upper
2916         layers, like:
2917
2918         int old = Report.Errors;
2919         x = new PropertyExpr (...);
2920         if (old != Report.Errors)
2921                 return null;
2922         else
2923                 return x;
2924
2925         So the property expr is returned, but it is invalid, so the error
2926         will be flagged during the resolve process. 
2927
2928         * class.cs: Remove InheritablePropertySignatureCompare from the
2929         class, as we no longer depend on the property signature to compute
2930         whether it is possible to implement a method or not.
2931
2932         The reason is that calling PropertyInfo.GetGetMethod will return
2933         null (in .NET, in Mono it works, and we should change this), in
2934         cases where the Get Method does not exist in that particular
2935         class.
2936
2937         So this code:
2938
2939         class X { public virtual int A { get { return 1; } } }
2940         class Y : X { }
2941         class Z : Y { public override int A { get { return 2; } } }
2942
2943         Would fail in Z because the parent (Y) would not have the property
2944         defined.  So we avoid this completely now (because the alternative
2945         fix was ugly and slow), and we now depend exclusively on the
2946         method names.
2947
2948         (PropertyBase.CheckBase): Use a method-base mechanism to find our
2949         reference method, instead of using the property.
2950
2951         * typemanager.cs (GetPropertyGetter, GetPropertySetter): These
2952         routines are gone now.
2953
2954         * typemanager.cs (GetPropertyGetter, GetPropertySetter): swap the
2955         names, they were incorrectly named.
2956
2957         * cs-tokenizer.cs: Return are more gentle token on failure. 
2958
2959         * pending.cs (PendingImplementation.InterfaceMethod): This routine
2960         had an out-of-sync index variable, which caused it to remove from
2961         the list of pending methods the wrong method sometimes.
2962
2963 2002-10-22  Miguel de Icaza  <miguel@ximian.com>
2964
2965         * ecore.cs (PropertyExpr): Do not use PropertyInfo.CanRead,
2966         CanWrite, because those refer to this particular instance of the
2967         property, and do not take into account the fact that we can
2968         override single members of a property.
2969
2970         Constructor requires an EmitContext.  The resolution process does
2971         not happen here, but we need to compute the accessors before,
2972         because the resolution does not always happen for properties.
2973         
2974         * typemanager.cs (RealMemberLookup): Set private_ok if we are a
2975         subclass, before we did not update this flag, but we did update
2976         bindingflags. 
2977
2978         (GetAccessors): Drop this routine, as it did not work in the
2979         presence of partially overwritten set/get methods. 
2980
2981         Notice that this broke the cs1540 detection, but that will require
2982         more thinking. 
2983         
2984 2002-10-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
2985
2986         * class.cs:
2987         * codegen.cs:
2988         * driver.cs: issue a warning instead of an error if we don't support
2989         debugging for the platform. Also ignore a couple of errors that may
2990         arise when trying to write the symbols. Undo my previous patch.
2991
2992 2002-10-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
2993
2994         * driver.cs: ignore /debug switch except for Unix platforms.
2995
2996 2002-10-23  Nick Drochak  <ndrochak@gol.com>
2997
2998         * makefile: Remove mcs2.exe and mcs3.exe on 'make clean'
2999
3000 2002-10-21  Miguel de Icaza  <miguel@ximian.com>
3001
3002         * driver.cs: Do not make mcs-debug conditional, so we do not break
3003         builds that use it.
3004
3005         * statement.cs (UsageVector.MergeChildren): I would like Martin to
3006         review this patch.  But basically after all the children variables
3007         have been merged, the value of "Breaks" was not being set to
3008         new_breaks for Switch blocks.  I think that it should be set after
3009         it has executed.  Currently I set this to the value of new_breaks,
3010         but only if new_breaks is FlowReturn.ALWAYS, which is a bit
3011         conservative, but I do not understand this code very well.
3012
3013         I did not break anything in the build, so that is good ;-)
3014
3015         * cs-tokenizer.cs: Also allow \r in comments as a line separator.
3016
3017 2002-10-20  Mark Crichton  <crichton@gimp.org>
3018
3019         * cfold.cs: Fixed compile blocker.  Really fixed it this time.
3020
3021 2002-10-20  Nick Drochak  <ndrochak@gol.com>
3022
3023         * cfold.cs: Fixed compile blocker.
3024
3025 2002-10-20  Miguel de Icaza  <miguel@ximian.com>
3026
3027         * driver.cs: I was chekcing the key, not the file.
3028
3029 2002-10-19  Ravi Pratap  <ravi@ximian.com>
3030
3031         * ecore.cs (UserDefinedConversion): Get rid of the bogus error
3032         message that we were generating - we just need to silently return
3033         a null.
3034
3035 2002-10-19  Miguel de Icaza  <miguel@ximian.com>
3036
3037         * class.cs (Event.Define): Change my previous commit, as this
3038         breaks the debugger.  This is a temporary hack, as it seems like
3039         the compiler is generating events incorrectly to begin with.
3040
3041         * expression.cs (Binary.ResolveOperator): Added support for 
3042         "U operator - (E x, E y)"
3043
3044         * cfold.cs (BinaryFold): Added support for "U operator - (E x, E
3045         y)".
3046
3047         * ecore.cs (FieldExpr.AddressOf): We had a special code path for
3048         init-only variables, but this path did not take into account that
3049         there might be also instance readonly variables.  Correct this
3050         problem. 
3051
3052         This fixes bug 32253
3053
3054         * delegate.cs (NewDelegate.DoResolve): Catch creation of unsafe
3055         delegates as well.
3056
3057         * driver.cs: Change the extension for modules to `netmodule'
3058
3059         * cs-parser.jay: Improved slightly the location tracking for
3060         the debugger symbols.
3061
3062         * class.cs (Event.Define): Use Modifiers.FieldAttr on the
3063         modifiers that were specified instead of the hardcoded value
3064         (FamAndAssem).  This was basically ignoring the static modifier,
3065         and others.  Fixes 32429.
3066
3067         * statement.cs (Switch.SimpleSwitchEmit): Simplified the code, and
3068         fixed a bug in the process (32476)
3069
3070         * expression.cs (ArrayAccess.EmitAssign): Patch from
3071         hwang_rob@yahoo.ca that fixes bug 31834.3
3072
3073 2002-10-18  Miguel de Icaza  <miguel@ximian.com>
3074
3075         * driver.cs: Make the module extension .netmodule.
3076
3077 2002-10-16  Miguel de Icaza  <miguel@ximian.com>
3078
3079         * driver.cs: Report an error if the resource file is not found
3080         instead of crashing.
3081
3082         * ecore.cs (PropertyExpr.EmitAssign): Pass IsBase instead of
3083         false, like Emit does.
3084
3085 2002-10-16  Nick Drochak  <ndrochak@gol.com>
3086
3087         * typemanager.cs: Remove unused private member.  Also reported mcs
3088         bug to report this as a warning like csc.
3089
3090 2002-10-15  Martin Baulig  <martin@gnome.org>
3091
3092         * statement.cs (Statement.Emit): Made this a virtual method; emits
3093         the line number info and calls DoEmit().
3094         (Statement.DoEmit): New protected abstract method, formerly knows
3095         as Statement.Emit().
3096
3097         * codegen.cs (EmitContext.Mark): Check whether we have a symbol writer.
3098
3099 2002-10-11  Miguel de Icaza  <miguel@ximian.com>
3100
3101         * class.cs: Following the comment from 2002-09-26 to AddMethod, I
3102         have fixed a remaining problem: not every AddXXXX was adding a
3103         fully qualified name.  
3104
3105         Now everyone registers a fully qualified name in the DeclSpace as
3106         being defined instead of the partial name.  
3107
3108         Downsides: we are slower than we need to be due to the excess
3109         copies and the names being registered this way.  
3110
3111         The reason for this is that we currently depend (on the corlib
3112         bootstrap for instance) that types are fully qualified, because
3113         we dump all the types in the namespace, and we should really have
3114         types inserted into the proper namespace, so we can only store the
3115         basenames in the defined_names array.
3116
3117 2002-10-10  Martin Baulig  <martin@gnome.org>
3118
3119         * expression.cs (ArrayAccess.EmitStoreOpcode): Reverted the patch
3120         from bug #31834, see the bug report for a testcase which is
3121         miscompiled.
3122
3123 2002-10-10  Martin Baulig  <martin@gnome.org>
3124
3125         * codegen.cs (EmitContext.Breaks): Removed, we're now using the
3126         flow analysis code for this.
3127
3128         * statement.cs (Do, While, For): Tell the flow analysis code about
3129         infinite loops.
3130         (FlowBranching.UsageVector): Added support for infinite loops.
3131         (Block.Resolve): Moved the dead code elimination here and use flow
3132         analysis to do it.
3133
3134 2002-10-09  Miguel de Icaza  <miguel@ximian.com>
3135
3136         * class.cs (Field.Define): Catch cycles on struct type
3137         definitions. 
3138
3139         * typemanager.cs (IsUnmanagedtype): Do not recursively check
3140         fields if the fields are static.  We only need to check instance
3141         fields. 
3142
3143         * expression.cs (As.DoResolve): Test for reference type.
3144
3145         * statement.cs (Using.ResolveExpression): Use
3146         ConvertImplicitRequired, not ConvertImplicit which reports an
3147         error on failture
3148         (Using.ResolveLocalVariableDecls): ditto.
3149
3150         * expression.cs (Binary.ResolveOperator): Report errors in a few
3151         places where we had to.
3152
3153         * typemanager.cs (IsUnmanagedtype): Finish implementation.
3154
3155 2002-10-08  Miguel de Icaza  <miguel@ximian.com>
3156
3157         * expression.cs: Use StoreFromPtr instead of extracting the type
3158         and then trying to use Stelem.  Patch is from hwang_rob@yahoo.ca
3159
3160         * ecore.cs (ImplicitReferenceConversion): It is possible to assign
3161         an enumeration value to a System.Enum, but System.Enum is not a
3162         value type, but an class type, so we need to box.
3163
3164         (Expression.ConvertExplicit): One codepath could return
3165         errors but not flag them.  Fix this.  Fixes #31853
3166
3167         * parameter.cs (Resolve): Do not allow void as a parameter type.
3168
3169 2002-10-06  Martin Baulig  <martin@gnome.org>
3170
3171         * statemenc.cs (FlowBranching.SetParameterAssigned): Don't crash
3172         if it's a class type and not a struct.  Fixes #31815.
3173
3174 2002-10-06  Martin Baulig  <martin@gnome.org>
3175
3176         * statement.cs: Reworked the flow analysis code a bit to make it
3177         usable for dead code elimination.
3178
3179 2002-10-06  Gonzalo Paniagua Javier <gonzalo@ximian.com>
3180
3181         * cs-parser.jay: allow empty source files. Fixes bug #31781.
3182
3183 2002-10-04  Miguel de Icaza  <miguel@ximian.com>
3184
3185         * expression.cs (ComposedCast.DoResolveType): A quick workaround
3186         to fix the test 165, will investigate deeper.
3187
3188 2002-10-04  Martin Baulig  <martin@gnome.org>
3189
3190         * statement.cs (FlowBranching.UsageVector.MergeChildren): Make
3191         finally blocks actually work.
3192         (Try.Resolve): We don't need to create a sibling for `finally' if
3193         there is no finally block.
3194
3195 2002-10-04  Martin Baulig  <martin@gnome.org>
3196
3197         * class.cs (Constructor.Define): The default accessibility for a
3198         non-default constructor is private, not public.
3199
3200 2002-10-04  Miguel de Icaza  <miguel@ximian.com>
3201
3202         * class.cs (Constructor): Make AllowedModifiers public, add
3203         EXTERN.
3204
3205         * cs-parser.jay: Perform the modifiers test here, as the
3206         constructor for the Constructor class usually receives a zero
3207         because of the way we create it (first we create, later we
3208         customize, and we were never checking the modifiers).
3209
3210         * typemanager.cs (Typemanager.LookupTypeDirect): This new function
3211         is a version of LookupTypeReflection that includes the type-name
3212         cache.  This can be used as a fast path for functions that know
3213         the fully qualified name and are only calling into *.GetType() to
3214         obtain a composed type.
3215
3216         This is also used by TypeManager.LookupType during its type
3217         composition.
3218
3219         (LookupType): We now also track the real type name, as sometimes
3220         we can get a quey for the real type name from things like
3221         ComposedCast.  This fixes bug 31422.
3222         
3223         * expression.cs (ComposedCast.Resolve): Since we are obtaining a
3224         complete type fullname, it does not have to go through the type
3225         resolution system to obtain the composed version of the type (for
3226         obtaining arrays or pointers).
3227         
3228         (Conditional.Emit): Use the EmitBoolExpression to
3229         generate nicer code, as requested by Paolo.
3230
3231         (ArrayCreation.CheckIndices): Use the patch from
3232         hwang_rob@yahoo.ca to validate the array initializers. 
3233
3234 2002-10-03  Miguel de Icaza  <miguel@ximian.com>
3235
3236         * class.cs (ConstructorInitializer.Emit): simplify code by using
3237         Invocation.EmitCall, and at the same time, fix the bugs in calling
3238         parent constructors that took variable arguments. 
3239
3240         * ecore.cs (Expression.ConvertNumericExplicit,
3241         Expression.ImplicitNumericConversion): Remove the code that
3242         manually wrapped decimal (InternalTypeConstructor call is now gone
3243         as well).
3244
3245         * expression.cs (Cast.TryReduce): Also handle decimal types when
3246         trying to perform a constant fold on the type.
3247
3248         * typemanager.cs (IsUnmanagedtype): Partially implemented.
3249
3250         * parameter.cs: Removed ResolveAndDefine, as it was not needed, as
3251         that only turned off an error report, and did nothing else. 
3252
3253 2002-10-02  Miguel de Icaza  <miguel@ximian.com>
3254
3255         * driver.cs: Handle and ignore /fullpaths
3256
3257 2002-10-01  Miguel de Icaza  <miguel@ximian.com>
3258
3259         * expression.cs (Binary.ResolveOperator): Catch the case where
3260         DoNumericPromotions returns true, 
3261
3262         (Binary.DoNumericPromotions): Simplify the code, and the tests.
3263
3264 2002-09-27  Miguel de Icaza  <miguel@ximian.com>
3265
3266         * ecore.cs (EventExpr.Emit): Instead of emitting an exception,
3267         report error 70.
3268
3269 2002-09-26  Miguel de Icaza  <miguel@ximian.com>
3270
3271         * ecore.cs (ConvertNumericExplicit): It is not enough that the
3272         conversion exists, but it is also required that the conversion be
3273         performed.  This manifested in "(Type64Enum) 2".  
3274
3275         * class.cs (TypeManager.AddMethod): The fix is not to change
3276         AddEnum, because that one was using a fully qualified name (every
3277         DeclSpace derivative does), but to change the AddMethod routine
3278         that was using an un-namespaced name.  This now correctly reports
3279         the duplicated name.
3280
3281         Revert patch until I can properly fix it.  The issue
3282         is that we have a shared Type space across all namespaces
3283         currently, which is wrong.
3284
3285         Options include making the Namespace a DeclSpace, and merge
3286         current_namespace/current_container in the parser.
3287
3288 2002-09-25  Miguel de Icaza  <miguel@ximian.com>
3289
3290         * cs-parser.jay: Improve error reporting when we get a different
3291         kind of expression in local_variable_type and
3292         local_variable_pointer_type. 
3293
3294         Propagate this to avoid missleading errors being reported.
3295
3296         * ecore.cs (ImplicitReferenceConversion): treat
3297         TypeManager.value_type as a target just like object_type.   As
3298         code like this:
3299
3300         ValueType v = 1;
3301
3302         Is valid, and needs to result in the int 1 being boxed before it
3303         is assigned to the value type v.
3304
3305         * class.cs (TypeContainer.AddEnum): Use the basename, not the name
3306         to validate the enumeration name.
3307
3308         * expression.cs (ArrayAccess.EmitAssign): Mimic the same test from
3309         EmitDynamicInitializers for the criteria to use Ldelema.  Thanks
3310         to hwang_rob@yahoo.ca for finding the bug and providing a patch.
3311
3312         * ecore.cs (TryImplicitIntConversion): When doing an
3313         implicit-enumeration-conversion, check if the type is 64-bits and
3314         perform a conversion before passing to EnumConstant.
3315
3316 2002-09-23  Miguel de Icaza  <miguel@ximian.com>
3317
3318         * decl.cs (Error_AmbiguousTypeReference); New routine used to
3319         report ambiguous type references.  Unlike the MS version, we
3320         report what the ambiguity is.   Innovation at work ;-)
3321
3322         (DeclSpace.FindType): Require a location argument to
3323         display when we display an ambiguous error.
3324
3325         * ecore.cs: (SimpleName.DoResolveType): Pass location to FindType.
3326
3327         * interface.cs (GetInterfaceTypeByName): Pass location to FindType.
3328
3329         * expression.cs (EmitDynamicInitializers): Apply patch from
3330         hwang_rob@yahoo.ca that fixes the order in which we emit our
3331         initializers. 
3332
3333 2002-09-21  Martin Baulig  <martin@gnome.org>
3334
3335         * delegate.cs (Delegate.VerifyApplicability): Make this work if the
3336         delegate takes no arguments.
3337
3338 2002-09-20  Miguel de Icaza  <miguel@ximian.com>
3339
3340         * constant.cs: Use Conv_U8 instead of Conv_I8 when loading longs
3341         from integers.
3342
3343         * expression.cs: Extract the underlying type.
3344
3345         * ecore.cs (StoreFromPtr): Use TypeManager.IsEnumType instad of IsEnum
3346
3347         * decl.cs (FindType): Sorry about this, fixed the type lookup bug.
3348
3349 2002-09-19  Miguel de Icaza  <miguel@ximian.com>
3350
3351         * class.cs (TypeContainer.DefineType): We can not use the nice
3352         PackingSize with the size set to 1 DefineType method, because it
3353         will not allow us to define the interfaces that the struct
3354         implements.
3355
3356         This completes the fixing of bug 27287
3357
3358         * ecore.cs (Expresion.ImplicitReferenceConversion): `class-type S'
3359         means also structs.  This fixes part of the problem. 
3360         (Expresion.ImplicitReferenceConversionExists): ditto.
3361
3362         * decl.cs (DeclSparce.ResolveType): Only report the type-not-found
3363         error if there were no errors reported during the type lookup
3364         process, to avoid duplicates or redundant errors.  Without this
3365         you would get an ambiguous errors plus a type not found.  We have
3366         beaten the user enough with the first error.  
3367
3368         (DeclSparce.FindType): Emit a warning if we have an ambiguous
3369         reference. 
3370
3371         * ecore.cs (SimpleName.DoResolveType): If an error is emitted
3372         during the resolution process, stop the lookup, this avoids
3373         repeated error reports (same error twice).
3374
3375         * rootcontext.cs: Emit a warning if we have an ambiguous reference.
3376
3377         * typemanager.cs (LookupType): Redo the type lookup code to match
3378         the needs of System.Reflection.  
3379
3380         The issue is that System.Reflection requires references to nested
3381         types to begin with a "+" sign instead of a dot.  So toplevel
3382         types look like: "NameSpace.TopLevelClass", and nested ones look
3383         like "Namespace.TopLevelClass+Nested", with arbitrary nesting
3384         levels. 
3385
3386 2002-09-19  Martin Baulig  <martin@gnome.org>
3387
3388         * codegen.cs (EmitContext.EmitTopBlock): If control flow analysis
3389         says that a method always returns or always throws an exception,
3390         don't report the CS0161.
3391
3392         * statement.cs (FlowBranching.UsageVector.MergeChildren): Always
3393         set `Returns = new_returns'.
3394
3395 2002-09-19  Martin Baulig  <martin@gnome.org>
3396
3397         * expression.cs (MemberAccess.ResolveMemberAccess): When resolving
3398         to an enum constant, check for a CS0176.
3399
3400 2002-09-18  Miguel de Icaza  <miguel@ximian.com>
3401
3402         * class.cs (TypeContainer.CheckPairedOperators): Now we check
3403         for operators that must be in pairs and report errors.
3404
3405         * ecore.cs (SimpleName.DoResolveType): During the initial type
3406         resolution process, when we define types recursively, we must
3407         check first for types in our current scope before we perform
3408         lookups in the enclosing scopes.
3409
3410         * expression.cs (MakeByteBlob): Handle Decimal blobs.
3411
3412         (Invocation.VerifyArgumentsCompat): Call
3413         TypeManager.TypeToCoreType on the parameter_type.GetElementType.
3414         I thought we were supposed to always call this, but there are a
3415         few places in the code where we dont do it.
3416
3417 2002-09-17  Miguel de Icaza  <miguel@ximian.com>
3418
3419         * driver.cs: Add support in -linkres and -resource to specify the
3420         name of the identifier.
3421
3422 2002-09-16  Miguel de Icaza  <miguel@ximian.com>
3423
3424         * ecore.cs (StandardConversionExists): Sync with the conversion
3425         code: allow anything-* to void* conversions.
3426
3427         (FindMostSpecificSource): Use an Expression argument
3428         instead of a Type, because we might be handed over a Literal which
3429         gets a few more implicit conversions that plain types do not.  So
3430         this information was being lost.
3431
3432         Also, we drop the temporary type-holder expression when not
3433         required.
3434
3435 2002-09-17  Martin Baulig  <martin@gnome.org>
3436
3437         * class.cs (PropertyBase.CheckBase): Don't check the base class if
3438         this is an explicit interface implementation.
3439
3440 2002-09-17  Martin Baulig  <martin@gnome.org>
3441
3442         * class.cs (PropertyBase.CheckBase): Make this work for indexers with
3443         different `IndexerName' attributes.
3444
3445         * expression.cs (BaseIndexerAccess): Rewrote this class to use IndexerAccess.
3446         (IndexerAccess): Added special protected ctor for BaseIndexerAccess and
3447         virtual CommonResolve().
3448
3449 2002-09-16  Miguel de Icaza  <miguel@ximian.com>
3450
3451         * enum.cs (LookupEnumValue): Use the EnumConstant declared type,
3452         and convert that to the UnderlyingType.
3453
3454         * statement.cs (Foreach.Resolve): Indexers are just like variables
3455         or PropertyAccesses.
3456
3457         * cs-tokenizer.cs (consume_string): Track line numbers and columns
3458         inside quoted strings, we were not doing this before.
3459
3460 2002-09-16  Martin Baulig  <martin@gnome.org>
3461
3462         * ecore.cs (MethodGroupExpr.DoResolve): If we have an instance expression,
3463         resolve it.  This is needed for the definite assignment check of the
3464         instance expression, fixes bug #29846.
3465         (PropertyExpr.DoResolve, EventExpr.DoResolve): Likewise.
3466
3467 2002-09-16  Nick Drochak  <ndrochak@gol.com>
3468
3469         * parameter.cs: Fix compile error.  Cannot reference static member
3470         from an instance object.  Is this an mcs bug?
3471
3472 2002-09-14  Martin Baulig  <martin@gnome.org>
3473
3474         * decl.cs (MemberCache.SetupCacheForInterface): Don't add an interface
3475         multiple times.  Fixes bug #30295, added test-166.cs.
3476
3477 2002-09-14  Martin Baulig  <martin@gnome.org>
3478
3479         * statement.cs (Block.Emit): Don't emit unreachable code.
3480         (Switch.SimpleSwitchEmit, Switch.TableSwitchEmit): Check for missing
3481         `break' statements.
3482         (Goto.Emit, Continue.Emit): Set ec.Breaks = true.
3483
3484 2002-09-14  Martin Baulig  <martin@gnome.org>
3485
3486         * parameter.cs (Parameter.Attributes): Make this work if Modifier.ISBYREF
3487         is set.
3488
3489 2002-09-14  Martin Baulig  <martin@gnome.org>
3490
3491         * typemanager.cs (TypeManager.IsNestedChildOf): This must return false
3492         if `type == parent' since in this case `type.IsSubclassOf (parent)' will
3493         be false on the ms runtime.
3494
3495 2002-09-13  Martin Baulig  <martin@gnome.org>
3496
3497         * ecore.cs (SimpleName.SimpleNameResolve): Include the member name in
3498         the CS0038 error message.
3499
3500 2002-09-12  Miguel de Icaza  <miguel@ximian.com>
3501
3502         * expression.cs (CheckedExpr, UnCheckedExpr): If we have a
3503         constant inside, return it.
3504
3505 2002-09-12  Martin Baulig  <martin@gnome.org>
3506
3507         * cfold.cs (ConstantFold.DoConstantNumericPromotions): Check whether an
3508         implicit conversion can be done between enum types.
3509
3510         * enum.cs (Enum.LookupEnumValue): If the value is an EnumConstant,
3511         check whether an implicit conversion to the current enum's UnderlyingType
3512         exists and report an error if not.
3513
3514         * codegen.cs (CodeGen.Init): Delete the symbol file when compiling
3515         without debugging support.
3516
3517         * delegate.cs (Delegate.CloseDelegate): Removed, use CloseType instead.
3518         Fixes bug #30235.  Thanks to Ricardo Fernández Pascual.
3519
3520 2002-09-12  Martin Baulig  <martin@gnome.org>
3521
3522         * typemanager.cs (TypeManager.IsNestedChildOf): New method.
3523
3524         * ecore.cs (IMemberExpr.DeclaringType): New property.
3525         (SimpleName.SimpleNameResolve): Check whether we're accessing a
3526         nonstatic member of an outer type (CS0038).
3527
3528 2002-09-11  Miguel de Icaza  <miguel@ximian.com>
3529
3530         * driver.cs: Activate the using-error detector at warning level
3531         4 (at least for MS-compatible APIs).
3532
3533         * namespace.cs (VerifyUsing): Small buglett fix.
3534
3535         * pending.cs (PendingImplementation): pass the container pointer. 
3536
3537         * interface.cs (GetMethods): Allow for recursive definition.  Long
3538         term, I would like to move every type to support recursive
3539         definitions, not the current ordering mechanism that we have right
3540         now.
3541
3542         The situation is this: Attributes are handled before interfaces,
3543         so we can apply attributes to interfaces.  But some attributes
3544         implement interfaces, we will now handle the simple cases
3545         (recursive definitions will just get an error).  
3546
3547         * parameter.cs: Only invalidate types at the end if we fail to
3548         lookup all types.  
3549
3550 2002-09-09  Martin Baulig  <martin@gnome.org>
3551
3552         * ecore.cs (PropertyExpr.Emit): Also check for
3553         TypeManager.system_int_array_get_length so this'll also work when
3554         compiling corlib.  Fixes #30003.
3555
3556 2002-09-09  Martin Baulig  <martin@gnome.org>
3557
3558         * expression.cs (ArrayCreation.MakeByteBlob): Added support for enums
3559         and throw an exception if we can't get the type's size.  Fixed #30040,
3560         added test-165.cs.
3561
3562 2002-09-09  Martin Baulig  <martin@gnome.org>
3563
3564         * ecore.cs (PropertyExpr.DoResolve): Added check for static properies.
3565
3566         * expression.cs (SizeOf.DoResolve): Sizeof is only allowed in unsafe
3567         context.  Fixes bug #30027.
3568
3569         * delegate.cs (NewDelegate.Emit): Use OpCodes.Ldvirtftn for
3570         virtual functions.  Fixes bug #30043, added test-164.cs.
3571
3572 2002-09-08  Ravi Pratap  <ravi@ximian.com>
3573
3574         * attribute.cs : Fix a small NullRef crash thanks to my stupidity.
3575
3576 2002-09-08  Nick Drochak  <ndrochak@gol.com>
3577
3578         * driver.cs: Use an object to get the windows codepage since it's not a
3579         static property.
3580
3581 2002-09-08  Miguel de Icaza  <miguel@ximian.com>
3582
3583         * statement.cs (For.Emit): for infinite loops (test == null)
3584         return whether there is a break inside, not always "true".
3585
3586         * namespace.cs (UsingEntry): New struct to hold the name of the
3587         using definition, the location where it is defined, and whether it
3588         has been used in a successful type lookup.
3589         
3590         * rootcontext.cs (NamespaceLookup): Use UsingEntries instead of
3591         strings.
3592
3593         * decl.cs: ditto.
3594
3595 2002-09-06  Ravi Pratap  <ravi@ximian.com>
3596
3597         * attribute.cs : Fix incorrect code which relied on catching
3598         a NullReferenceException to detect a null being passed in
3599         where an object was expected.
3600
3601 2002-09-06  Miguel de Icaza  <miguel@ximian.com>
3602
3603         * statement.cs (Try): flag the catch variable as assigned
3604
3605         * expression.cs (Cast): Simplified by using ResolveType instead of
3606         manually resolving.
3607
3608         * statement.cs (Catch): Fix bug by using ResolveType.
3609
3610 2002-09-06  Ravi Pratap  <ravi@ximian.com>
3611
3612         * expression.cs (BetterConversion): Special case for when we have
3613         a NullLiteral as the argument and we have to choose between string
3614         and object types - we choose string the way csc does.
3615
3616         * attribute.cs (Attribute.Resolve): Catch the
3617         NullReferenceException and report error #182 since the Mono
3618         runtime no more has the bug and having this exception raised means
3619         we tried to select a constructor which takes an object and is
3620         passed a null.
3621
3622 2002-09-05  Ravi Pratap  <ravi@ximian.com>
3623
3624         * expression.cs (Invocation.OverloadResolve): Flag a nicer error
3625         message (1502, 1503) when we can't locate a method after overload
3626         resolution. This is much more informative and closes the bug
3627         Miguel reported.
3628
3629         * interface.cs (PopulateMethod): Return if there are no argument
3630         types. Fixes a NullReferenceException bug.
3631
3632         * attribute.cs (Attribute.Resolve): Ensure we allow TypeOf
3633         expressions too. Previously we were checking only in one place for
3634         positional arguments leaving out named arguments.
3635
3636         * ecore.cs (ImplicitNumericConversion): Conversion from underlying
3637         type to the enum type is not allowed. Remove code corresponding to
3638         that.
3639
3640         (ConvertNumericExplicit): Allow explicit conversions from
3641         the underlying type to enum type. This precisely follows the spec
3642         and closes a bug filed by Gonzalo.
3643         
3644 2002-09-04  Gonzalo Paniagua Javier <gonzalo@ximian.com>
3645
3646         * compiler.csproj:
3647         * compiler.csproj.user: patch from Adam Chester (achester@bigpond.com).
3648
3649 2002-09-03  Miguel de Icaza  <miguel@ximian.com>
3650
3651         * statement.cs (SwitchLabel.ResolveAndReduce): In the string case,
3652         it was important that we stored the right value after the
3653         reduction in `converted'.
3654
3655 2002-09-04  Martin Baulig  <martin@gnome.org>
3656
3657         * location.cs (Location.SymbolDocument): Use full pathnames for the
3658         source files.
3659
3660 2002-08-30  Miguel de Icaza  <miguel@ximian.com>
3661
3662         * expression.cs (ComposedCast): Use DeclSparce.ResolveType instead
3663         of the expression resolve mechanism, because that will catch the
3664         SimpleName error failures.
3665
3666         (Conditional): If we can not resolve the
3667         expression, return, do not crash.
3668
3669 2002-08-29  Gonzalo Paniagua Javier <gonzalo@ximian.com>
3670
3671         * cs-tokenizer.cs:
3672         (location): display token name instead of its number.
3673
3674 2002-08-28  Martin Baulig  <martin@gnome.org>
3675
3676         * expression.cs (Binary.ResolveOperator): Don't silently return
3677         but return an error if an operator cannot be applied between two
3678         enum types.
3679
3680 2002-08-28  Martin Baulig  <martin@gnome.org>
3681
3682         * class.cs (Constructor.Define): Set the permission attributes
3683         correctly instead of making all constructors public.
3684
3685 2002-08-28  Martin Baulig  <martin@gnome.org>
3686
3687         * ecore.cs (Expression.DoResolve): Do a TypeManager.MemberLook
3688         for private members before reporting a CS0103; if we find anything,
3689         it's a CS0122.
3690
3691 2002-08-28  Martin Baulig  <martin@gnome.org>
3692
3693         * typemanager.cs (TypeManager.FilterWithClosure): It's not enough
3694         to check whether `closure_start_type == closure_invocation_type',
3695         we also need to check whether `m.DeclaringType == closure_invocation_type'
3696         before bypassing the permission checks.  We might be accessing
3697         protected/private members from the base class.
3698         (TypeManager.RealMemberLookup): Only set private_ok if private
3699         members were requested via BindingFlags.NonPublic.
3700
3701         * ecore.cs (MethodGroupExpr.IsExplicitImpl): New property.
3702
3703         * expression.cs (MemberAccess.ResolveMemberAccess): Set
3704         MethodGroupExpr.IsExplicitImpl if appropriate.
3705         (Invocation.DoResolve): Don't report the CS0120 for explicit
3706         interface implementations.
3707
3708 2002-08-27  Martin Baulig  <martin@gnome.org>
3709
3710         * expression.cs (Invocation.DoResolve): If this is a static
3711         method and we don't have an InstanceExpression, we must report
3712         a CS0120.
3713
3714 2002-08-25  Martin Baulig  <martin@gnome.org>
3715
3716         * expression.cs (Binary.ResolveOperator): Don't allow `!=' and
3717         `==' between a valuetype and an object.
3718
3719 2002-08-25  Miguel de Icaza  <miguel@ximian.com>
3720
3721         * ecore.cs (TypeExpr): Provide a ToString method.
3722
3723 2002-08-24  Martin Baulig  <martin@gnome.org>
3724
3725         * codegen.cs (CodeGen.InitMonoSymbolWriter): The symbol file is
3726         now called proggie.dbg and it's a binary file.
3727
3728 2002-08-23  Martin Baulig  <martin@gnome.org>
3729
3730         * decl.cs (MemberCache.AddMethods): Ignore varargs methods.
3731
3732 2002-08-23  Martin Baulig  <martin@gnome.org>
3733
3734         * struct.cs (MyStructInfo.ctor): Make this work with empty
3735         structs; it's not allowed to use foreach() on null.
3736
3737 2002-08-23  Martin Baulig  <martin@gnome.org>
3738
3739         * codegen.cs (CodeGen.InitMonoSymbolWriter): Tell the symbol
3740         writer the full pathname of the generated assembly.
3741
3742 2002-08-23  Martin Baulig  <martin@gnome.org>
3743
3744         * statements.cs (FlowBranching.UsageVector.MergeChildren):
3745         A `finally' block never returns or breaks; improved handling of
3746         unreachable code.
3747
3748 2002-08-23  Martin Baulig  <martin@gnome.org>
3749
3750         * statement.cs (Throw.Resolve): Allow `throw null'.
3751
3752 2002-08-23  Martin Baulig  <martin@gnome.org>
3753
3754         * expression.cs (MemberAccess.ResolveMemberAccess): If this is an
3755         EventExpr, don't do a DeclaredOnly MemberLookup, but check whether
3756         `ee.EventInfo.DeclaringType == ec.ContainerType'.  The
3757         MemberLookup would return a wrong event if this is an explicit
3758         interface implementation and the class has an event with the same
3759         name.
3760
3761 2002-08-23  Martin Baulig  <martin@gnome.org>
3762
3763         * statement.cs (Block.AddChildVariableNames): New public method.
3764         (Block.AddChildVariableName): Likewise.
3765         (Block.IsVariableNameUsedInChildBlock): Likewise.
3766         (Block.AddVariable): Check whether a variable name has already
3767         been used in a child block.
3768
3769         * cs-parser.jay (declare_local_variables): Mark all variable names
3770         from the current block as being used in a child block in the
3771         implicit block.
3772
3773 2002-08-23  Martin Baulig  <martin@gnome.org>
3774
3775         * codegen.cs (CodeGen.InitializeSymbolWriter): Abort if we can't
3776         find the symbol writer.
3777
3778         * driver.cs: csc also allows the arguments to /define being
3779         separated by commas, not only by semicolons.
3780
3781 2002-08-23  Martin Baulig  <martin@gnome.org>
3782
3783         * interface.cs (Interface.GetMembers): Added static check for events.
3784
3785 2002-08-15  Martin Baulig  <martin@gnome.org>
3786
3787         * class.cs (MethodData.EmitDestructor): In the Expression.MemberLookup
3788         call, use ec.ContainerType.BaseType as queried_type and invocation_type.
3789
3790         * ecore.cs (Expression.MemberLookup): Added documentation and explained
3791         why the MethodData.EmitDestructor() change was necessary.
3792
3793 2002-08-20  Martin Baulig  <martin@gnome.org>
3794
3795         * class.cs (TypeContainer.FindMembers): Added static check for events.
3796
3797         * decl.cs (MemberCache.AddMembers): Handle events like normal members.
3798
3799         * typemanager.cs (TypeHandle.GetMembers): When queried for events only,
3800         use Type.GetEvents(), not Type.FindMembers().
3801
3802 2002-08-20  Martin Baulig  <martin@gnome.org>
3803
3804         * decl.cs (MemberCache): Added a special method cache which will
3805         be used for method-only searched.  This ensures that a method
3806         search will return a MethodInfo with the correct ReflectedType for
3807         inherited methods.      
3808
3809 2002-08-20  Martin Baulig  <martin@gnome.org>
3810
3811         * decl.cs (DeclSpace.FindMembers): Made this public.
3812
3813 2002-08-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
3814
3815         * delegate.cs: fixed build on windows.
3816         [FIXME:  Filed as bug #29150: MCS must report these errors.]
3817
3818 2002-08-19  Ravi Pratap  <ravi@ximian.com>
3819
3820         * ecore.cs (StandardConversionExists): Return a false
3821         if we are trying to convert the void type to anything else
3822         since that is not allowed.
3823
3824         * delegate.cs (DelegateInvocation.DoResolve): Ensure that
3825         we flag error 70 in the event an event is trying to be accessed
3826         directly from outside the declaring type.
3827
3828 2002-08-20  Martin Baulig  <martin@gnome.org>
3829
3830         * typemanager.cs, decl.cs: Moved MemberList, IMemberContainer and
3831         MemberCache from typemanager.cs to decl.cs.
3832
3833 2002-08-19  Martin Baulig  <martin@gnome.org>
3834
3835         * class.cs (TypeContainer): Implement IMemberContainer.
3836         (TypeContainer.DefineMembers): Create the MemberCache.
3837         (TypeContainer.FindMembers): Do better BindingFlags checking; only
3838         return public members if BindingFlags.Public was given, check
3839         whether members are static.
3840
3841 2002-08-16  Martin Baulig  <martin@gnome.org>
3842
3843         * decl.cs (DeclSpace.Define): Splitted this in Define and
3844         DefineMembers.  DefineMembers is called first and initializes the
3845         MemberCache.
3846
3847         * rootcontext.cs (RootContext.DefineMembers): New function.  Calls
3848         DefineMembers() on all our DeclSpaces.
3849
3850         * class.cs (TypeContainer.Define): Moved all code to DefineMembers(),
3851         but call DefineMembers() on all nested interfaces.  We call their
3852         Define() in our new Define() function.
3853
3854         * interface.cs (Interface): Implement IMemberContainer.
3855         (Interface.Define): Moved all code except the attribute stuf to
3856         DefineMembers().
3857         (Interface.DefineMembers): Initialize the member cache.
3858
3859         * typemanager.cs (IMemberFinder): Removed this interface, we don't
3860         need this anymore since we can use MemberCache.FindMembers directly.
3861
3862 2002-08-19  Martin Baulig  <martin@gnome.org>
3863
3864         * typemanager.cs (MemberCache): When creating the cache for an
3865         interface type, add all inherited members.
3866         (TypeManager.MemberLookup_FindMembers): Changed `ref bool searching'
3867         to `out bool used_cache' and documented it.
3868         (TypeManager.MemberLookup): If we already used the cache in the first
3869         iteration, we don't need to do the interfaces check.
3870
3871 2002-08-19  Martin Baulig  <martin@gnome.org>
3872
3873         * decl.cs (DeclSpace.FindMembers): New abstract method.  Moved this
3874         here from IMemberFinder and don't implement this interface anymore.
3875         (DeclSpace.MemberCache): Moved here from IMemberFinder.
3876
3877         * typemanager.cs (IMemberFinder): This interface is now only used by
3878         classes which actually support the member cache.
3879         (TypeManager.builder_to_member_finder): Renamed to builder_to_declspace
3880         since we only put DeclSpaces into this Hashtable.
3881         (MemberLookup_FindMembers): Use `builder_to_declspace' if the type is
3882         a dynamic type and TypeHandle.GetTypeHandle() otherwise.
3883
3884 2002-08-16  Martin Baulig  <martin@gnome.org>
3885
3886         * typemanager.cs (ICachingMemberFinder): Removed.
3887         (IMemberFinder.MemberCache): New property.
3888         (TypeManager.FindMembers): Merged this with RealFindMembers().
3889         This function will never be called from TypeManager.MemberLookup()
3890         so we can't use the cache here, just the IMemberFinder.
3891         (TypeManager.MemberLookup_FindMembers): Check whether the
3892         IMemberFinder has a MemberCache and call the cache's FindMembers
3893         function.
3894         (MemberCache): Rewrote larger parts of this yet another time and
3895         cleaned it up a bit.
3896
3897 2002-08-15  Miguel de Icaza  <miguel@ximian.com>
3898
3899         * driver.cs (LoadArgs): Support quoting.
3900
3901         (Usage): Show the CSC-like command line arguments.
3902
3903         Improved a few error messages.
3904
3905 2002-08-15  Martin Baulig  <martin@gnome.org>
3906
3907         * typemanager.cs (IMemberContainer.Type): New property.
3908         (IMemberContainer.IsInterface): New property.
3909
3910         The following changes are conditional to BROKEN_RUNTIME, which is
3911         defined at the top of the file.
3912
3913         * typemanager.cs (MemberCache.MemberCache): Don't add the base
3914         class'es members, but add all members from TypeHandle.ObjectType
3915         if we're an interface.
3916         (MemberCache.AddMembers): Set the Declared flag if member.DeclaringType
3917         is the current type.
3918         (MemberCache.CacheEntry.Container): Removed this field.
3919         (TypeHandle.GetMembers): Include inherited members.
3920
3921 2002-08-14  Gonzalo Paniagua Javier <gonzalo@ximian.com>
3922
3923         * typemanager.cs: fixed compilation and added a comment on a field that
3924         is never used.
3925
3926 2002-08-15  Martin Baulig  <martin@gnome.org>
3927
3928         * class.cs (ConstructorInitializer.Resolve): In the
3929         Expression.MemberLookup call, use the queried_type as
3930         invocation_type.
3931
3932         * typemanager.cs (IMemberContainer.GetMembers): Removed the `bool
3933         declared' attribute, it's always true.
3934         (IMemberContainer.Parent, IMemberContainer.Name): New properties.
3935         (TypeManager.MemberLookup_FindMembers): [FIXME FIXME FIXME] Added
3936         temporary wrapper for FindMembers which tells MemberLookup whether
3937         members from the base classes are included in the return value.
3938         This will go away soon.
3939         (TypeManager.MemberLookup): Use this temporary hack here; once the
3940         new MemberCache is completed, we don't need to do the DeclaredOnly
3941         looping here anymore since the MemberCache will take care of this.
3942         (TypeManager.IsSubclassOrNestedChildOf): Allow `type == parent'.
3943         (MemberCache): When creating the MemberCache for a class, get
3944         members from the current class and all its base classes.
3945         (MemberCache.CacheEntry.Container): New field.  This is a
3946         temporary hack until the Mono runtime is fixed to distinguish
3947         between ReflectedType and DeclaringType.  It allows us to use MCS
3948         with both the MS runtime and the unfixed Mono runtime without
3949         problems and without accecting performance.
3950         (MemberCache.SearchMembers): The DeclaredOnly looping from
3951         TypeManager.MemberLookup is now done here.      
3952
3953 2002-08-14  Martin Baulig  <martin@gnome.org>
3954
3955         * statement.cs (MyStructInfo.MyStructInfo): Don't call
3956         Type.GetFields on dynamic types but get the fields from the
3957         corresponding TypeContainer.
3958         (MyStructInfo.GetStructInfo): Added check for enum types.
3959
3960         * typemanager.cs (MemberList.IsSynchronized): Implemented.
3961         (MemberList.SyncRoot): Implemented.
3962         (TypeManager.FilterWithClosure): No need to check permissions if
3963         closure_start_type == closure_invocation_type, don't crash if
3964         closure_invocation_type is null.
3965
3966 2002-08-13  Martin Baulig  <martin@gnome.org>
3967
3968         Rewrote TypeContainer.FindMembers to use a member cache.  This
3969         gives us a speed increase of about 35% for the self-hosting MCS
3970         build and of about 15-20% for the class libs (both on GNU/Linux).
3971
3972         * report.cs (Timer): New class to get enhanced profiling.  This
3973         whole class is "TIMER" conditional since it remarkably slows down
3974         compilation speed.
3975
3976         * class.cs (MemberList): New class.  This is an IList wrapper
3977         which we're now using instead of passing MemberInfo[]'s around to
3978         avoid copying this array unnecessarily.
3979         (IMemberFinder.FindMember): Return a MemberList, not a MemberInfo [].
3980         (ICachingMemberFinder, IMemberContainer): New interface.
3981         (TypeManager.FilterWithClosure): If `criteria' is null, the name
3982         has already been checked, otherwise use it for the name comparision.
3983         (TypeManager.FindMembers): Renamed to RealMemberFinder and
3984         provided wrapper which tries to use ICachingMemberFinder.FindMembers
3985         if possible.  Returns a MemberList, not a MemberInfo [].
3986         (TypeHandle): New class, implements IMemberContainer.  We create
3987         one instance of this class per type, it contains a MemberCache
3988         which is used to do the member lookups.
3989         (MemberCache): New class.  Each instance of this class contains
3990         all members of a type and a name-based hash table.
3991         (MemberCache.FindMembers): This is our new member lookup
3992         function.  First, it looks up all members of the requested name in
3993         the hash table.  Then, it walks this list and sorts out all
3994         applicable members and returns them.
3995
3996 2002-08-13  Martin Baulig  <martin@gnome.org>
3997
3998         In addition to a nice code cleanup, this gives us a performance
3999         increase of about 1.4% on GNU/Linux - not much, but it's already
4000         half a second for the self-hosting MCS compilation.
4001
4002         * typemanager.cs (IMemberFinder): New interface.  It is used by
4003         TypeManager.FindMembers to call FindMembers on a TypeContainer,
4004         Enum, Delegate or Interface.
4005         (TypeManager.finder_to_member_finder): New PtrHashtable.
4006         (TypeManager.finder_to_container): Removed.
4007         (TypeManager.finder_to_delegate): Removed.
4008         (TypeManager.finder_to_interface): Removed.
4009         (TypeManager.finder_to_enum): Removed.
4010
4011         * interface.cs (Interface): Implement IMemberFinder.
4012
4013         * delegate.cs (Delegate): Implement IMemberFinder.
4014
4015         * enum.cs (Enum): Implement IMemberFinder.
4016
4017         * class.cs (TypeContainer): Implement IMemberFinder.
4018
4019 2002-08-12  Martin Baulig  <martin@gnome.org>
4020
4021         * ecore.cs (TypeExpr.DoResolveType): Mark this as virtual.
4022
4023 2002-08-12  Martin Baulig  <martin@gnome.org>
4024
4025         * ecore.cs (ITypeExpression): New interface for expressions which
4026         resolve to a type.
4027         (TypeExpression): Renamed to TypeLookupExpression.
4028         (Expression.DoResolve): If we're doing a types-only lookup, the
4029         expression must implement the ITypeExpression interface and we
4030         call DoResolveType() on it.
4031         (SimpleName): Implement the new ITypeExpression interface.
4032         (SimpleName.SimpleNameResolve): Removed the ec.OnlyLookupTypes
4033         hack, the situation that we're only looking up types can't happen
4034         anymore when this method is called.  Moved the type lookup code to
4035         DoResolveType() and call it.
4036         (SimpleName.DoResolveType): This ITypeExpression interface method
4037         is now doing the types-only lookup.
4038         (TypeExpr, TypeLookupExpression): Implement ITypeExpression.
4039         (ResolveFlags): Added MaskExprClass.
4040
4041         * expression.cs (MemberAccess): Implement the ITypeExpression
4042         interface.
4043         (MemberAccess.DoResolve): Added support for a types-only lookup
4044         when we're called via ITypeExpression.DoResolveType().
4045         (ComposedCast): Implement the ITypeExpression interface.
4046
4047         * codegen.cs (EmitContext.OnlyLookupTypes): Removed.  Call
4048         Expression.Resolve() with ResolveFlags.Type instead.
4049
4050 2002-08-12  Martin Baulig  <martin@gnome.org>
4051
4052         * interface.cs (Interface.Define): Apply attributes.
4053
4054         * attribute.cs (Attribute.ApplyAttributes): Added support for
4055         interface attributes.
4056
4057 2002-08-11  Martin Baulig  <martin@gnome.org>
4058
4059         * statement.cs (Block.Emit): Only check the "this" variable if we
4060         do not always throw an exception.
4061
4062         * ecore.cs (PropertyExpr.DoResolveLValue): Implemented, check
4063         whether the property has a set accessor.
4064
4065 2002-08-11  Martin Baulig  <martin@gnome.org>
4066
4067         Added control flow analysis support for structs.
4068
4069         * ecore.cs (ResolveFlags): Added `DisableFlowAnalysis' to resolve
4070         with control flow analysis turned off.
4071         (IVariable): New interface.
4072         (SimpleName.SimpleNameResolve): If MemberAccess.ResolveMemberAccess
4073         returns an IMemberExpr, call DoResolve/DoResolveLValue on it.
4074         (FieldExpr.DoResolve): Resolve the instance expression with flow
4075         analysis turned off and do the definite assignment check after the
4076         resolving when we know what the expression will resolve to.
4077
4078         * expression.cs (LocalVariableReference, ParameterReference):
4079         Implement the new IVariable interface, only call the flow analysis
4080         code if ec.DoFlowAnalysis is true.
4081         (This): Added constructor which takes a Block argument.  Implement
4082         the new IVariable interface.
4083         (MemberAccess.DoResolve, MemberAccess.DoResolveLValue): Call
4084         DoResolve/DoResolveLValue on the result of ResolveMemberLookup().
4085         This does the definite assignment checks for struct members.
4086
4087         * class.cs (Constructor.Emit): If this is a non-static `struct'
4088         constructor which doesn't have any initializer, call
4089         Block.AddThisVariable() to tell the flow analysis code that all
4090         struct elements must be initialized before control returns from
4091         the constructor.
4092
4093         * statement.cs (MyStructInfo): New public class.
4094         (UsageVector.this [VariableInfo vi]): Added `int field_idx'
4095         argument to this indexer.  If non-zero, check an individual struct
4096         member, not the whole struct.
4097         (FlowBranching.CheckOutParameters): Check struct members.
4098         (FlowBranching.IsVariableAssigned, SetVariableAssigned): Added
4099         overloaded versions of these methods which take an additional
4100         `int field_idx' argument to check struct members.
4101         (FlowBranching.IsParameterAssigned, SetParameterAssigned): Added
4102         overloaded versions of these methods which take an additional
4103         `string field_name' argument to check struct member.s
4104         (VariableInfo): Implement the IVariable interface.
4105         (VariableInfo.StructInfo): New public property.  Returns the
4106         MyStructInfo instance of the variable if it's a struct or null.
4107         (Block.AddThisVariable): New public method.  This is called from
4108         Constructor.Emit() for non-static `struct' constructor which do
4109         not have any initializer.  It creates a special variable for the
4110         "this" instance variable which will be checked by the flow
4111         analysis code to ensure that all of the struct's fields are
4112         initialized before control returns from the constructor.
4113         (UsageVector): Added support for struct members.  If a
4114         variable/parameter is a struct with N members, we reserve a slot
4115         in the usage vector for each member.  A struct is considered fully
4116         initialized if either the struct itself (slot 0) or all its
4117         members are initialized.
4118
4119 2002-08-08  Martin Baulig  <martin@gnome.org>
4120
4121         * driver.cs (Driver.MainDriver): Only report an error CS5001
4122         if there were no compilation errors.
4123
4124         * codegen.cs (EmitContext.EmitContext): Use the DeclSpace's
4125         `UnsafeContext' property to determine whether the parent is in
4126         unsafe context rather than checking the parent's ModFlags:
4127         classes nested in an unsafe class are unsafe as well.
4128
4129 2002-08-08  Martin Baulig  <martin@gnome.org>
4130
4131         * statement.cs (UsageVector.MergeChildren): Distinguish between
4132         `Breaks' and `Returns' everywhere, don't set `Breaks' anymore if
4133         we return.  Added test17() and test18() to test-154.cs.
4134
4135 2002-08-08  Martin Baulig  <martin@gnome.org>
4136
4137         * typemanager.cs (TypeManager.FilterWithClosure): If we have
4138         Family access, make sure the invoking type isn't a subclass of the
4139         queried type (that'd be a CS1540).
4140
4141         * ecore.cs (Expression.MemberLookup): Added overloaded version of
4142         this method which takes an additional `Type invocation_type'.
4143
4144         * expression.cs (BaseAccess.DoResolve): Use the base type as
4145         invocation and query type.
4146         (MemberAccess.DoResolve): If the lookup failed and we're about to
4147         report a CS0122, try a lookup with the ec.ContainerType - if this
4148         succeeds, we must report a CS1540.
4149
4150 2002-08-08  Martin Baulig  <martin@gnome.org>
4151
4152         * ecore.cs (IMemberExpr): Added `bool IsInstance' property.
4153         (MethodGroupExpr): Implement the IMemberExpr interface.
4154
4155         * expression (MemberAccess.ResolveMemberAccess): No need to have
4156         any special code for MethodGroupExprs anymore, they're now
4157         IMemberExprs.   
4158
4159 2002-08-08  Martin Baulig  <martin@gnome.org>
4160
4161         * typemanager.cs (TypeManager.FilterWithClosure): Check Assembly,
4162         Family, FamANDAssem and FamORAssem permissions.
4163         (TypeManager.IsSubclassOrNestedChildOf): New public method.
4164
4165 2002-08-08  Martin Baulig  <martin@gnome.org>
4166
4167         * statement.cs (FlowBranchingType): Added LOOP_BLOCK.
4168         (UsageVector.MergeChildren): `break' breaks unless we're in a switch
4169         or loop block.
4170
4171 Thu Aug 8 10:28:07 CEST 2002 Paolo Molaro <lupus@ximian.com>
4172
4173         * driver.cs: implemented /resource option to embed managed resources.
4174
4175 2002-08-07  Martin Baulig  <martin@gnome.org>
4176
4177         * class.cs (FieldBase.Initializer): Renamed to `init' and made private.
4178         (FieldBase.HasFieldInitializer): New public property.
4179         (FieldBase.GetInitializerExpression): New public method.  Resolves and
4180         returns the field initializer and makes sure it is only resolved once.
4181         (TypeContainer.EmitFieldInitializers): Call
4182         FieldBase.GetInitializerExpression to get the initializer, this ensures
4183         that it isn't resolved multiple times.
4184
4185         * codegen.cs (EmitContext): Added `bool IsFieldInitialier'.  This tells
4186         the resolving process (SimpleName/MemberLookup) that we're currently
4187         emitting a field initializer (which must not access any instance members,
4188         this is an error CS0236).
4189
4190         * ecore.cs (SimpleName.Error_ObjectRefRequired): Added EmitContext
4191         argument, if the `IsFieldInitializer' flag is set, we must report and
4192         error CS0236 and not an error CS0120.   
4193
4194 2002-08-07  Martin Baulig  <martin@gnome.org>
4195
4196         * ecore.cs (IMemberExpr): New public interface.
4197         (FieldExpr, PropertyExpr, EventExpr): Implement IMemberExpr.
4198         (SimpleName.SimpleNameResolve): Call MemberAccess.ResolveMemberAccess
4199         if the expression is an IMemberExpr.
4200
4201         * expression.cs (MemberAccess.ResolveMemberAccess): Allow `left'
4202         to be null, implicitly default to `this' if we're non-static in
4203         this case.  Simplified the code a lot by using the new IMemberExpr
4204         interface.  Also fixed bug #28176 here.
4205
4206 2002-08-06  Martin Baulig  <martin@gnome.org>
4207
4208         * cs-parser.jay (SimpleLookup): Removed.  We need to create
4209         ParameterReferences during semantic analysis so that we can do a
4210         type-only search when resolving Cast, TypeOf and SizeOf.
4211         (block): Pass the `current_local_parameters' to the Block's
4212         constructor.
4213
4214         * class.cs (ConstructorInitializer): Added `Parameters parameters'
4215         argument to the constructor.
4216         (ConstructorInitializer.Resolve): Create a temporary implicit
4217         block with the parameters.
4218
4219         * ecore.cs (SimpleName.SimpleNameResolve): Resolve parameter
4220         references here if we aren't doing a type-only search.
4221
4222         * statement.cs (Block): Added constructor which takes a
4223         `Parameters parameters' argument.
4224         (Block.Parameters): New public property.
4225
4226         * support.cs (InternalParameters.Parameters): Renamed `parameters'
4227         to `Parameters' and made it public readonly.
4228
4229 2002-08-06  Martin Baulig  <martin@gnome.org>
4230
4231         * ecore.cs (Expression.Warning): Made this public as well.
4232
4233         * report.cs (Report.Debug): Print the contents of collections.
4234
4235 2002-08-06  Martin Baulig  <martin@gnome.org>
4236
4237         * ecore.cs (Expression.ResolveFlags): New [Flags] enum.  This is
4238         used to tell Resolve() which kinds of expressions it may return.
4239         (Expression.Resolve): Added overloaded version of this method which
4240         takes a `ResolveFlags flags' argument.  This can be used to tell
4241         Resolve() which kinds of expressions it may return.  Reports a
4242         CS0118 on error.
4243         (Expression.ResolveWithSimpleName): Removed, use Resolve() with
4244         ResolveFlags.SimpleName.
4245         (Expression.Error118): Added overloaded version of this method which
4246         takes a `ResolveFlags flags' argument.  It uses the flags to determine
4247         which kinds of expressions are allowed.
4248
4249         * expression.cs (Argument.ResolveMethodGroup): New public method.
4250         Resolves an argument, but allows a MethodGroup to be returned.
4251         This is used when invoking a delegate.
4252
4253         * TODO: Updated a bit.
4254
4255 2002-08-06  Gonzalo Paniagua Javier <gonzalo@ximian.com>
4256
4257         Fixed compilation with csc.
4258
4259         * ecore.cs: Expression.Error made public. Is this correct? Should
4260         Warning be made public too?
4261
4262         * expression.cs: use ea.Location instead of ea.loc.
4263         [FIXME:  Filed as bug #28607: MCS must report these errors.]
4264
4265 2002-08-06  Martin Baulig  <martin@gnome.org>
4266
4267         * ecore.cs (Expression.loc): Moved the location here instead of
4268         duplicating it in all derived classes.
4269         (Expression.Location): New public property.
4270         (Expression.Error, Expression.Warning): Made them non-static and
4271         removed the location argument.
4272         (Expression.Warning): Added overloaded version which takes an
4273         `int level' argument.
4274         (Expression.Error118): Make this non-static and removed the
4275         expression and location arguments.
4276         (TypeExpr): Added location argument to the constructor.
4277
4278         * expression.cs (StaticCallExpr): Added location argument to
4279         the constructor.
4280         (Indirection, PointerArithmetic): Likewise.
4281         (CheckedExpr, UnCheckedExpr): Likewise.
4282         (ArrayAccess, IndexerAccess, UserCast, ArrayPtr): Likewise.
4283         (StringPtr): Likewise.
4284
4285
4286 2002-08-05  Martin Baulig  <martin@gnome.org>
4287
4288         * expression.cs (BaseAccess.DoResolve): Actually report errors.
4289
4290         * assign.cs (Assign.DoResolve): Check whether the source
4291         expression is a value or variable.
4292
4293         * statement.cs (Try.Resolve): Set ec.InTry/InCatch/InFinally
4294         while resolving the corresponding blocks.
4295
4296         * interface.cs (Interface.GetInterfaceTypeByName): Actually report
4297         an error, don't silently return null.
4298
4299         * statement.cs (Block.AddVariable): Do the error reporting here
4300         and distinguish between CS0128 and CS0136.
4301         (Block.DoResolve): Report all unused labels (warning CS0164).
4302         (LabeledStatement): Pass the location to the constructor.
4303         (LabeledStatement.HasBeenReferenced): New property.
4304         (LabeledStatement.Resolve): Set it to true here.
4305
4306         * statement.cs (Return.Emit): Return success even after reporting
4307         a type mismatch error (CS0126 or CS0127), this is what csc does and
4308         it avoids confusing the users with any consecutive errors.
4309
4310 2002-08-05  Martin Baulig  <martin@gnome.org>
4311
4312         * enum.cs (Enum.LookupEnumValue): Catch circular definitions.
4313
4314         * const.cs (Const.LookupConstantValue): Catch circular definitions.
4315
4316         * expression.cs (MemberAccess.DoResolve): Silently return if an
4317         error has already been reported.
4318
4319         * ecore.cs (Expression.MemberLookupFinal): Silently return if an
4320         error has already been reported.
4321
4322 2002-08-05  Martin Baulig  <martin@gnome.org>
4323
4324         * statement.cs (UsageVector): Only initialize the `parameters'
4325         vector if we actually have any "out" parameters.
4326
4327 2002-08-05  Martin Baulig  <martin@gnome.org>
4328
4329         * expression.cs (Binary.ResolveOperator): When combining delegates,
4330         they must have the same type.
4331
4332 2002-08-05  Martin Baulig  <martin@gnome.org>
4333
4334         * typemanager.cs (TypeManager.GetArgumentTypes): Don't call
4335         PropertyInfo.GetIndexParameters() on dynamic types, this doesn't
4336         work with the ms runtime and we also don't need it: if we're a
4337         PropertyBuilder and not in the `indexer_arguments' hash, then we
4338         are a property and not an indexer.
4339
4340         * class.cs (TypeContainer.AsAccessible): Use Type.IsArray,
4341         Type.IsPointer and Type.IsByRef instead of Type.HasElementType
4342         since the latter one doesn't work with the ms runtime.
4343
4344 2002-08-03  Martin Baulig  <martin@gnome.org>
4345
4346         Fixed bugs #27998 and #22735.
4347
4348         * class.cs (Method.IsOperator): New public field.
4349         (Method.CheckBase): Report CS0111 if there's already a method
4350         with the same parameters in the current class.  Report CS0508 when
4351         attempting to change the return type of an inherited method.
4352         (MethodData.Emit): Report CS0179 if a method doesn't have a body
4353         and it's not marked abstract or extern.
4354         (PropertyBase): New abstract base class for Property and Indexer.
4355         (PropertyBase.CheckBase): Moved here from Property and made it work
4356         for indexers.
4357         (PropertyBase.Emit): Moved here from Property.Emit, Indexer.Emit is
4358         the same so we can reuse it there.
4359         (Property, Indexer): Derive from PropertyBase.
4360         (MethodSignature.inheritable_property_signature_filter): New delegate
4361         to find properties and indexers.
4362
4363         * decl.cs (MemberCore.CheckMethodAgainstBase): Added `string name'
4364         argument and improved error reporting.
4365
4366         * parameter.cs (Parameters.GetEmptyReadOnlyParameters): Renamed to
4367         EmptyReadOnlyParameters and made it a property.
4368
4369         * typemanager.cs (TypeManager.GetArgumentTypes): Added overloaded
4370         version of this method which takes a `PropertyInfo indexer'.
4371         (TypeManager.RegisterIndexer): New method.
4372
4373         * class.cs: Added myself as author of this file :-)
4374
4375 2002-08-03  Gonzalo Paniagua Javier <gonzalo@ximian.com>
4376
4377         * class.cs: fixed compilation on windoze.
4378
4379 2002-08-03  Martin Baulig  <martin@gnome.org>
4380
4381         * interface.cs (Interface.GetInterfaceBases): Check whether all
4382         base interfaces are at least as accessible than the current one.
4383
4384         * class.cs (TypeContainer.GetClassBases): Check whether base types
4385         are at least as accessible than the current type.
4386         (TypeContainer.AsAccessible): Implemented and made non-static.
4387         (MemberBase.CheckParameters): Report errors if the accessibility
4388         checks fail.
4389
4390         * delegate.cs (Delegate.Delegate): The default visibility is
4391         internal for top-level types and private for nested types.
4392         (Delegate.Define): Report errors if the accessibility checks fail.
4393
4394         * enum.cs (Enum.Enum): The default visibility is internal for
4395         top-level types and private for nested types.
4396         (Enum.DefineType): Compute the correct visibility.
4397
4398         * modifiers.cs (Modifiers.TypeAttr): Added a version of this
4399         function which takes a `bool is_toplevel' instead of a TypeContainer.
4400
4401         * typemanager.cs (TypeManager.IsBuiltinType): `void' is also a
4402         builtin type.
4403
4404 2002-08-02  Martin Baulig  <martin@gnome.org>
4405
4406         * expression.cs (LocalVariableReferenc): Added constructor which
4407         takes additional `VariableInfo vi' and `bool is_readonly' arguments.
4408         (LocalVariableReference.IsReadOnly): New property.
4409         (LocalVariableReference.DoResolveLValue): Report a CS1604 if the
4410         variable is readonly, use our own readonly flag to do this; you can
4411         use the new constructor to get a writable reference to a read-only
4412         variable.
4413
4414         * cs-parser.jay (foreach_statement, using_statement): Get a writable
4415         reference to the local variable.
4416
4417 2002-08-01  Miguel de Icaza  <miguel@ximian.com>
4418
4419         * rootcontext.cs (ResolveCore): Also include System.Exception
4420
4421         * statement.cs (Block.Emit): Do not emit the dead-code warnings if
4422         we reach an EmptyStatement.
4423
4424         (Catch.DoResolve, Throw.DoResolve): Throwing the System.Exception
4425         is also fine.
4426
4427         * expression.cs (Binary.ResolveOperator): Check error result in
4428         two places.
4429
4430         use brtrue/brfalse directly and avoid compares to null.
4431
4432 2002-08-02  Martin Baulig  <martin@gnome.org>
4433
4434         * class.cs (TypeContainer.Define): Define all nested interfaces here.
4435         Fixes bug #28407, added test-155.cs.
4436
4437 2002-08-01  Martin Baulig  <martin@gnome.org>
4438
4439         * class.cs (Event.EmitDefaultMethod): Make this work with static
4440         events.  Fixes #28311, added verify-3.cs.
4441
4442 2002-08-01  Martin Baulig  <martin@gnome.org>
4443
4444         * statement.cs (ForeachHelperMethods): Added `enumerator_type' and
4445         `is_disposable' fields.
4446         (Foreach.GetEnumeratorFilter): Set `hm.enumerator_type' and
4447         `hm.is_disposable' if we're using the collection pattern.
4448         (Foreach.EmitCollectionForeach): Use the correct type for the
4449         enumerator's local variable, only emit the try/finally block if
4450         necessary (fixes #27713).
4451
4452 2002-08-01  Martin Baulig  <martin@gnome.org>
4453
4454         * ecore.cs (Expression.report118): Renamed to Error118 and made
4455         it public static.
4456
4457         * statement.cs (Throw.Resolve): Check whether the expression is of
4458         the correct type (CS0118) and whether the type derives from
4459         System.Exception (CS0155).
4460         (Catch.Resolve): New method.  Do the type lookup here and check
4461         whether it derives from System.Exception (CS0155).
4462         (Catch.CatchType, Catch.IsGeneral): New public properties.
4463
4464         * typemanager.cs (TypeManager.exception_type): Added.
4465
4466 2002-07-31  Miguel de Icaza  <miguel@ximian.com>
4467
4468         * driver.cs: Updated About function.
4469
4470 2002-07-31  Martin Baulig  <martin@gnome.org>
4471
4472         Implemented Control Flow Analysis.
4473
4474         * codegen.cs (EmitContext.DoFlowAnalysis): New public variable.
4475         (EmitContext.CurrentBranching): Added.
4476         (EmitContext.StartFlowBranching): Added.
4477         (EmitContext.EndFlowBranching): Added.
4478         (EmitContext.KillFlowBranching): Added.
4479         (EmitContext.IsVariableAssigned): Added.
4480         (EmitContext.SetVariableAssigned): Added.
4481         (EmitContext.IsParameterAssigned): Added.
4482         (EmitContext.SetParameterAssigned): Added.
4483         (EmitContext.EmitTopBlock): Added `InternalParameters ip' argument.
4484         Added control flow analysis stuff here.
4485
4486         * expression.cs (Unary.DoResolve): If the operator is Oper.AddressOf,
4487         resolve the expression as lvalue.
4488         (LocalVariableReference.DoResolve): Check whether the variable has
4489         already been assigned.
4490         (ParameterReference.DoResolveLValue): Override lvalue resolve to mark
4491         the parameter as assigned here.
4492         (ParameterReference.DoResolve): Check whether the parameter has already
4493         been assigned.
4494         (Argument.Resolve): If it's a `ref' or `out' argument, resolve the
4495         expression as lvalue.
4496
4497         * statement.cs (FlowBranching): New class for the flow analysis code.
4498         (Goto): Resolve the label in Resolve, not in Emit; added flow analysis.
4499         (LabeledStatement.IsDefined): New public property.
4500         (LabeledStatement.AddUsageVector): New public method to tell flow
4501         analyis that the label may be reached via a forward jump.
4502         (GotoCase): Lookup and resolve the label in Resolve, not in Emit; added
4503         flow analysis.
4504         (VariableInfo.Number): New public field.  This is used by flow analysis
4505         to number all locals of a block.
4506         (Block.CountVariables): New public property.  This is the number of
4507         local variables in this block (including the locals from all parent
4508         blocks).
4509         (Block.EmitMeta): Number all the variables.
4510
4511         * statement.cs: Added flow analysis support to all classes.
4512
4513 2002-07-31  Martin Baulig  <martin@gnome.org>
4514
4515         * driver.cs: Added "--mcs-debug" argument if MCS_DEBUG is defined.
4516         To get debugging messages, compile mcs with /define:MCS_DEBUG and
4517         then use this argument.
4518
4519         * report.cs (Report.Debug): Renamed to conditional to "MCS_DEBUG".
4520
4521         * makefile.gnu (MCS_FLAGS): Include $(MCS_DEFINES), the user may
4522         use this to specify /define options.
4523
4524 2002-07-29  Martin Baulig  <martin@gnome.org>
4525
4526         * statement.cs (Fixed): Moved all code that does variable lookups
4527         and resolvings from Emit to Resolve.
4528
4529         * statement.cs (For): Moved all code that does variable lookups
4530         and resolvings from Emit to Resolve.
4531
4532         * statement.cs (Using): Moved all code that does variable lookups
4533         and resolvings from Emit to Resolve.
4534
4535 2002-07-29  Martin Baulig  <martin@gnome.org>
4536
4537         * attribute.cs (Attribute.Resolve): Explicitly catch a
4538         System.NullReferenceException when creating the
4539         CustromAttributeBuilder and report a different warning message.
4540
4541 2002-07-29  Martin Baulig  <martin@gnome.org>
4542
4543         * support.cs (ParameterData.ParameterName): Added method to
4544         get the name of a parameter.
4545
4546         * typemanager.cs (TypeManager.IsValueType): New public method.
4547
4548 2002-07-29  Martin Baulig  <martin@gnome.org>
4549
4550         * parameter.cs (Parameter.Modifier): Added `ISBYREF = 8'.  This
4551         is a flag which specifies that it's either ref or out.
4552         (Parameter.GetParameterInfo (DeclSpace, int, out bool)): Changed
4553         the out parameter to `out Parameter.Modifier mod', also set the
4554         Parameter.Modifier.ISBYREF flag on it if it's either ref or out.
4555
4556         * support.cs (InternalParameters.ParameterModifier): Distinguish
4557         between Parameter.Modifier.OUT and Parameter.Modifier.REF, set the
4558         Parameter.Modifier.ISBYREF flag if it's either ref or out.
4559
4560         * expression.cs (Argument.GetParameterModifier): Distinguish
4561         between Parameter.Modifier.OUT and Parameter.Modifier.REF, set the
4562         Parameter.Modifier.ISBYREF flag if it's either ref or out.
4563
4564 2002-07-29  Martin Baulig  <martin@gnome.org>
4565
4566         * expression.cs (ParameterReference.ParameterReference): Added
4567         `Location loc' argument to the constructor.
4568
4569         * cs-parser.jay: Pass location to ParameterReference.
4570
4571 2002-07-28  Miguel de Icaza  <miguel@ximian.com>
4572
4573         * statement.cs (Try): Initialize the location.
4574
4575         * cs-parser.jay: pass location to Try.
4576
4577         * expression.cs (Unary.Reduce): Change the prototype to return
4578         whether a constant fold could be performed or not.  The result is
4579         returned in an out parameters.  In the case of Indirection and
4580         AddressOf, we want to perform the full tests.
4581
4582 2002-07-26  Miguel de Icaza  <miguel@ximian.com>
4583
4584         * statement.cs (Statement.Emit): Flag dead code.
4585
4586 2002-07-27  Andrew Birkett  <andy@nobugs.org>
4587
4588         * expression.cs (Unary.Reduce): Handle AddressOf and Indirection.
4589
4590 2002-07-27  Martin Baulig  <martin@gnome.org>
4591
4592         * class.cs (MethodData.Define): Put back call to
4593         TypeManager.AddMethod(), accidentally commented this out.
4594
4595         * report.cs (Debug): New public method to print debugging information,
4596         this is `[Conditional ("DEBUG")]'.
4597
4598 2002-07-26  Martin Baulig  <martin@gnome.org>
4599
4600         * cs-parser.jay (CSharpParser): Added `Stack switch_stack'.
4601         (switch_statement): Push the current_block to the switch_stack and
4602         pop it again when we're done with the switch.
4603         (switch_section): The new block is a child of the current_block.
4604         Fixes bug #24007, added test-152.cs.
4605
4606 2002-07-27  Martin Baulig  <martin@gnome.org>
4607
4608         * expression.cs (Invocation.EmitArguments): When calling a varargs
4609         function with only its fixed arguments, we need to pass an empty
4610         array.
4611
4612 2002-07-27  Martin Baulig  <martin@gnome.org>
4613
4614         Mono 0.13 has been released.
4615
4616 2002-07-25  Miguel de Icaza  <miguel@ximian.com>
4617
4618         * driver.cs: Rename --resource to --linkres, because that is what
4619         we do currently, we dont support --resource yet.
4620
4621         * cs-tokenizer.cs: Fix test for reporting endif mismatches.
4622
4623 2002-07-25  Martin Baulig  <martin@gnome.org>
4624
4625         * class.cs (MethodData): New public class.  This is a `method builder'
4626         class for a method or one accessor of a Property/Indexer/Event.
4627         (MethodData.GetMethodFlags): Moved here from MemberBase.
4628         (MethodData.ApplyAttributes): Likewise.
4629         (MethodData.ApplyObsoleteAttribute): Likewise.
4630         (MethodData.ApplyConditionalAttribute): Likewise.
4631         (MethodData.ApplyDllImportAttribute): Likewise.
4632         (MethodData.CheckAbstractAndExternal): Likewise.
4633         (MethodData.Define): Formerly knows as MemberBase.DefineMethod().
4634         (MethodData.Emit): Formerly known as Method.Emit().
4635         (MemberBase): Moved everything which was specific to a single
4636         accessor/method to MethodData.
4637         (Method): Create a new MethodData and call Define() and Emit() on it.
4638         (Property, Indexer, Event): Create a new MethodData objects for each
4639         accessor and call Define() and Emit() on them.
4640
4641 2002-07-25  Martin Baulig  <martin@gnome.org>
4642
4643         Made MethodCore derive from MemberBase to reuse the code from there.
4644         MemberBase now also checks for attributes.
4645
4646         * class.cs (MethodCore): Derive from MemberBase, not MemberCore.
4647         (MemberBase.GetMethodFlags): Moved here from class Method and marked
4648         as virtual.
4649         (MemberBase.DefineAccessor): Renamed to DefineMethod(), added
4650         `CallingConventions cc' and `Attributes opt_attrs' arguments.
4651         (MemberBase.ApplyAttributes): New virtual method; applies the
4652         attributes to a method or accessor.
4653         (MemberBase.ApplyObsoleteAttribute): New protected virtual method.
4654         (MemberBase.ApplyConditionalAttribute): Likewise.
4655         (MemberBase.ApplyDllImportAttribute): Likewise.
4656         (MemberBase.CheckAbstractAndExternal): Likewise.
4657         (MethodCore.ParameterTypes): This is now a property instead of a
4658         method, it's initialized from DoDefineParameters().
4659         (MethodCore.ParameterInfo): Removed the set accessor.
4660         (MethodCore.DoDefineParameters): New protected virtual method to
4661         initialize ParameterTypes and ParameterInfo.
4662         (Method.GetReturnType): We can now simply return the MemberType.
4663         (Method.GetMethodFlags): Override the MemberBase version and add
4664         the conditional flags.
4665         (Method.CheckBase): Moved some code from Define() here, call
4666         DoDefineParameters() here.
4667         (Method.Define): Use DoDefine() and DefineMethod() from MemberBase
4668         here to avoid some larger code duplication.
4669         (Property.Emit, Indexer.Emit): Call CheckAbstractAndExternal() to
4670         ensure that abstract and external accessors don't declare a body.
4671
4672         * attribute.cs (Attribute.GetValidPieces): Make this actually work:
4673         `System.Attribute.GetCustomAttributes (attr.Type)' does a recursive
4674         lookup in the attribute's parent classes, so we need to abort as soon
4675         as we found the first match.
4676         (Attribute.Obsolete_GetObsoleteMessage): Return the empty string if
4677         the attribute has no arguments.
4678
4679         * typemanager.cs (TypeManager.AddMethod): Now takes a MemberBase instead
4680         of a Method.
4681
4682 2002-07-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
4683
4684         * cs-parser.jay: reverted previous patch.
4685
4686 2002-07-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
4687
4688         * cs-parser.jay: fixed bug #22119.
4689
4690 2002-07-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
4691
4692         * attribute.cs: fixed compilation. The error was:
4693         "attribute.cs(571,17): error CS0177: The out parameter 'is_error' must 
4694         be assigned to before control leaves the current method."
4695         [FIXME:  Filed as bug #28186: MCS must report this error.]
4696
4697 2002-07-25  Martin Baulig  <martin@gnome.org>
4698
4699         * attribute.cs (Attribute.Conditional_GetConditionName): New static
4700         method to pull the condition name ouf of a Conditional attribute.
4701         (Attribute.Obsolete_GetObsoleteMessage): New static method to pull
4702         the obsolete message and error flag out of an Obsolete attribute.
4703
4704         * class.cs (Method.GetMethodFlags): New public method to get the
4705         TypeManager.MethodFlags for this method.
4706         (Method.ApplyConditionalAttribute, Method.ApplyObsoleteAttribute): New
4707         private methods.
4708         (Method.Define): Get and apply the Obsolete and Conditional attributes;
4709         if we're overriding a virtual function, set the new private variable
4710         `parent_method'; call the new TypeManager.AddMethod().
4711
4712         * typemanager.cs (TypeManager.AddMethod): New static method.  Stores
4713         the MethodBuilder and the Method in a PtrHashtable.
4714         (TypeManager.builder_to_method): Added for this purpose.
4715         (TypeManager.MethodFlags): Added IsObsoleteError.
4716         (TypeManager.GetMethodFlags): Added `Location loc' argument.  Lookup
4717         Obsolete and Conditional arguments in MethodBuilders.  If we discover
4718         an Obsolete attribute, emit an appropriate warning 618 / error 619 with
4719         the message from the attribute.
4720
4721 2002-07-24  Martin Baulig  <martin@gnome.org>
4722
4723         * cs-tokenizer.cs: Eat up trailing whitespaces and one-line comments in
4724         preprocessor directives, ensure that the argument to #define/#undef is
4725         exactly one identifier and that it's actually an identifier.
4726
4727         Some weeks ago I did a `#define DEBUG 1' myself and wondered why this
4728         did not work ....
4729
4730 2002-07-24  Martin Baulig  <martin@gnome.org>
4731
4732         * statement.cs (Foreach.ForeachHelperMethods): Added `Type element_type',
4733         initialize it to TypeManager.object_type in the constructor.
4734         (Foreach.GetEnumeratorFilter): Set `hm.element_type' to the return type
4735         of the `hm.get_current' method if we're using the collection pattern.
4736         (Foreach.EmitCollectionForeach): Use `hm.element_type' as the source type
4737         for the explicit conversion to make it work when we're using the collection
4738         pattern and the `Current' property has a different return type than `object'.
4739         Fixes #27713.
4740
4741 2002-07-24  Martin Baulig  <martin@gnome.org>
4742
4743         * delegate.cs (Delegate.VerifyMethod): Simply return null if the method
4744         does not match, but don't report any errors.  This method is called in
4745         order for all methods in a MethodGroupExpr until a matching method is
4746         found, so we don't want to bail out if the first method doesn't match.
4747         (NewDelegate.DoResolve): If none of the methods in the MethodGroupExpr
4748         matches, report the 123.  Fixes #28070.
4749
4750 2002-07-24  Martin Baulig  <martin@gnome.org>
4751
4752         * expression.cs (ArrayAccess.EmitStoreOpcode): Moved the
4753         TypeManager.TypeToCoreType() to the top of the method so the
4754         following equality checks will work.  Fixes #28107.
4755
4756 2002-07-24  Martin Baulig  <martin@gnome.org>
4757
4758         * cfold.cs (ConstantFold.DoConstantNumericPromotions): "If either
4759         operand is of type uint, and the other operand is of type sbyte,
4760         short or int, the operands are converted to type long." -
4761         Actually do what this comment already told us.  Fixes bug #28106,
4762         added test-150.cs.
4763
4764 2002-07-24  Martin Baulig  <martin@gnome.org>
4765
4766         * class.cs (MethodBase): New abstract class.  This is now a base
4767         class for Property, Indexer and Event to avoid some code duplication
4768         in their Define() and DefineMethods() methods.
4769         (MethodBase.DoDefine, MethodBase.DefineAccessor): Provide virtual
4770         generic methods for Define() and DefineMethods().
4771         (FieldBase): Derive from MemberBase, not MemberCore.
4772         (Property): Derive from MemberBase, not MemberCore.
4773         (Property.DefineMethod): Moved all the code from this method to the
4774         new MethodBase.DefineAccessor(), just call it with appropriate
4775         argumetnts.
4776         (Property.Define): Call the new Property.DoDefine(), this does some
4777         sanity checks and we don't need to duplicate the code everywhere.
4778         (Event): Derive from MemberBase, not MemberCore.
4779         (Event.Define): Use the new MethodBase.DefineAccessor() to define the
4780         accessors, this will also make them work with interface events.
4781         (Indexer): Derive from MemberBase, not MemberCore.
4782         (Indexer.DefineMethod): Removed, call MethodBase.DefineAccessor() insstead.
4783         (Indexer.Define): Use the new MethodBase functions.
4784
4785         * interface.cs (InterfaceEvent.InterfaceEvent): Added `Location loc'
4786         argument to the constructor.
4787         (Interface.FindMembers): Added support for interface events.
4788         (Interface.PopluateEvent): Implemented.
4789
4790         Added test-149.cs for this.  This also fixes bugs #26067 and #24256.
4791
4792 2002-07-22  Miguel de Icaza  <miguel@ximian.com>
4793
4794         * class.cs (TypeContainer.AddMethod): Adding methods do not use IsValid,
4795         but this is required to check for a method name being the same as
4796         the containing class.  
4797
4798         Handle this now.
4799
4800 2002-07-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
4801
4802         * interface.cs: initialize variable.
4803
4804 2002-07-23  Martin Baulig  <martin@gnome.org>
4805
4806         Implemented the IndexerName attribute in interfaces.
4807
4808         * class.cs (TypeContainer.DefineIndexers): Don't set the indexer
4809         name if this is an explicit interface implementation.
4810         (Indexer.InterfaceIndexerName): New public variable.  If we're
4811         implementing an interface indexer, this is the IndexerName in that
4812         interface.  Otherwise, it's the IndexerName.
4813         (Indexer.DefineMethod): If we're implementing interface indexer,
4814         set InterfaceIndexerName.  Use the new Pending.IsInterfaceIndexer
4815         and Pending.ImplementIndexer methods.
4816         (Indexer.Define): Also define the PropertyBuilder if we're
4817         implementing an interface indexer and this is neither an explicit
4818         interface implementation nor do the IndexerName match the one in
4819         the interface.
4820
4821         * pending.cs (TypeAndMethods): Added `MethodInfo [] need_proxy'.
4822         If a method is defined here, then we always need to create a proxy
4823         for it.  This is used when implementing interface indexers.
4824         (Pending.IsInterfaceIndexer): New public method.
4825         (Pending.ImplementIndexer): New public method.
4826         (Pending.InterfaceMethod): Added `MethodInfo need_proxy' argument.
4827         This is used when implementing interface indexers to define a proxy
4828         if necessary.
4829         (Pending.VerifyPendingMethods): Look in the `need_proxy' array and
4830         define a proxy if necessary.
4831
4832         * interface.cs (Interface.IndexerName): New public variable.
4833         (Interface.PopulateIndexer): Set the IndexerName.
4834         (Interface.DefineIndexers): New private method.  Populate all the
4835         indexers and make sure their IndexerNames match.
4836
4837         * typemanager.cs (IndexerPropertyName): Added support for interface
4838         indexers.
4839
4840 2002-07-22  Martin Baulig  <martin@gnome.org>
4841
4842         * codegen.cs (EmitContext.HasReturnLabel): New public variable.
4843         (EmitContext.EmitTopBlock): Always mark the ReturnLabel and emit a
4844         ret if HasReturnLabel.
4845         (EmitContext.TryCatchLevel, LoopBeginTryCatchLevel): New public
4846         variables.
4847
4848         * statement.cs (Do.Emit, While.Emit, For.Emit, Foreach.Emit): Save
4849         and set the ec.LoopBeginTryCatchLevel.
4850         (Try.Emit): Increment the ec.TryCatchLevel while emitting the block.
4851         (Continue.Emit): If the ec.LoopBeginTryCatchLevel is smaller than
4852         the current ec.TryCatchLevel, the branch goes out of an exception
4853         block.  In this case, we need to use Leave and not Br.
4854
4855 2002-07-22  Martin Baulig  <martin@gnome.org>
4856
4857         * statement.cs (Try.Emit): Emit an explicit ret after the end of the
4858         block unless the block does not always return or it is contained in
4859         another try { ... } catch { ... } block.  Fixes bug #26506.
4860         Added verify-1.cs to the test suite.
4861
4862 2002-07-22  Martin Baulig  <martin@gnome.org>
4863
4864         * statement.cs (Switch.TableSwitchEmit): If we don't have a default,
4865         then we do not always return.  Fixes bug #24985.
4866
4867 2002-07-22  Martin Baulig  <martin@gnome.org>
4868
4869         * expression.cs (Invocation.OverloadedResolve): Do the BetterFunction()
4870         lookup on a per-class level; ie. walk up the class hierarchy until we
4871         found at least one applicable method, then choose the best among them.
4872         Fixes bug #24463 and test-29.cs.
4873
4874 2002-07-22  Martin Baulig  <martin@gnome.org>
4875
4876         * typemanager.cs (TypeManager.ArrayContainsMethod): Don't check the
4877         return types of the methods.  The return type is not part of the
4878         signature and we must not check it to make the `new' modifier work.
4879         Fixes bug #27999, also added test-147.cs.
4880         (TypeManager.TypeToCoreType): Added TypeManager.type_type.
4881
4882         * expression.cs (Invocation.DoResolve): Call TypeManager.TypeToCoreType()
4883         on the method's return type.
4884
4885 2002-07-21  Martin Baulig  <martin@gnome.org>
4886
4887         * assign.cs: Make this work if the rightmost source is a constant and
4888         we need to do an implicit type conversion.  Also adding a few more tests
4889         to test-38.cs which should have caught this.
4890
4891         * makefile.gnu: Disable debugging, there's already the mcs-mono2.exe
4892         target in the makefile for this.  The makefile.gnu is primarily intended
4893         for end-users who don't want to debug the compiler.
4894
4895 2002-07-21  Martin Baulig  <martin@gnome.org>
4896
4897         * assign.cs: Improved the Assign class so it can now handle embedded
4898         assignments (X = Y = Z = something).  As a side-effect this'll now also
4899         consume less local variables.  test-38.cs now passes with MCS, added
4900         a few new test cases to that test.
4901
4902 2002-07-20  Martin Baulig  <martin@gnome.org>
4903
4904         * expression.cs (Binary.EmitBranchable): Emit correct unsigned branch
4905         instructions.  Fixes bug #27977, also added test-146.cs.
4906
4907 2002-07-19  Gonzalo Paniagua Javier <gonzalo@ximian.com>
4908
4909         * cs-tokenizer.cs: fixed getHex ().
4910
4911 2002-07-19  Martin Baulig  <martin@gnome.org>
4912
4913         * expression.cs (Invocation.EmitParams): Use TypeManager.LookupType(),
4914         not Type.GetType() to lookup the array type.  This is needed when
4915         we're constructing an array of a user-defined type.
4916         (ArrayAccess.EmitDynamicInitializers): Only emit the Ldelema for
4917         single-dimensional arrays, but also for single-dimensial arrays of
4918         type decimal.
4919
4920 2002-07-19  Martin Baulig  <martin@gnome.org>
4921
4922         * expression.cs (New.DoEmit): Create a new LocalTemporary each time
4923         this function is called, it's not allowed to share LocalBuilders
4924         among ILGenerators.
4925
4926 2002-07-19  Martin Baulig  <martin@gnome.org>
4927
4928         * expression.cs (Argument.Resolve): Report an error 118 when trying
4929         to pass a type as argument.
4930
4931 2002-07-18  Martin Baulig  <martin@gnome.org>
4932
4933         * ecore.cs (Expression.ImplicitNumericConversion): Don't emit a
4934         Conv_R_Un for the signed `long' type.
4935
4936 2002-07-15  Miguel de Icaza  <miguel@ximian.com>
4937
4938         * expression.cs (MemberAccess.DoResolve): Do not reuse the field
4939         `expr' for the temporary result, as that will fail if we do
4940         multiple resolves on the same expression.
4941
4942 2002-07-05  Miguel de Icaza  <miguel@ximian.com>
4943
4944         * ecore.cs (SimpleNameResolve): Use ec.DeclSpace instead of
4945         ec.TypeContainer for looking up aliases. 
4946
4947         * class.cs (TypeContainer): Remove LookupAlias from here.
4948
4949         * decl.cs (DeclSpace); Move here.
4950
4951 2002-07-01  Miguel de Icaza  <miguel@ximian.com>
4952
4953         * class.cs (FindMembers): Only call filter if the constructor
4954         bulider is not null.
4955
4956         Also handle delegates in `NestedTypes' now.  Now we will perform
4957         type lookups using the standard resolution process.  This also
4958         fixes a bug.
4959
4960         * decl.cs (DeclSpace.ResolveType): New type resolution routine.
4961         This uses Expressions (the limited kind that can be parsed by the
4962         tree) instead of strings.
4963
4964         * expression.cs (ComposedCast.ToString): Implement, used to flag
4965         errors since now we have to render expressions.
4966
4967         (ArrayCreation): Kill FormElementType.  Use ComposedCasts in
4968         FormArrayType. 
4969
4970         * ecore.cs (SimpleName.ToString): ditto.
4971
4972         * cs-parser.jay: Instead of using strings to assemble types, use
4973         Expressions to assemble the type (using SimpleName, ComposedCast,
4974         MemberAccess).  This should fix the type lookups in declarations,
4975         because we were using a different code path for this.
4976
4977         * statement.cs (Block.Resolve): Continue processing statements
4978         even when there is an error.
4979
4980 2002-07-17  Miguel de Icaza  <miguel@ximian.com>
4981
4982         * class.cs (Event.Define): Also remove the `remove' method from
4983         the list of pending items.
4984
4985         * expression.cs (ParameterReference): Use ldarg.N (0..3) to
4986         generate more compact code. 
4987
4988 2002-07-17  Martin Baulig  <martin@gnome.org>
4989
4990         * const.cs (Const.LookupConstantValue): Add support for constant
4991         `unchecked' and `checked' expressions.
4992         Also adding test case test-140.cs for this.
4993
4994 2002-07-17  Martin Baulig  <martin@gnome.org>
4995
4996         * statement.cs (Foreach.GetEnumeratorFilter): When compiling corlib,
4997         check whether mi.ReturnType implements the IEnumerator interface; the
4998         `==' and the IsAssignableFrom() will fail in this situation.
4999
5000 2002-07-16  Ravi Pratap  <ravi@ximian.com>
5001
5002         * ecore.cs (SimpleName.SimpleNameResolve) : Apply Gonzalo's fix 
5003         here too.
5004
5005 2002-07-16  Gonzalo Paniagua Javier <gonzalo@ximian.com>
5006
5007         * expression.cs: fixed bug #27811.
5008
5009 2002-07-14  Miguel de Icaza  <miguel@ximian.com>
5010
5011         * expression.cs (ParameterReference.AddressOf): Patch from Paolo
5012         Molaro: when we are a ref, the value already contains a pointer
5013         value, do not take the address of it.
5014
5015 2002-07-14 Rafael Teixeira <rafaelteixeirabr@hotmail.com>
5016         * removed mb-parser.jay and mb-tokenizer.cs
5017
5018 Sat Jul 13 19:38:03 CEST 2002 Paolo Molaro <lupus@ximian.com>
5019
5020         * expression.cs: check against the building corlib void type.
5021
5022 Sat Jul 13 19:35:58 CEST 2002 Paolo Molaro <lupus@ximian.com>
5023
5024         * ecore.cs: fix for valuetype static readonly fields: when 
5025         initializing them, we need their address, not the address of a copy.
5026
5027 Sat Jul 13 17:32:53 CEST 2002 Paolo Molaro <lupus@ximian.com>
5028
5029         * typemanager.cs: register also enum_type in corlib.
5030
5031 Sat Jul 13 15:59:47 CEST 2002 Paolo Molaro <lupus@ximian.com>
5032
5033         * class.cs: allow calling this (but not base) initializers in structs.
5034
5035 Sat Jul 13 15:12:06 CEST 2002 Paolo Molaro <lupus@ximian.com>
5036
5037         * ecore.cs: make sure we compare against the building base types
5038         in GetTypeSize ().
5039
5040 Sat Jul 13 15:10:32 CEST 2002 Paolo Molaro <lupus@ximian.com>
5041
5042         * typemanager.cs: fix TypeToCoreType() to handle void and object
5043         (corlib gets no more typerefs after this change).
5044
5045 2002-07-12  Miguel de Icaza  <miguel@ximian.com>
5046
5047         * expression.cs (ArrayCreation.EmitArrayArguments): use
5048         Conv.Ovf.U4 for unsigned and Conv.Ovf.I4 for signed.
5049
5050         (ArrayAccess.LoadArrayAndArguments): Use Conv_Ovf_I and
5051         Conv_Ovf_I_Un for the array arguments.  Even if C# allows longs as
5052         array indexes, the runtime actually forbids them.
5053
5054         * ecore.cs (ExpressionToArrayArgument): Move the conversion code
5055         for array arguments here.
5056
5057         * expression.cs (EmitLoadOpcode): System.Char is a U2, use that
5058         instead of the default for ValueTypes.
5059
5060         (New.DoEmit): Use IsValueType instead of
5061         IsSubclassOf (value_type)
5062         (New.DoResolve): ditto.
5063         (Invocation.EmitCall): ditto.
5064
5065         * assign.cs (Assign): ditto.
5066
5067         * statement.cs (Unsafe): Ok, so I got the semantics wrong.
5068         Statements *are* currently doing part of their resolution during
5069         Emit.  
5070
5071         Expressions do always resolve during resolve, but statements are
5072         only required to propagate resolution to their children.
5073
5074 2002-07-11  Miguel de Icaza  <miguel@ximian.com>
5075
5076         * driver.cs (CSCParseOption): Finish the /r: and /lib: support.
5077
5078         (LoadAssembly): Do not add the dll if it is already specified
5079         
5080         (MainDriver): Add the System directory to the link path at the end,
5081         after all the other -L arguments. 
5082
5083         * expression.cs (ArrayAccess.EmitLoadOpcode): I was using the
5084         wrong opcode for loading bytes and bools (ldelem.i1 instead of
5085         ldelem.u1) and using the opposite for sbytes.
5086
5087         This fixes Digger, and we can finally run it.
5088
5089         * driver.cs (UnixParseOption): Move the option parsing here.  
5090         (CSCParseOption): Implement CSC-like parsing of options.
5091
5092         We now support both modes of operation, the old Unix way, and the
5093         new CSC-like way.  This should help those who wanted to make cross
5094         platform makefiles.
5095
5096         The only thing broken is that /r:, /reference: and /lib: are not
5097         implemented, because I want to make those have the same semantics
5098         as the CSC compiler has, and kill once and for all the confussion
5099         around this.   Will be doing this tomorrow.
5100
5101         * statement.cs (Unsafe.Resolve): The state is checked during
5102         resolve, not emit, so we have to set the flags for IsUnsfe here.
5103
5104 2002-07-10  Miguel de Icaza  <miguel@ximian.com>
5105
5106         * expression.cs (MemberAccess.ResolveMemberAccess): Since we can
5107         not catch the Error_ObjectRefRequired in SimpleName (as it is
5108         possible to have a class/instance variable name that later gets
5109         deambiguated), we have to check this here.      
5110
5111 2002-07-10  Ravi Pratap  <ravi@ximian.com>
5112
5113         * class.cs (TypeContainer.GetFieldFromEvent): Move away from here,
5114         make static and put into Expression.
5115
5116         (Event.Define): Register the private field of the event with the 
5117         TypeManager so that GetFieldFromEvent can get at it.
5118
5119         (TypeManager.RegisterPrivateFieldOfEvent): Implement to
5120         keep track of the private field associated with an event which
5121         has no accessors.
5122
5123         (TypeManager.GetPrivateFieldOfEvent): Implement to get at the
5124         private field.
5125
5126         * ecore.cs (GetFieldFromEvent): RE-write to use the above methods.
5127         
5128 2002-07-10  Miguel de Icaza  <miguel@ximian.com>
5129
5130         * expression.cs (Binary.EmitBranchable): this routine emits the
5131         Binary expression in a branchable context.  This basically means:
5132         we need to branch somewhere, not just get the value on the stack.
5133
5134         This works together with Statement.EmitBoolExpression.
5135
5136         * statement.cs (Statement.EmitBoolExpression): Use
5137         EmitBranchable. 
5138
5139 2002-07-09  Miguel de Icaza  <miguel@ximian.com>
5140
5141         * statement.cs (For): Reduce the number of jumps in loops.
5142
5143         (For): Implement loop inversion for the For statement.
5144
5145         (Break): We can be breaking out of a Try/Catch controlled section
5146         (foreach might have an implicit try/catch clause), so we need to
5147         use Leave instead of Br.
5148
5149         * ecore.cs (FieldExpr.AddressOf): Fix for test-139 (augmented
5150         now).  If the instace expression supports IMemoryLocation, we use
5151         the AddressOf method from the IMemoryLocation to extract the
5152         address instead of emitting the instance.
5153
5154         This showed up with `This', as we were emitting the instance
5155         always (Emit) instead of the Address of This.  Particularly
5156         interesting when This is a value type, as we dont want the Emit
5157         effect (which was to load the object).
5158         
5159 2002-07-08  Miguel de Icaza  <miguel@ximian.com>
5160
5161         * attribute.cs: Pass the entry point to the DefinePInvokeMethod
5162
5163         * statement.cs (Checked): Set the CheckedState during the resolve
5164         process too, as the ConvCast operations track the checked state on
5165         the resolve process, and not emit.
5166
5167         * cs-parser.jay (namespace_member_declaration): Flag that we have
5168         found a declaration when we do.  This is used to flag error 1529
5169
5170         * driver.cs: Report ok when we display the help only.
5171
5172 2002-07-06  Andrew Birkett  <adb@tardis.ed.ac.uk>
5173
5174         * cs-tokenizer.cs (xtoken): Improve handling of string literals.
5175
5176 2002-07-04  Miguel de Icaza  <miguel@ximian.com>
5177
5178         * cs-tokenizer.cs (define): We also have to track locally the
5179         defines.  AllDefines is just used for the Conditional Attribute,
5180         but we also need the local defines for the current source code. 
5181
5182 2002-07-03  Miguel de Icaza  <miguel@ximian.com>
5183
5184         * statement.cs (While, For, Do): These loops can exit through a
5185         Break statement, use this information to tell whether the
5186         statement is the last piece of code.
5187
5188         (Break): Flag that we break.
5189
5190         * codegen.cs (EmitContexts): New `Breaks' state variable.
5191
5192 2002-07-03  Martin Baulig  <martin@gnome.org>
5193
5194         * class.cs (TypeContainer.MethodModifiersValid): Allow override
5195         modifiers in method declarations in structs.  Otherwise, you won't
5196         be able to override things like Object.Equals().
5197
5198 2002-07-02  Miguel de Icaza  <miguel@ximian.com>
5199
5200         * class.cs (Method, Property, Indexer): Do not allow the public
5201         modifier to be used in explicit interface implementations.
5202
5203         (TypeContainer.MethodModifiersValid): Catch virtual, abstract and
5204         override modifiers in method declarations in structs
5205
5206 2002-07-02   Andrew Birkett <adb@tardis.ed.ac.uk>
5207
5208         * cs-tokenizer.cs (adjust_int, adjust_real): Do not abort on
5209         integer or real overflow, report an error
5210
5211 2002-07-02  Martin Baulig  <martin@gnome.org>
5212
5213         * typemanager.cs (TypeManager.InitCoreTypes): When compiling
5214         corlib, dynamically call AssemblyBuilder.SetCorlibTypeBuilders()
5215         to tell the runtime about our newly created System.Object and
5216         System.ValueType types.
5217
5218 2002-07-02  Miguel de Icaza  <miguel@ximian.com>
5219
5220         * expression.cs (This): Use Stobj/Ldobj when we are a member of a
5221         struct instead of Ldarg/Starg.
5222
5223 2002-07-02  Martin Baulig  <martin@gnome.org>
5224
5225         * expression.cs (Indirection.Indirection): Call
5226         TypeManager.TypeToCoreType() on `expr.Type.GetElementType ()'.
5227
5228 2002-07-02  Martin Baulig  <martin@gnome.org>
5229
5230         * expression.cs (ArrayAccess.EmitStoreOpcode): If the type is a
5231         ValueType, call TypeManager.TypeToCoreType() on it.
5232         (Invocations.EmitParams): Call TypeManager.TypeToCoreType() on
5233         the OpCodes.Newarr argument.
5234
5235 2002-07-02  Martin Baulig  <martin@gnome.org>
5236
5237         * expression.cs (Invocation.EmitCall): When compiling corlib,
5238         replace all calls to the system's System.Array type to calls to
5239         the newly created one.
5240
5241         * typemanager.cs (TypeManager.InitCodeHelpers): Added a few more
5242         System.Array methods.
5243         (TypeManager.InitCoreTypes): When compiling corlib, get the methods
5244         from the system's System.Array type which must be replaced.
5245
5246 Tue Jul 2 19:05:05 CEST 2002 Paolo Molaro <lupus@ximian.com>
5247
5248         * typemanager.cs: load unverifiable_code_ctor so we can build
5249         corlib using the correct type. Avoid using GetTypeCode() with
5250         TypeBuilders.
5251         * rootcontext.cs: uses TypeManager.unverifiable_code_ctor and
5252         TypeManager.object_type to allow building corlib.
5253
5254 Tue Jul 2 19:03:19 CEST 2002 Paolo Molaro <lupus@ximian.com>
5255
5256         * ecore.cs: handle System.Enum separately in LoadFromPtr().
5257
5258 2002-07-01  Martin Baulig  <martin@gnome.org>
5259
5260         * class.cs: Make the last change actually work, we need to check
5261         whether `ifaces != null' to avoid a crash.
5262
5263 Mon Jul 1 16:15:03 CEST 2002 Paolo Molaro <lupus@ximian.com>
5264
5265         * class.cs: when we build structs without fields that implement
5266         interfaces, we need to add the interfaces separately, since there is
5267         no API to both set the size and add the interfaces at type creation
5268         time.
5269
5270 Mon Jul 1 14:50:47 CEST 2002 Paolo Molaro <lupus@ximian.com>
5271
5272         * expression.cs: the dimension arguments to the array constructors
5273         need to be converted if they are a long.
5274
5275 Mon Jul 1 12:26:12 CEST 2002 Paolo Molaro <lupus@ximian.com>
5276
5277         * class.cs: don't emit ldarg.0 if there is no parent constructor
5278         (fixes showstopper for corlib).
5279
5280 2002-06-29  Martin Baulig  <martin@gnome.org>
5281
5282         MCS now compiles corlib on GNU/Linux :-)
5283
5284         * attribute.cs (Attribute.ApplyAttributes): Treat Accessors like Method,
5285         ie. check for MethodImplOptions.InternalCall.
5286
5287         * class.cs (TypeContainer.DefineType): When compiling corlib, both parent
5288         and TypeManager.attribute_type are null, so we must explicitly check
5289         whether parent is not null to find out whether it's an attribute type.
5290         (Property.Emit): Always call Attribute.ApplyAttributes() on the GetBuilder
5291         and SetBuilder, not only if the property is neither abstract nor external.
5292         This is necessary to set the MethodImplOptions on the accessor methods.
5293         (Indexer.Emit): Call Attribute.ApplyAttributes() on the GetBuilder and
5294         SetBuilder, see Property.Emit().
5295
5296         * rootcontext.cs (RootContext.PopulateTypes): When compiling corlib, don't
5297         populate "System.Object", "System.ValueType" and "System.Attribute" since
5298         they've already been populated from BootCorlib_PopulateCoreTypes().
5299
5300 2002-06-29  Martin Baulig  <martin@gnome.org>
5301
5302         * ecore.cs (Expression.ImplicitReferenceConversionExists): If expr
5303         is the NullLiteral, we also need to make sure that target_type is not
5304         an enum type.   
5305
5306 2002-06-29  Martin Baulig  <martin@gnome.org>
5307
5308         * rootcontext.cs (RootContext.ResolveCore): We must initialize
5309         `TypeManager.multicast_delegate_type' and `TypeManager.delegate_type'
5310         before calling BootstrapCorlib_ResolveDelegate ().
5311
5312 2002-06-27  Gonzalo Paniagua Javier <gonzalo@ximian.com>
5313
5314         * statement.cs: fixed build-breaker. All tests passed ok.
5315
5316 2002-06-27  Martin Baulig  <martin@gnome.org>
5317
5318         * typemanager.cs (TypeManager.VerifyUnManaged): Added explicit check
5319         for System.Decimal when compiling corlib.
5320
5321 2002-06-27  Martin Baulig  <martin@gnome.org>
5322
5323         * statement.cs (Switch.TableSwitchEmit): Make this work with empty
5324         switch blocks which contain nothing but a default clause.
5325
5326 2002-06-26  Andrew  <adb@tardis.ed.ac.uk>
5327
5328        * ../errors/cs1501-3.cs: Added new test for struct ctr typechecks.
5329
5330 2002-06-27  Martin Baulig  <martin@gnome.org>
5331
5332         * ecore.cs (PropertyExpr.PropertyExpr): Call
5333         TypeManager.TypeToCoreType() on the `pi.PropertyType'.
5334
5335         * typemanager.cs (TypeManager.TypeToCoreType): Return if the type
5336         is already a TypeBuilder.
5337
5338 2002-06-27  Martin Baulig  <martin@gnome.org>
5339
5340         * ecore.cs (Expression.ImplicitReferenceConversionExists): Use
5341         `target_type == TypeManager.array_type', not IsAssignableFrom() in
5342         the "from an array-type to System.Array" case.  This makes it work
5343         when compiling corlib.
5344
5345 2002-06-27  Martin Baulig  <martin@gnome.org>
5346
5347         * ecore.cs (Expression.SimpleNameResolve): If the expression is a
5348         non-static PropertyExpr, set its InstanceExpression.  This makes
5349         the `ICollection.Count' property work in System/Array.cs.
5350
5351 2002-06-25  Andrew Birkett  <adb@tardis.ed.ac.uk>
5352
5353         * driver.cs: Made error handling more consistent.  Errors now
5354         tracked by Report class, so many methods which used to return int
5355         now return void.  Main() now prints success/failure and 
5356         errors/warnings message.
5357
5358         Renamed '--probe' compiler argument to '--expect-error'.  Removed
5359         the magic number return values (123 and 124).  Now, if the
5360         expected error occurs, the compiler exits with success (exit value
5361         0).  If the compilation completes without seeing that particular
5362         error, the compiler exits with failure (exit value 1).  The
5363         makefile in mcs/errors has been changed to handle the new behaviour.
5364
5365         * report.cs: Made 'expected error' number a property and renamed
5366         it from 'Probe' to 'ExpectedError'.
5367
5368         * genericparser.cs: Removed error handling support, since it is
5369         now all done by Report class.
5370
5371         * cs-parser.jay, mb-parser.jay: Errors are tracked by Report
5372         class, so parse() no longer returns an int.
5373
5374         * namespace.cs: Use Report.Error instead of GenericParser.error
5375
5376 2002-06-22  Miguel de Icaza  <miguel@ximian.com>
5377
5378         * class.cs (TypeContainer.AddMethod, TypeContainer.AddIndexer,
5379         TypeContainer.AddOperator): At the front of the list put the
5380         explicit implementations, so they get resolved/defined first. 
5381
5382 2002-06-21  Miguel de Icaza  <miguel@ximian.com>
5383
5384         * class.cs (TypeContainer.VerifyImplements): Verifies that a given
5385         interface type is implemented by this TypeContainer.  Used during
5386         explicit interface implementation.
5387
5388         (Property.Define, Indexer.Define, Method.Define): Validate that
5389         the given interface in the explicit implementation is one of the
5390         base classes for the containing type.
5391
5392         Also if we are explicitly implementing an interface, but there is
5393         no match in the pending implementation table, report an error.
5394
5395         (Property.Define): Only define the property if we are
5396         not explicitly implementing a property from an interface.  Use the
5397         correct name also for those properties (the same CSC uses,
5398         although that is really not needed).
5399         
5400         (Property.Emit): Do not emit attributes for explicitly implemented
5401         properties, as there is no TypeBuilder.
5402
5403         (Indexer.Emit): ditto.
5404
5405         Hiding then means that we do not really *implement* a pending
5406         implementation, which makes code fail.
5407
5408 2002-06-22  Martin Baulig  <martin@gnome.org>
5409
5410         * ecore.cs (Expression.Constantify): Call TypeManager.TypeToCoreType() on
5411         the return value of Object.GetType().  [FIXME: we need to do this whenever
5412         we get a type back from the reflection library].
5413
5414 Fri Jun 21 13:37:57 CEST 2002 Paolo Molaro <lupus@ximian.com>
5415
5416         * typemanager.cs: make ExpandInterfaces() slip duplicated interfaces.
5417
5418 2002-06-20  Miguel de Icaza  <miguel@ximian.com>
5419
5420         * attribute.cs: Return null if we can not look up the type.
5421
5422         * class.cs (TypeContainer.GetClassBases): Use ExpandInterfaces on
5423         the interface types found.
5424
5425         * interface.cs (Interface.GetInterfaceBases): Use ExpandInterfaces on the
5426         interface types found.
5427
5428         * typemanager.cs (GetInterfaces): Make this routine returns alll
5429         the interfaces and work around the lame differences between
5430         System.Type and System.Reflection.Emit.TypeBuilder in the results
5431         result for GetInterfaces.
5432         
5433         (ExpandInterfaces): Given an array of interface types, expand and
5434         eliminate repeated ocurrences of an interface.  This expands in
5435         context like: IA; IB : IA; IC : IA, IB; the interface "IC" to
5436         be IA, IB, IC.
5437         
5438 2002-06-21  Martin Baulig  <martin@gnome.org>
5439
5440         * typemanager.cs (TypeManager.EnumToUnderlying): It's now safe to call this function
5441         on System.Enum.
5442
5443 2002-06-21  Martin Baulig  <martin@gnome.org>
5444
5445         * typemanager.cs (TypeManager.TypeToCoreType): New function.  When compiling corlib
5446         and called with one of the core types, return the corresponding typebuilder for
5447         that type.
5448
5449         * expression.cs (ArrayAccess.DoResolve): Call TypeManager.TypeToCoreType() on the
5450         element type.
5451
5452 2002-06-21  Martin Baulig  <martin@gnome.org>
5453
5454         * ecore.cs (Expression.ExplicitReferenceConversionExists): Use
5455         `target_type.IsArray' instead of `target_type.IsSubclassOf (TypeManager.array_type)'.
5456         (Expression.ConvertReferenceExplicit): Likewise.
5457
5458         * expression.cs (ElementAccess.DoResolve): Likewise.
5459         (ElementAccess.DoResolveLValue): Likewise.
5460
5461 2002-06-10  Martin Baulig  <martin@gnome.org>
5462
5463         * interface.cs (Interface.PopulateIndexer): When creating the setter, we need to
5464         add the "value" parameter to the parameter list.
5465
5466         * statement.cs (Fixed.Emit): Pass the return value of the child block's Emit()
5467         to our caller.
5468
5469 2002-06-19  Miguel de Icaza  <miguel@ximian.com>
5470
5471         * expression.cs (ArrayCreation.ExpressionToArrayArgument): Convert
5472         the argument to an int, uint, long or ulong, per the spec.  Also
5473         catch negative constants in array creation.
5474
5475 Thu Jun 20 17:56:48 CEST 2002 Paolo Molaro <lupus@ximian.com>
5476
5477         * class.cs: do not allow the same interface to appear twice in
5478         the definition list.
5479
5480 Wed Jun 19 22:33:37 CEST 2002 Paolo Molaro <lupus@ximian.com>
5481
5482         * ecore.cs: don't use ldlen with System.Array.
5483
5484 Wed Jun 19 20:57:40 CEST 2002 Paolo Molaro <lupus@ximian.com>
5485
5486         * ecore.cs: stobj requires a type argument. Handle indirect stores on enums.
5487
5488 Wed Jun 19 20:17:59 CEST 2002 Paolo Molaro <lupus@ximian.com>
5489
5490         * modifiers.cs: produce correct field attributes for protected
5491         internal. Easy fix so miguel can work on ther harder stuff:-)
5492
5493 2002-06-18  Miguel de Icaza  <miguel@ximian.com>
5494
5495         * pending.cs: New file.  Move the code from class.cs here.
5496         Support clearning the pending flag for all methods (when not doing
5497         explicit interface implementation).
5498
5499 Tue Jun 18 10:36:22 CEST 2002 Paolo Molaro <lupus@ximian.com>
5500
5501         * rootcontext.cs: added a couple more types needed to bootstrap.
5502
5503 2002-06-17  Miguel de Icaza  <miguel@ximian.com>
5504
5505         * typemanager.cs (GetConstructor): Use DeclaredOnly to look the
5506         constructor in the type, instead of any constructor in the type
5507         hierarchy.  Thanks to Paolo for finding this bug (it showed up as
5508         a bug in the Mono runtime when applying the params attribute). 
5509
5510 2002-06-16  Rafael Teixeira  <rafaelteixeirabr@hotmail.com>
5511         * changed namespace.cs to use "GenericParser.error(...)" instead of "CSharpParser.error(...)"
5512
5513 2002-06-14  Rachel Hestilow  <hestilow@ximian.com>
5514
5515         * expression.cs (Unary.ResolveOperator): Use TypeManager
5516         to resolve the type.
5517         
5518 2002-06-13  Ravi Pratap  <ravi@ximian.com>
5519
5520         * cs-parser.jay (enum_member_declaration): Pass in the attributes
5521         attached.
5522
5523         * enum.cs (AddEnumMember): Add support to store the attributes associated 
5524         with each member too.
5525
5526         * attribute.cs (CheckAttribute, ApplyAttributes): Update to handle
5527         field builders too - this takes care of the enum member case.
5528
5529 2002-06-10  Rachel Hestilow  <hestilow@ximian.com>
5530
5531         * typemanager.cs (TypeManager.VerifyUnManaged): Allow
5532         address-of operator on both value types and pointers.
5533         
5534 2002-06-10  Martin Baulig  <martin@gnome.org>
5535
5536         * interface.cs (Interface.PopulateIndexer): Add the indexer's
5537         PropertyBuilder to the `property_builders' list.
5538
5539         * expression.cs (Indexers.GetIndexersForTypeOrInterface): New private method.
5540         (Indexers.GetIndexersForType): Call GetIndexersForTypeOrInterface() on the
5541         `lookup_type' and all its interfaces.  Unfortunately, Type.FindMembers() won't
5542         find any indexers which are inherited from an interface.
5543
5544 2002-06-09  Martin Baulig  <martin@gnome.org>
5545
5546         * const.cs (Const.LookupConstantValue): Convert `Expr' to a literal of
5547         the same type as the constant if necessary.  There's also a test-130.cs
5548         for this.
5549
5550         * enum.cs (Enum.ChangeEnumType): Moved to typemanager.cs and made public.
5551
5552         * typemanager.cs (TypeManager.ChangeType): Previously known as
5553         Enum.ChangeEnumType().
5554
5555 2002-06-09  Martin Baulig  <martin@gnome.org>
5556
5557         * expression.cs (Cast.TryReduce): Added support for consts.
5558
5559 2002-06-08  Ravi Pratap  <ravi@ximian.com>
5560
5561         * class.cs (Accessor): Hold attributes information so we can pass
5562         it along.
5563
5564         * cs-parser.jay (get_accessor_declaration, set_accessor_declaration):
5565         Modify to pass in attributes attached to the methods.
5566
5567         (add_accessor_declaration, remove_accessor_declaration): Ditto.
5568
5569         * attribute.cs (ApplyAttributes, CheckAttribute): Update accordingly
5570         to handle the Accessor kind :-)
5571
5572         * class.cs (Property.Emit, Event.Emit): Apply attributes to the accessors
5573         
5574 2002-06-08  Martin Baulig  <martin@gnome.org>
5575
5576         * expression.cs (Unary.TryReduceNegative): Added support for
5577         ULongConstants.
5578
5579 2002-06-08  Martin Baulig  <martin@gnome.org>
5580
5581         * enum.cs (Enum.LookupEnumValue): Don't report an error if the
5582         name can't be found in the `defined_names' - the caller will do a
5583         MemberLookup in this case and thus find methods in System.Enum
5584         such as Enum.IsDefined().
5585
5586 2002-06-08  Martin Baulig  <martin@gnome.org>
5587
5588         * enum.cs (Enum.ChangeEnumType): This is a custom version of
5589         Convert.ChangeType() which works with TypeBuilder created types.
5590         (Enum.LookupEnumValue, Enum.Define): Use it here.
5591
5592         * class.cs (TypeContainer.RegisterRequiredImplementations): Added
5593         `TypeBuilder.BaseType != null' check.
5594         (TypeContainer.FindMembers): Only lookup parent members if we
5595         actually have a parent.
5596         (Method.EmitDestructor): Added `ec.ContainerType.BaseType != null' check.
5597         (ConstructorInitializer.Resolve): Likewise.
5598
5599         * interface.cs (Interface.FindMembers): Added
5600         `TypeBuilder.BaseType != null' check.
5601
5602         * rootcontext.cs (RootContext.ResolveCore): Added
5603         "System.Runtime.CompilerServices.IndexerNameAttribute" to
5604         classes_second_stage.
5605
5606         * typemanager.cs (TypeManager.InitCoreTypes): Don't initialize
5607         debug_type and trace_type when compiling with --nostdlib.       
5608
5609 2002-06-07  Martin Baulig  <martin@gnome.org>
5610
5611         * class.cs (TypeContainer): Added `have_nonstatic_fields' field.
5612         (AddField): Set it to true when adding a non-static field.
5613         (DefineType): Use `have_nonstatic_fields' to find out whether we
5614         have non-static fields, not `Fields != null'.
5615
5616 2002-06-02  Miguel de Icaza  <miguel@ximian.com>
5617
5618         * ecore.cs (SimpleNameResolve): Removed simple bug (we were
5619         dereferencing a null on the static-field code path)
5620
5621 2002-05-30  Martin Baulig  <martin@gnome.org>
5622
5623         * codegen.cs (InitMonoSymbolWriter): Added `string[] args' argument
5624         to take command line arguments.  Use reflection to call the new
5625         custom `Initialize' function on the symbol writer and pass it the
5626         command line arguments.
5627
5628         * driver.cs (--debug-args): New command line argument to pass command
5629         line arguments to the symbol writer.
5630
5631 2002-05-28  Miguel de Icaza  <miguel@ximian.com>
5632
5633         * assign.cs (DoResolve): Forgot to do the implicit conversion to
5634         the target type for indexers and properties.  Thanks to Joe for
5635         catching this.
5636
5637 2002-05-27  Miguel de Icaza  <miguel@ximian.com>
5638
5639         * typemanager.cs (MethodFlags): returns the method flags
5640         (Obsolete/ShouldIgnore) that control warning emission and whether
5641         the invocation should be made, or ignored. 
5642
5643         * expression.cs (Invocation.Emit): Remove previous hack, we should
5644         not do this on matching a base type, we should do this based on an attribute
5645
5646         Only emit calls to System.Diagnostics.Debug and
5647         System.Diagnostics.Trace if the TRACE and DEBUG defines are passed
5648         on the command line.
5649
5650         * rootcontext.cs: Global settings for tracing and debugging.
5651
5652         * cs-tokenizer.cs (define): New utility function to track
5653         defines.   Set the global settings for TRACE and DEBUG if found.
5654
5655 2002-05-25  Ravi Pratap  <ravi@ximian.com>
5656
5657         * interface.cs (Populate*): Pass in the TypeContainer as well as
5658         the DeclSpace as parameters so that we can create EmitContexts and
5659         then use that to apply attributes etc.
5660
5661         (PopulateMethod, PopulateEvent, PopulateProperty)
5662         (PopulateIndexer): Apply attributes everywhere.
5663
5664         * attribute.cs (CheckAttribute): Include InterfaceMethod, InterfaceEvent
5665         etc.
5666
5667         (ApplyAttributes): Update accordingly.
5668
5669         We now apply interface attributes for all members too.
5670
5671 2002-05-26  Miguel de Icaza  <miguel@ximian.com>
5672
5673         * class.cs (Indexer.Define); Correctly check if we are explicit
5674         implementation (instead of checking the Name for a ".", we
5675         directly look up if the InterfaceType was specified).
5676
5677         Delay the creation of the PropertyBuilder.
5678
5679         Only create the PropertyBuilder if we are not an explicit
5680         interface implementation.   This means that explicit interface
5681         implementation members do not participate in regular function
5682         lookups, and hence fixes another major ambiguity problem in
5683         overload resolution (that was the visible effect).
5684
5685         (DefineMethod): Return whether we are doing an interface
5686         implementation. 
5687         
5688         * typemanager.cs: Temporary hack until we get attributes in
5689         interfaces (Ravi is working on that) and we get IndexerName
5690         support in interfaces.
5691
5692         * interface.cs: Register the indexers as properties.
5693
5694         * attribute.cs (Attribute.Resolve): Catch the error, and emit a
5695         warning, I have verified that this is a bug in the .NET runtime
5696         (JavaScript suffers of the same problem).
5697
5698         * typemanager.cs (MemberLookup): When looking up members for
5699         interfaces, the parent of an interface is the implicit
5700         System.Object (so we succeed in searches of Object methods in an
5701         interface method invocation.  Example:  IEnumerable x;  x.ToString
5702         ()) 
5703
5704 2002-05-25  Miguel de Icaza  <miguel@ximian.com>
5705
5706         * class.cs (Event): Events should also register if they do
5707         implement the methods that an interface requires.
5708
5709         * typemanager.cs (MemberLookup); use the new GetInterfaces
5710         method. 
5711
5712         (GetInterfaces): The code used to lookup interfaces for a type is
5713         used in more than one place, factor it here. 
5714
5715         * driver.cs: Track the errors at the bottom of the file, we kept
5716         on going.
5717
5718         * delegate.cs (NewDelegate.Emit): We have to emit a null as the
5719         instance if the method we are calling is static!
5720
5721 2002-05-24  Miguel de Icaza  <miguel@ximian.com>
5722
5723         * attribute.cs (ApplyAttributes): Make this function filter out
5724         the IndexerName attribute (as that attribute in reality is never
5725         applied) and return the string constant for the IndexerName
5726         attribute. 
5727
5728         * class.cs (TypeContainer.Emit): Validate that all the indexers
5729         have the same IndexerName attribute, and if so, set the
5730         DefaultName attribute on the class. 
5731
5732         * typemanager.cs: The return value might contain other stuff (not
5733         only methods).  For instance, consider a method with an "Item"
5734         property and an Item method.
5735
5736         * class.cs: If there is a problem with the parameter types,
5737         return. 
5738
5739 2002-05-24  Ravi Pratap  <ravi@ximian.com>
5740
5741         * ecore.cs (ImplicitConversionExists): Wrapper function which also
5742         looks at user defined conversion after making a call to 
5743         StandardConversionExists - we need this for overload resolution.
5744
5745         * expression.cs : Update accordingly the various method calls.
5746
5747         This fixes 2 bugs filed against implicit user defined conversions 
5748
5749 2002-05-22  Miguel de Icaza  <miguel@ximian.com>
5750
5751         * statement.cs: Track the result of the assignment.
5752
5753 2002-05-21  Miguel de Icaza  <miguel@ximian.com>
5754
5755         * expression.cs (MemberAccess): Improved error reporting for
5756         inaccessible members.
5757
5758 2002-05-22  Martin Baulig  <martin@gnome.org>
5759
5760         * makefile (mcs-mono2.exe): New target.  This is mcs compiled with
5761         itself with debugging support.
5762
5763 2002-05-22  Martin Baulig  <martin@gnome.org>
5764
5765         * typemanager.cs ("System.Runtime.InteropServices.StructLayoutAttribute"):
5766         Removed, this isn't needed anymore.
5767
5768 2002-05-20  Martin Baulig  <martin@gnome.org>
5769
5770         * typemanager.cs (InitEnumUnderlyingTypes): "System.Char" can't
5771         be underlying type for an enum.
5772
5773 2002-05-20  Miguel de Icaza  <miguel@ximian.com>
5774
5775         * typemanager.cs (InitEnumUnderlyingTypes): New helper function
5776         that splits out the loading of just the core types.
5777
5778         * rootcontext.cs (ResolveCore): Split the struct resolution in
5779         two, so we can load the enumeration underlying types before any
5780         enums are used.
5781
5782         * expression.cs (Is): Bandaid until we fix properly Switch (see
5783         bug #24985 for details).
5784
5785         * typemanager.cs (ImplementsInterface): The hashtable will contain
5786         a null if there are no interfaces implemented.
5787
5788 2002-05-18  Miguel de Icaza  <miguel@ximian.com>
5789
5790         * cs-parser.jay (indexer_declarator): It is fine to have array
5791         parameters
5792
5793 2002-05-17  Miguel de Icaza  <miguel@ximian.com>
5794
5795         * typemanager.cs: (RegisterBuilder): New function used to register
5796         TypeBuilders that implement interfaces.  Since
5797         TypeBuilder.GetInterfaces (as usual) does not work with lame
5798         Reflection.Emit. 
5799         (AddUserType): register interfaces.
5800
5801         (ImplementsInterface): Use the builder_to_ifaces hash if we are
5802         dealing with TypeBuilder.  Also, arrays are showing up as
5803         SymbolTypes, which are not TypeBuilders, but whose GetInterfaces
5804         methods can not be invoked on them!
5805
5806         * ecore.cs (ExplicitReferenceConversionExists): Made public.
5807         (ImplicitReferenceConversionExists): Split out from
5808         StandardConversionExists. 
5809
5810         * expression.cs (As): We were only implementing one of the three
5811         cases for the as operator.  We now implement them all.
5812         (Is): Implement the various other cases for Is as well.
5813
5814         * typemanager.cs (CACHE): New define used to control if we want or
5815         not the FindMembers cache.  Seems to have a negative impact on
5816         performance currently
5817
5818         (MemberLookup): Nested types have full acess to
5819         enclosing type members
5820
5821         Remove code that coped with instance/static returns for events, we
5822         now catch this in RealFindMembers.
5823
5824         (RealFindMembers): only perform static lookup if the instance
5825         lookup did not return a type or an event.  
5826
5827 2002-05-17  Miguel de Icaza  <miguel@ximian.com>
5828
5829         * assign.cs (CompoundAssign): We pass more semantic information
5830         now to Compound Assignments than we did before: now we have all
5831         the information at hand, and now we resolve the target *before* we
5832         do the expression expansion, which allows the "CacheValue" method
5833         to have the effect we intended (before, a [x] += 1 would generate
5834         two differen ArrayAccess expressions from the ElementAccess,
5835         during the resolution process).
5836
5837         (CompoundAssign.DoResolve): Resolve target and original_source here.
5838
5839 2002-05-16  Miguel de Icaza  <miguel@ximian.com>
5840
5841         * expression.cs (ArrayAccess): dropped debugging information. 
5842
5843         * typemanager.cs: Small bug fix: I was always returning i_members,
5844         instead of one of i_members or s_members (depending on which had
5845         the content).
5846
5847         * assign.cs (IAssignMethod.CacheTemporaries): New method.  This
5848         method is invoked before any code generation takes place, and it
5849         is a mechanism to inform that the expression will be invoked more
5850         than once, and that the method should use temporary values to
5851         avoid having side effects
5852
5853         (Assign.Emit): Call CacheTemporaries in the IAssignMethod.
5854         
5855         * ecore.cs (Expression.CacheTemporaries): Provide empty default
5856         implementation.
5857
5858         * expression.cs (Indirection, ArrayAccess): Add support for
5859         CacheTemporaries in these two bad boys. 
5860
5861         * ecore.cs (LoadFromPtr): figure out on our own if we need to use
5862         ldobj or ldind_ref.  
5863         (StoreFromPtr): Handle stobj as well.
5864
5865         * expression.cs (UnaryMutator): Share more code.
5866         
5867         * typemanager.cs (FindMembers): Thanks to Paolo for tracking this
5868         down: I was not tracking the Filter function as well, which
5869         was affecting the results of the cache.
5870
5871 2002-05-15  Miguel de Icaza  <miguel@ximian.com>
5872
5873         * attribute.cs: Remove the hack to handle the CharSet property on
5874         StructLayouts. 
5875
5876 2002-05-14  Miguel de Icaza  <miguel@ximian.com>
5877
5878         * attribute.cs (DoResolve): More uglyness, we now only try to
5879         resolve the attribute partially, to extract the CharSet
5880         information (only if we are a StructLayout attribute).  Otherwise 
5881
5882         (GetExtraTypeInfo): Add some code to conditionally kill in the
5883         future this.   I am more and more convinced that the .NET
5884         framework has special code to handle the attribute setting on
5885         certain elements.
5886
5887         * expression.cs (IsParamsMethodApplicable): Revert my previous
5888         foreach change here, it was wrong.
5889
5890 2002-05-13  Miguel de Icaza  <miguel@ximian.com>
5891
5892         * cs-tokenizer.cs: (pp_primary): Eat the ')' at the end.
5893         (pp_expr): do not abort on unknown input, just return.
5894         (eval): abort if there are pending chars.
5895
5896         * attribute.cs (Attribute.Resolve): Positional parameters are
5897         optional.  Deal with that case.
5898
5899         * class.cs (DefineType): Call Attribute.GetExtraTypeInfo to fetch
5900         the Ansi/Unicode/Auto information for the type.
5901
5902         (TypeContainer.DefineType): instantiate the EmitContext here, as
5903         we will be using it during the type definition (to resolve
5904         attributes) and during the emit phase.
5905
5906         * attribute.cs (Attribute.GetExtraTypeInfo): This routine is used
5907         to pull type information out of the attributes
5908
5909         (Attribute.Resolve): track the constructor builder, and allow for
5910         multiple invocations (structs and classes will use this).
5911
5912         * ecore.cs (MemberLookupFinal): new version with all the
5913         parameters customizable.
5914
5915         * expression.cs (New.DoResolve): Use MemberLookupFinal to locate
5916         constructors.  Return if the result value is null (as the error
5917         would have been flagged already by MemberLookupFinal)
5918
5919         Do not allow instances of abstract classes or interfaces to be
5920         created.
5921         
5922         * class.cs: (MethodSignature.InheritableMemberSignatureCompare):
5923         We have to compare the assembly property here when dealing with
5924         FamANDAssem and Assembly access modifiers, because we might be
5925         creating an assembly from *modules* (that means that we are not
5926         getting TypeBuilders for types defined in other modules that are
5927         part of this assembly).
5928
5929         (Method.Emit): If the method is marked abstract and has a body,
5930         emit an error. 
5931
5932         (TypeContainer.DefineMembers): If both the defined member and the
5933         parent name match are methods, then do not emit any warnings: let
5934         the Method.Define routine take care of flagging warnings.  But if
5935         there is a mismatch (method overrides something else, or method is
5936         overriwritten by something, then emit warning).
5937
5938         (MethodSignature.MemberSignatureCompare): If the sig.ret_type is
5939         set to null, this means `do not check for the return type on the
5940         signature'. 
5941
5942         (Method.Define): set the return type for the method signature to
5943         null, so that we get methods with the same name and parameters and
5944         different return types.  This is used to flag warning 114 (you are
5945         hiding a method, and you probably want to use the new/override
5946         keywords instead).
5947
5948         * typemanager.cs (MemberLookup): Implemented proper access
5949         control, closing a long standing set of bug reports.  The problem
5950         was that the Framework only has two bits: Public and NonPublic,
5951         and NonPublic includes private and protected methods, but we need
5952         to enforce the FamANDAssem, FamOrAssem and Family. 
5953
5954 2002-05-11  Miguel de Icaza  <miguel@ximian.com>
5955
5956         * statement.cs (GotoCase): Return true: Ammounts to giving up
5957         knowledge on whether we return or not, and letting the other case
5958         be responsible for it.
5959
5960 2002-05-10  Miguel de Icaza  <miguel@ximian.com>
5961
5962         * driver.cs: Do not load directories for each file processed, only
5963         do it if there is a pattern.
5964
5965         * ecore.cs: Report readonly assigns here as well, as we might have
5966         been resolved only by MemberAccess.
5967
5968         (SimpleName.SimpleNameResolve): Also be useful for LValue
5969         resolution.   We need this to propagate assign to local readonly variables
5970
5971         * typemanager.cs: Use a ptrhashtable for the criteria, because we
5972         do not want to reuse potential criteria memory.
5973
5974         * class.cs (MyEventBuilder): Set reflected_type;
5975
5976         * ecore.cs (Constantify): Added support for constifying bools.
5977
5978         (RootContext.LookupType): Added a cache for values looked up in
5979         the declaration space.
5980
5981         * typemanager.cs (FindMembers): Now is a front-end to
5982         RealFindMembers, and provides a two-level hashtable-based cache to
5983         the request.  
5984
5985         15% performance improvement: from 22.5 to 19.2 seconds.
5986
5987         * expression.cs (IsParamsMethodApplicable): use foreach.
5988         (Invocation.DoResolve): ditto.
5989         (New.DoResolve): ditto.
5990         (ArrayCreation.DoResolve): ditto.
5991
5992         * ecore.cs (FindMostEncompassingType): use foreach.
5993
5994         * delegate.cs (NewDelegate.DoResolve): Use foreach
5995
5996         * ecore.cs (Expression.FindMostSpecificSource): Use foreach.
5997         (RemoveMethods): use foreach.
5998
5999         * expression.cs (Invocation.MakeUnionSet): Optimization: Use two
6000         nested foreach statements instead of for, and also break out of
6001         the inner loop once a match is found.
6002         
6003         (Invocation.OverloadResolve): Use foreach, simplify the code. 
6004
6005 2002-05-08  Miguel de Icaza  <miguel@ximian.com>
6006
6007         * cfold.cs (BinaryFold): During an enumeration evaluation context,
6008         we actually unwrap the expression to allow for extra information
6009         to be extracted. 
6010
6011         * expression.cs: Use Shr_Un on unsigned operations. 
6012
6013 2002-05-08  Ravi Pratap  <ravi@ximian.com>
6014
6015         * ecore.cs (FindMostEncompass*): Fix trivial bug where the set of 
6016         applicable operators was not being considered correctly. This closes
6017         the bug Miguel reported.
6018
6019 Wed May 8 16:40:50 CEST 2002 Paolo Molaro <lupus@ximian.com>
6020
6021         * attribute.cs: check that the type derives from System.Attribute
6022         and report the correct error in that case (moved the duplicate code to
6023         its own method, too).
6024
6025 Wed May 8 11:50:31 CEST 2002 Paolo Molaro <lupus@ximian.com>
6026
6027         * attribute.cs: lookup attribute type name as the spec says: first the
6028         bare attribute name and then name + "Attribute" (nant compiles with
6029         mcs after this fix).
6030
6031 2002-05-07  Miguel de Icaza  <miguel@ximian.com>
6032
6033         * expression.cs (Unary.TryReduceNegative): Ah!  Tricky!  Tricky!
6034         Because of the way we parse things, we should try to see if a
6035         UIntConstant can fit in an integer.
6036
6037 2002-05-07  Ravi Pratap  <ravi@ximian.com>
6038
6039         * ecore.cs (GetConversionOperators): Do not pick up op_True operators
6040         when we are in an explicit context.
6041
6042         (ConvertReferenceExplicit): When converting from Iface type S to Class
6043         T make sure the rules are implemented as an OR.
6044
6045         * parameter.cs (ParameterType): Make it a property for now although the
6046         purpose really isn't anything immediate.
6047         
6048         * expression.cs (Is*Applicable): Do better checking on the parameter type
6049         of a ref/out parameter. The ones from the system assemblies are already 
6050         marked with the correct type so we don't need to do any correction.
6051
6052         * ecore.cs (StandardConversionExists): Conversion from Interface types to 
6053         the object type is standard too so include that.
6054
6055 2002-05-06  Miguel de Icaza  <miguel@ximian.com>
6056
6057         * ecore.cs (StandardConversionExists): Augment with missing code:
6058         deal with IntConstant, LongConstants and Enumerations.
6059
6060         * assign.cs: Report the error, instead of failing silently
6061
6062         * rootcontext.cs (AddGlobalAttributes): Track attributes on the
6063         typecontainer that they are declared, because the
6064         typecontainer/namespace will have the list of using clauses that
6065         need to be applied.
6066
6067         Assembly Attributes were escaping the normal registration
6068         mechanism. 
6069
6070         (EmitCode): Apply attributes within an EmitContext that represents
6071         the container they were declared on.
6072         
6073         * cs-parser.jay: Track bases for structs.  How did I get this wrong?
6074
6075 2002-05-06  Ravi Pratap  <ravi@ximian.com>
6076
6077         * ecore.cs (FindMostEncompassingType, FindMostEncompassedType):
6078         Revamp completely - make much cleaner as we now operate only
6079         on a set of Types.
6080
6081         (FindMostSpecificSource, FindMostSpecificTarget): New methods
6082         to implement the logic detailed in the spec more correctly.
6083
6084         (UserDefinedConversion): Update accordingly.
6085
6086 2002-05-06  Miguel de Icaza  <miguel@ximian.com>
6087
6088         * statement.cs: Return flow analysis information up.
6089
6090         * cs-tokenizer.cs (adjust_real): Share code between LITERAL_DOUBLE
6091         and the default.
6092
6093         (token): Do not consume an extra character before calling
6094         decimal_digits.
6095
6096 2002-05-06  Piers Haken <piersh@friskit.com>
6097
6098         * cs-parser.jay: add 'override' attribute to System.Object.Finalize
6099
6100 2002-05-06  Miguel de Icaza  <miguel@ximian.com>
6101
6102         * class.cs (Constructor.Emit): Set the IsStatic flag in the
6103         EmitContext during the instance constructor initializer
6104         resolution, to stop access to instance variables.
6105
6106         This is mandated by the spec, last paragraph of the `constructor
6107         initializers' section. 
6108
6109 2002-05-05  Miguel de Icaza  <miguel@ximian.com>
6110
6111         * cs-parser.jay, class.cs (Accessor): new class used to represent
6112         an accessor (get or set).  In the past we used `null' to represent
6113         a missing accessor.  But this is ambiguous because there was no
6114         way to tell in abstract indexers/properties if one of them was
6115         specified.
6116
6117         Now there is a way of addressing that.
6118
6119         * expression.cs (Indexers.GetIndexersForType): Use TypeManager.MemberLookup
6120         instead of FindMembers.
6121
6122         * class.cs (TypeContainer.EmitFieldInitializer): Do not typecast
6123         the result of Assign.Resolve as Assign, but rather as ExpressionStatement.
6124
6125         * attribute.cs: Treat indexers and properties as the same in terms
6126         of applying attributes
6127
6128         * ecore.cs (FindMostEncompassedType): Use statically initialized
6129         EmptyExpressions()s like we do elsewhere to avoid creating useless
6130         objects (and we take this out of the tight loop).
6131
6132         (GetConversionOperators): Move the code to extract the actual
6133         operators to a separate routine to clean things up.
6134
6135 2002-05-04  Miguel de Icaza  <miguel@ximian.com>
6136
6137         * ecore.cs (FieldExpr): Remove un-needed tests for null, since now
6138         events are always registered FieldBuilders.
6139         
6140         * class.cs (FieldBase): New class shared by Fields 
6141
6142         * delegate.cs: If we are a toplevel delegate, use our full name.
6143         If we are a nested delegate, then only use our tail name.
6144
6145 2002-05-02  Ravi Pratap  <ravi@ximian.com>
6146
6147         * expression.cs (IsApplicable): Ensure that we add the "&" to
6148         ref/out types before comparing it with the type of the argument.
6149
6150         (IsParamsMethodApplicable): Ditto.
6151
6152         (Argument.Type): Use TypeManager.LookupType instead of Type.GetType - 
6153         silly me ;-)
6154
6155         * delegate.cs : Handle the case when we have more than one applicable
6156         method. Flag an error only when we finish checking all.
6157
6158 2002-05-02  Miguel de Icaza  <miguel@ximian.com>
6159
6160         * expression.cs: Add support for boolean static initializers.
6161
6162 2002-05-01  Miguel de Icaza  <miguel@ximian.com>
6163
6164         * attribute.cs: Use proper cast for Events, since we use a MyEventBuilder.
6165
6166         * parameter.cs (ComputeParameterTypes,
6167         ComputeAndDefineParameterTypes): Better error handling: now we
6168         clear the `types' cache if we fail during any of the type lookups.
6169         We also return the status code correctly to our caller
6170
6171         * delegate.cs: If we fail to define a delegate, abort the extra
6172         steps. 
6173
6174         * expression.cs (Binary.ResolveOperator): for
6175         operator==(object,object) and operator !=(object, object) we also
6176         have to verify that there is an implicit conversion from one to
6177         the other.
6178
6179         (ArrayAccess.DoResolve): Array Access can operate on
6180         non-variables. 
6181
6182 2002-04-30  Miguel de Icaza  <miguel@ximian.com>
6183
6184         * assign.cs (CompoundAssign): A new class used as a "flag" that
6185         the assignment actually is happening as part of a compound
6186         assignment operator.
6187
6188         During compound assignment, a few new rules exist to enable things
6189         like:
6190
6191         byte b |= 1 + 2
6192
6193         From the spec:
6194         
6195         x op= y can be evaluated as x = (T) (x op y) (ie, an explicit cast
6196         to the type of x) if y is implicitly convertible to the type of x,
6197         and the operator is a builtin operator and the return type of the
6198         operator is explicitly convertible to the type of x. 
6199
6200         * rootcontext.cs: Reset warning level to 2.  4 catches various
6201         "interesting" features in mcs, we must clean this up at some
6202         point, but currently am trying to kill other bugs ;-)
6203
6204         * ecore.cs (SimpleName.SimpleNameResolve): Perform member lookups
6205         in container classes as well.  
6206
6207         * expression.cs (Binary.ResolveOperator): Handle string case
6208         before anything else (as operator overloading does emit an error
6209         before doing anything else).
6210
6211         This code could go away when we move to a table driven model, but
6212         i could not come up with a good plan last night.
6213         
6214 2002-04-30  Lawrence Pit <loz@cable.a2000.nl>
6215
6216         * typemanager.cs (CSharpName): reimplementation using regex.
6217         * class.cs: added null check for fields in Emit
6218         * rootcontext.cs: set warninglevel to 4
6219
6220 2002-04-29  Miguel de Icaza  <miguel@ximian.com>
6221
6222         * typemanager.cs (CSharpName): reimplemented with Lupus
6223         suggestion.
6224
6225 2002-04-28  Miguel de Icaza  <miguel@ximian.com>
6226
6227         * statement.cs (If): correclty implement Resolve, because we were
6228         not catching sem errors in there.  The same process is needed
6229         everywhere else. 
6230         (Return, StatementExpression, For, While, Do, Throw, Lock): Implement Resolve
6231         
6232
6233         (Statement.Warning_DeadCodeFound): Factorize code.
6234         (While): Report dead code here too.
6235
6236         (Statement): Added Resolve virtual method to allow
6237         for resolution split from the emit code.
6238
6239 2002-04-26  Miguel de Icaza  <miguel@ximian.com>
6240
6241         * statement.cs (EmitBoolExpression): No longer try to resolve the
6242         expression here.    
6243         (MakeBoolean): New utility function that resolve, implicitly
6244         converts to boolean and tags the expression. 
6245         
6246
6247         (If, Do): Implement dead code elimination.
6248         (While): Implement loop inversion
6249
6250         (Do, While, For, If): Resolve the expression prior to calling our
6251         code generation.
6252
6253 2002-04-22  Lawrence Pit <loz@cable.a2000.nl>
6254
6255         * class.cs:
6256           - added method Report28 (warning: program has more than one entry point)
6257           - added method IsEntryPoint, implements paragraph 10.1 of the spec
6258           - modified method Method.Define, the part at the end of the method
6259
6260         * rootcontext.cs: added static public Location EntryPointLocation;
6261           
6262         * ../errors/cs0028.cs : Add test case for the above warning.              
6263
6264         * typemanager.cs:
6265           - modified method CSharpName to allow arrays of primitive type to
6266             be printed nicely (e.g. instead of System.Int32[][] it now prints
6267             int[][])
6268           - added method CSharpSignature: returns the signature of a method
6269             in string format to be used in reporting errors, warnings, etc.
6270
6271         * support.cs: InternalParameters.ParameterDesc variable tmp initialized
6272         with String.Empty.
6273         
6274 2002-04-26  Ravi Pratap  <ravi@ximian.com>
6275
6276         * delegate.cs (Define): Fix extremely silly bug where I was
6277         setting the type of the 'object' parameter of the BeginInvoke
6278         method to System.IAsyncResult instead of System.Object ;-)
6279
6280 2002-04-26  Miguel de Icaza  <miguel@ximian.com>
6281
6282         * class.cs (ConstructorInitializer.Resolve): Also use DeclaredOnly
6283         here. 
6284
6285         (Constructor.Emit): return if we fail to initialize the
6286         constructor.  Another door closed!  
6287
6288         * expression.cs (New.DoResolve): Improve error message (from -6 to
6289         1501).  Use DeclaredOnly lookup to find the exact constructor.
6290
6291         * typemanager.cs (MemberLookup): If DeclaredOnly is set, do not
6292         loop.  This is useful.
6293
6294         * cs-parser.jay: Adjust the default parameters so that destructors
6295         have the proper signature.
6296
6297 2002-04-26  Martin Baulig  <martin@gnome.org>
6298
6299         * driver.cs (LoadAssembly): If `assembly' contains any characters
6300         which are only valid in path names and not in assembly names
6301         (currently slash, backslash and point), use Assembly.LoadFrom ()
6302         instead of Assembly.Load () on the `assembly' (before iteration
6303         over the link_paths).
6304
6305 2002-04-26  Martin Baulig  <martin@gnome.org>
6306
6307         * cs-tokenizer.cs (is_hex): Correctly handle lowercase chars.
6308
6309 2002-04-25  Miguel de Icaza  <miguel@ximian.com>
6310
6311         * class.cs (Property): use the new typemanager.MemberLookup
6312
6313         (TypeContainer.MemberLookup): Implement using the
6314         TypeManager.MemberLookup now. 
6315         
6316         * typemanager.cs: Make MemberLookup a function of the TypeManager,
6317         and return MemberInfos, so that these can be used without an
6318         EmitContext (what we had before).
6319
6320 2002-04-24  Miguel de Icaza  <miguel@ximian.com>
6321
6322         * expression.cs: Fix the case where the argument to params if the
6323         type of the params.  I omitted handling this before.   Fixed
6324
6325 2002-04-22  Miguel de Icaza  <miguel@ximian.com>
6326
6327         * driver.cs: Call BootCorlib_PopulateCoreType
6328
6329         * class.cs (Property.CheckBase): Check for properties only, not
6330         for all members. 
6331
6332         * interface.cs: Temporary hack: try/catch around the
6333         CustomAttributeBuilder, because I am getting an exception that I
6334         do not understand.
6335
6336         * rootcontext.cs (BootCorlib_PopulateCoreType): Populate some
6337         types whose definitions are required to be there (attributes are
6338         defined before standard types).
6339
6340         Compute definitions as we boot the various types, as they are used
6341         immediately (value_type class will need object_type, but if we do
6342         not initialize object_type, we will pass a null, which will let
6343         the runtime pick the System.Object from the existing corlib, which
6344         is not what we want).
6345
6346 2002-04-22  Patrik Torstensson <totte@labs2.com>
6347
6348         * cs-tokenizer.cs: fixed a number of trim() issues.
6349
6350 2002-04-22  Ravi Pratap  <ravi@ximian.com>
6351
6352         * expression.cs (Argument.Type): Ensure that we return the correct
6353         type when we have out or ref parameters [in which case we 
6354         append a "&"].
6355         
6356 2002-04-22  Miguel de Icaza  <miguel@ximian.com>
6357
6358         * class.cs (Property, Indexer): Allow extern modifier in there. 
6359
6360         * typemanager.cs (InitBaseTypes): Initializes object_type and
6361         value_type, since those will be used early on during the bootstrap
6362         process to compile corlib.
6363
6364         (InitCoreTypes): Move code from here to InitBaseTypes.
6365
6366 2002-04-21  Miguel de Icaza  <miguel@ximian.com>
6367
6368         * ecore.cs (PropertyExpr): Optimize calls to Array::get_Length on
6369         single-dimension arrays as using the ldlen opcode.  
6370
6371         Daniel Lewis discovered this optimization.  
6372
6373         * typemanager.cs: Add signature for System.Array::get_Length
6374
6375 2002-04-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
6376
6377         * statement.cs: report the error when the foreach does not apply to an
6378         array nor a collection.
6379
6380 2002-04-19  Miguel de Icaza  <miguel@ximian.com>
6381
6382         * expression.cs: Add implicit conversions to the operator ~.
6383
6384         * constant.cs (DecimalConstant.Emit): Emit decimal value.
6385
6386         * typemanager.cs: Locate the decimal constructor.
6387
6388 2002-04-17  Gonzalo Paniagua Javier <gonzalo@ximian.com>
6389
6390         * attribute.cs: use the new property of TypeOf.
6391         * expression.cs: added 'get' property around typearg.
6392
6393         These changes fix a build breaker reported by NickD. Is this the
6394         correct way to fix?  If not, please, revert my changes and make it
6395         work :-).
6396
6397 2002-04-17  Miguel de Icaza  <miguel@ximian.com>
6398
6399         * attribute.cs: Add support for typeof in attribute invocations.
6400         I am not sure that this is right though.
6401
6402 2002-04-14  Duncan Mak  <duncan@ximian.com>
6403
6404         * cfold.cs (BinaryFold): Catch DivideByZeroException in the
6405         Binary.Operator.Division case.
6406
6407 2002-04-13  Ravi Pratap  <ravi@ximian.com>
6408
6409         * class.cs (DefineType): Ensure that we do a proper check on
6410         attribute types and also register it with the TypeManager.
6411
6412         (TypeContainer.Targets): The default for attribute types is
6413         AttributeTargets.All.
6414         
6415         * attribute.cs (ApplyAttributes): Registering the attribute type
6416         is done elsewhere, not when we discover we have a Usage attribute.
6417
6418 2002-04-12  Ravi Pratap  <ravi@ximian.com>
6419
6420         * expression.cs (VerifyArgumentsCompat): Implement Miguel's suggestion
6421         and get rid of is_delegate parameter.
6422
6423         * everywhere : update.
6424         
6425 2002-04-12  Ravi Pratap  <ravi@ximian.com>
6426
6427         * cs-parser.jay (compilation_unit): Revamp completely to use
6428         some new ideas that I got from Rhys' grammar to solve the problems
6429         with assembly level attributes.
6430
6431         (outer_declaration): New grammar production.
6432
6433         (attribute_sections): Add.
6434
6435         (opt_attributes): Base on attribute_sections
6436
6437         (namespace_declaration): Allow opt_attributes to tackle the case
6438         when we have assembly level attributes - we are clever in this
6439         regard now ;-)
6440
6441         * attribute.cs (ApplyAttributes): Do not worry about assembly 
6442         attributes in the non-global context.
6443
6444         * rootcontext.cs (AddGlobalAttributes): Go back to using this
6445         instead of SetGlobalAttributes.
6446
6447         * class.cs, rootcontext.cs : Ensure we define and generate 
6448         attribute types before anything else.
6449
6450         * attribute.cs (CheckAttribute and GetValidPlaces): Handle the exception
6451         and flag the new error -20 for the case when the attribute type
6452         does not have valid targets specified. csc does not catch this.
6453
6454         * ../errors/errors.txt : update for error # -20
6455
6456 2002-04-11  Ravi Pratap  <ravi@ximian.com>
6457
6458         * support.cs (InternalParameters.ParameterModifier): Do some null
6459         checking and return sane values.
6460
6461         * class.cs (Method.Define): If we are a PInvoke method, ensure
6462         that we are static and extern. Report error # 601
6463
6464         * ../errors/cs0601.cs : Add test case for the above error.
6465
6466 2002-04-07  Ravi Pratap  <ravi@ximian.com>
6467
6468         * rootcontext.cs (attribute_types): We need to keep type of
6469         all attribute types separately and emit code for them first.
6470
6471         (RegisterAttribute) : Implement.
6472
6473         * class.cs (DefineType): Check if the current Type is a custom
6474         attribute type and register it accordingly.
6475
6476         * rootcontext.cs (AddGlobalAttributes): Fix silly bug where we were
6477         adding the first attribute twice and rename to
6478
6479         (SetGlobalAttributes): this.
6480
6481         * rootcontext.cs (NamespaceLookup): Run through the aliases too and perform
6482         lookups.
6483
6484         * attribute.cs (ApplyAttributes): Take an additional argument telling us
6485         if we are processing global arguments. Hmm, I am unsure of this.
6486
6487 2002-04-12  Gonzalo Paniagua Javier <gonzalo@ximian.com>
6488
6489         * expression.cs: added static array of strings to avoid calling
6490         Enum.ToString () for Operator in Binary. Significant recover of
6491         performance.
6492
6493 2002-04-10  Miguel de Icaza  <miguel@ximian.com>
6494
6495         * class.cs (FindMembers): Allow the Builders of the various
6496         members to be null.  If they are skip them.  This only happens
6497         during the PInvoke declaration.
6498
6499 2002-04-09  Miguel de Icaza  <miguel@ximian.com>
6500
6501         * parameter.cs (Parameters.ComputeParameterTypes): Flag the
6502         failure, so we do not keep going afterwards.
6503
6504         * expression.cs: (Invocation.OverloadResolve): I believe Ravi
6505         wanted to pass `false' as the `is_delegate' argument.  If this is
6506         the case, why not use delegate_type == null to mean `is_delegate =
6507         false' and anything else as is_delegate = true.
6508
6509 Tue Apr  9 05:40:12  2002 Piers Haken <piersh@friskit.com>
6510
6511         * statement.cs: fixed SimpleSwitchEmit to make 'goto case' goto the
6512         code for the section, not the beginning of the tests.
6513
6514 2002-04-08  Miguel de Icaza  <miguel@ximian.com>
6515
6516         * cfold.cs: Handle operator + (Enum x, Underlying x) 
6517
6518         * expression.cs (Binary): same.  Warn about errors where we have
6519         Enum/Enum in operator + as well.
6520
6521 Mon Apr  8 06:29:03  2002 Piers Haken <piersh@friskit.com>
6522
6523         * statement.cs:
6524                 - added support for switch(bool)
6525                 - optimize loading of I8/U8 constants (ldc.i4, iconv_i8)
6526                 - add TableSwitchEmit() to handle table-based switch statements
6527
6528 2002-04-05  Ravi Pratap  <ravi@ximian.com>
6529
6530         * expression.cs (Invocation.OverloadResolve): Factor out code which
6531         does parameter compatibility checking with arguments so that we can 
6532         re-use the code even from Delegate.VerifyApplicability
6533
6534         (VerifyArgumentsCompat): Move above code here.
6535
6536         * delegate.cs (VerifyApplicability): Get rid of duplicate code
6537         and instead make a call to the above method.
6538
6539 2002-03-31  Ravi Pratap  <ravi@ximian.com>
6540
6541         * typemanager.cs (attribute_type): Corresponds to System.Attribute.
6542         We use it to keep track of classes which are attribute types.
6543
6544 2002-04-02  Miguel de Icaza  <miguel@ximian.com>
6545
6546         * delegate.cs (Delegate.Define): Correctly define the types in the
6547         presence of fixed and array parameters.
6548
6549         * class.cs (TypeContainers.FindMembers): Use NonPublic flag while
6550         doing FindMembers.
6551
6552         * ecore.cs (Expression.MemberLookup): Reset binding flags to not
6553         include NonPublic after the first iteration.
6554
6555         * class.cs (Indexer.CheckBase): Only check if both parents are
6556         non-null. 
6557         
6558         * cs-parser.jay (accessor_body): If empty, set to null.
6559
6560         * ecore.cs (SimpleName.SimpleNameResolve): We did not have the
6561         same code path here to resolve constants names that we did have in
6562         MemberAccess.DoResolve.  There is too much code duplicated here.
6563
6564 2002-04-01  Miguel de Icaza  <miguel@ximian.com>
6565
6566         * statement.cs, makefile: Drop Statementcollection and just use ArrayLists
6567
6568         * ecore.cs: Optimize UserDefinedConversion by minimizing the calls
6569         to MakeUnionSet.
6570
6571         * cs-tokenizer.cs: Reuse a single StringBuilder for assembling
6572         tokens, numbers and strings.
6573
6574         * ecore.cs (MethodGroupExpr): Make Emit warn about missing
6575         parenthesis.
6576
6577         * delegate.cs: Use ComputeAndDefineParameterTypes for both the
6578         asyncronous parameters and the regular parameters.  
6579
6580         * codegen.cs (CodeGen.Init): Use the constructor that allows us to
6581         specify the target directory.
6582
6583         * expression.cs: (This.DoResolve): Simplify
6584         (As.Emit): Optimize, do not generate IsInst if the expression is
6585         always of the given type.
6586
6587         (Is.DoResolve): Bug fix, we were reporting both always/never for
6588         the is expression.
6589
6590         * (Invocation.MakeUnionSet): Simplify vastly and optimize, we were
6591         creating too many unnecessary arrays.
6592
6593 2002-03-31  Miguel de Icaza  <miguel@ximian.com>
6594
6595         * class.cs (EmitFieldInitializer): Use Assign expression to assign
6596         fields instead of rolling our own initializer.   Takes care of all
6597         implicit conversions, and drops unnecessary static checks/argument.
6598
6599 2002-03-31  Dick Porter  <dick@ximian.com>
6600
6601         * driver.cs: use the GetDirectories() return values properly, and
6602         use "/" as path separator.
6603
6604 2002-03-30  Miguel de Icaza  <miguel@ximian.com>
6605
6606         * expression.cs (Unary): Optimize - - expr into expr.
6607         (Binary): Optimize a + (-b) into a -b.
6608
6609         * codegen.cs (CodeGen): Made all methods static.
6610
6611 2002-03-29  Miguel de Icaza  <miguel@ximian.com>
6612
6613         * rootcontext.cs: 
6614
6615         * decl.cs: Rename `definition' into `TypeBuilder' and drop the
6616         TypeBuilder property.
6617
6618         * cs-parser.jay: Drop the use of RecordXXX and use RecordDecl
6619         instead. 
6620
6621         * tree.cs: Removed the various RecordXXXX, and replaced with a
6622         single RecordDecl.  Removed all the accessor methods, and just
6623         left a single access point Type 
6624
6625         * enum.cs: Rename DefineEnum to DefineType.
6626
6627         * decl.cs: New abstract method `DefineType' used to unify the
6628         Defines for Enumerations, Interfaces, TypeContainers and
6629         Delegates.
6630
6631         (FindType): Moved LookupInterfaceOrClass here.  Moved the
6632         LookupBaseClasses method that used to live in class.cs and
6633         interface.cs here, and renamed to FindType.
6634         
6635         * delegate.cs: Implement DefineType.  Take advantage of the
6636         refactored pattern for locating the parent builder without taking
6637         the parent_builder argument (which we know does not work if we are
6638         nested, and triggering a toplevel definition).
6639
6640 2002-03-28  Miguel de Icaza  <miguel@ximian.com>
6641
6642         * decl.cs (MemberCore.CheckMethodAgainstBase): Test if the
6643         accessibility of a member has changed during override and report
6644         an error if so.
6645
6646         * class.cs (Method.Define, Property.Define): Only complain on
6647         overrides if the method is private, any other accessibility is
6648         fine (and since we just checked the permission is the same, we are
6649         good to go).
6650
6651         * cs-tokenizer.cs: only line, region, endregion, if, endif, else
6652         and elif are processed always.  The other pre-processing
6653         directives are only processed if we are "taking" the path
6654
6655 2002-03-29  Martin Baulig  <martin@gnome.org>
6656
6657         * class.cs (Method.Emit): Only emit symbolic debugging info if the
6658         current location is not Null.
6659
6660         * codegen.cs (CodeGen.SaveSymbols): Split out symbol writing code into
6661         a separate method so we can profile it.
6662
6663         * driver.cs (ShowTime): We need to use `(int) span.TotalSeconds' since
6664         `span.Seconds' are just seconds, but no minutes or hours.
6665         (MainDriver): Profile the CodeGen.SaveSymbols calls.
6666
6667 2002-03-28  Miguel de Icaza  <miguel@ximian.com>
6668
6669         * class.cs (Method.Define), (Property.Define), (Indexer.Define):
6670         Remove the gratuitous set of Final:
6671
6672                                 // If an interface implementation, then we can set Final.
6673                                 if (((flags & MethodAttributes.Abstract) == 0) &&
6674                                     implementing.DeclaringType.IsInterface)
6675                                         flags |= MethodAttributes.Final;
6676
6677         I do not know what I was smoking when I used that.
6678         
6679
6680         * cs-parser.jay, delegate.cs: Make Delegate be a DeclSpace, first
6681         step into fixing the name resolution issues for delegates and
6682         unifying the toplevel name resolution.
6683
6684 2002-03-28  Martin Baulig  <martin@gnome.org>
6685
6686         * class.cs (Method.Emit): If we have a symbol writer, call its
6687         OpenMethod(), CloseMethod() and SetMethodSourceRange() methods to
6688         tell it about the current method.
6689
6690         * codegen.cs (EmitContext.Mark): New public method. Tell the symbol
6691         writer that we're going to emit the first byte of IL code for a new
6692         statement (a new source line).
6693         (EmitContext.EmitTopBlock): If we have a symbol writer, call
6694         EmitContext.Mark() before emitting any code.
6695
6696         * location.cs (SymbolDocument): Return null when we're Null.
6697
6698         * statement.cs (Statement): Moved the `Location loc' variable here.
6699         (Statement.EmitBoolExpression): If we have a symbol writer, call
6700         ec.Mark() before emitting any code to tell it that we're at the
6701         beginning of a new statement.
6702         (StatementExpression): Added `Location' argument to the constructor.
6703         (Block): Added public readonly variable `StartLocation' and public
6704         variable `EndLocation'.  The latter is to be set using SetEndLocation().
6705         (Block): Added constructor which takes a start and end location.
6706         (Block.SetEndLocation): New method. This sets the end location.
6707         (Block.EmitMeta): If we have a symbol writer, tell it the names of the
6708         local variables we create.
6709         (Block.Emit): If we have a symbol writer, call ec.Mark() before emitting
6710         each statement and do also mark the begin and end of the block.
6711
6712         * cs-parser.jay (block : OPEN_BRACE): Use the new `Block' constructor to
6713         tell it the current lexer.Location, use Location.Null for the end of the
6714         block.
6715         (block : OPEN_BRACE opt_statement_list CLOSE_BRACE): When closing the
6716         current block, set its end location using SetEndLocation().
6717         (statement_expression): StatementExpression constructor now takes the
6718         lexer.Location as additional argument.
6719         (for_statement, declare_local_variables): Likewise.
6720         (declare_local_variables): When creating a new implicit block, use the
6721         new Block constructor and pass it the lexer.Location.
6722
6723 2002-03-28  Miguel de Icaza  <miguel@ximian.com>
6724
6725         * ecore.cs (Expression.MemberLookup): On interfaces, lookup
6726         members also on the parent interfaces recursively.
6727
6728 2002-03-27  Miguel de Icaza  <miguel@ximian.com>
6729
6730         * report.cs: Use new formats, since Gonzalo finished the missing
6731         bits. 
6732
6733         * expression.cs (Binary.ResolveOperator): added missing operator|
6734         operator& and operator^ for bool/bool.
6735
6736         * cs-parser.jay: CheckDef now takes a Location argument that is
6737         used to report errors more precisly (instead of reporting the end
6738         of a definition, we try to track something which is a lot closer
6739         to the source of the problem).
6740
6741         * cs-tokenizer.cs: Track global token use, so we can properly flag
6742         the use of #define/#undef after the first token has been seen.
6743
6744         Also, rename the reportXXXX to Error_DescriptiveName
6745
6746         * decl.cs (DeclSpace.IsTopLevel): Move property here from
6747         TypeContainer, so that Enum and Interface can use this too.
6748
6749         * class.cs (TypeContainer.LookupInterfaceOrClass,
6750         GetInterfaceOrClass, GetClassBases, DefineType): Drop the
6751         `builder' argument.  Typically this was used to pass the parent
6752         builder (a ModuleBuilder or a TypeBuilder from whoever triggered
6753         the definition).  
6754
6755         The problem is that a nested class could trigger the definition of
6756         a toplevel class, and the builder would be obviously wrong in that
6757         case. 
6758
6759         So we drop this argument, and we compute dynamically the
6760         TypeBuilder/ModuleBuilder (the correct information was available
6761         to us anyways from DeclSpace.Parent)
6762
6763         * interface.cs (Interface.DefineInterface): Drop builder
6764         parameter cleanup like class.cs
6765
6766         * enum.cs (Enum.DefineEnum): Drop builder parameter.  Clean up
6767         like class.cs
6768
6769         * statement.cs (Switch.EmitObjectInteger): Emit short/ushort
6770         values. 
6771
6772         (Try.Emit): Propagate the returns value from the statement.
6773
6774         (Return.Emit): Even if we are leavning 
6775
6776         * driver.cs: Catch IOExpcetion for Directory.GetFiles as well.
6777
6778         * modifiers.cs: Fix the computation of MethodAttributes flags.
6779
6780 Tue Mar 26 21:14:36 CET 2002 Paolo Molaro <lupus@ximian.com>
6781
6782         * driver.cs: allow compilation of files that start with '/'.
6783         Add a default case when checking the argument of --target.
6784
6785 2002-03-25  Miguel de Icaza  <miguel@ximian.com>
6786
6787         * interface.cs: Implement the same search algorithm for types in
6788         the interface code.
6789
6790         * delegate.cs: Do not allow multiple definition.
6791
6792         * Recovered ChangeLog that got accidentally amputated
6793
6794         * interface.cs (Interface.DefineInterface): Prevent from double definitions.
6795
6796         * rootcontext.cs: Load manually enum to allow core classes to
6797         contain enumerations.
6798
6799         * enum.cs, ecore.cs, driver.cs, attribute.cs, class.cs, expression.cs:
6800         Update to new static methods in TypeManager.
6801
6802         * typemanager.cs (GetMethod, GetConstructor): Use our
6803         implementation of FindMembers to find the members, since during
6804         corlib compilation, the types are TypeBuilders and GetMethod and
6805         GetConstructor do not work.
6806
6807         Make all methods in TypeManager static.
6808
6809         (InitCodeHelpers): Split the functionality from
6810         the InitCodeTypes function.
6811
6812         * driver.cs: Call InitCodeHelpers after we have populated the
6813         types. 
6814
6815         * cs-parser.jay (delegate_declaration): we did not used to compute
6816         the delegate name correctly for void delegates.
6817
6818 2002-03-24  Miguel de Icaza  <miguel@ximian.com>
6819
6820         * rootcontext.cs (RootContext): Init the interface_resolve_order
6821         and type_container_resolve_order always.
6822
6823         (ResolveCore, BootstrapCorlib_ResolveClass,
6824         BootstrapCorlib_ResolveStruct): New functions to bootstrap the
6825         compiler when compiling with --nostdlib
6826
6827         * class.cs (TypeContainer.DefineType): Check that our parent is
6828         not null.  This test is most important when we are bootstraping
6829         the core types.
6830
6831         * codegen.cs: Split out the symbol writing code.
6832
6833 2002-03-25  Martin Baulig  <martin@gnome.org>
6834
6835         * driver.cs (-g): Made -g an alias for --debug.
6836
6837 2002-03-24  Martin Baulig  <martin@gnome.org>
6838
6839         * codegen.cs (SymbolWriter): New public variable. Returns the
6840         current symbol writer.
6841         (CodeGen): Added `bool want_debugging_support' argument to the
6842          constructor. If true, tell the ModuleBuild that we want debugging
6843         support and ask it for the ISymbolWriter.
6844         (Save): If we have a symbol writer, call it's Close() method after
6845         saving the assembly.
6846
6847         * driver.c (--debug): New command line argument to create a
6848         debugger information file.
6849
6850         * location.cs (SymbolDocument): New public property. Returns an
6851         ISymbolDocumentWriter object for the current source file or null
6852         if we don't have a symbol writer.
6853
6854 2002-03-21  Miguel de Icaza  <miguel@ximian.com>
6855
6856         * driver.cs (LoadAssembly): Correctly return when all the paths
6857         have been tried and not before.
6858
6859         * statement.cs (Switch.Emit): return the actual coverage for this
6860         statement (returns/not-returns)
6861
6862         (Switch.SimpleSwitchEmit): Do not generate jumps to the end of the
6863         switch of the statement if we are the last switch section.  That
6864         kills two problems: try/catch problems (we used to emit an empty
6865         nop at the end) and switch statements where all branches would
6866         return. 
6867
6868 2002-03-19  Miguel de Icaza  <miguel@ximian.com>
6869
6870         * driver.cs: Add default assemblies (the equivalent to the
6871         Microsoft CSC.RSP file)
6872
6873         * cs-tokenizer.cs: When updating `cols and setting it to zero,
6874         also update tokens_seen and set it to false.
6875
6876         * driver.cs: Implement --recurse for Mike.
6877
6878         * driver.cs (SplitPathAndPattern): Small bug fix, I was not
6879         correctly splitting out the paths.
6880
6881 2002-03-18  Miguel de Icaza  <miguel@ximian.com>
6882
6883         * interface.cs (Interface.PopulateProperty): Instead of using
6884         `parent' as the declaration space for the set parameters, use
6885         `this' 
6886
6887         * support.cs (InternalParameters): InternalParameters constructor
6888         takes a DeclSpace instead of a TypeContainer.
6889
6890         * expression.cs (ArrayCreation.EmitDynamicInitializers): If value
6891         types are being initialized, load the address of it before calling
6892         the function.  
6893
6894         (New): Provide a mechanism to disable the generation of local
6895         value type temporaries when the caller will be providing us with
6896         an address to store it.
6897
6898         (ArrayCreation.EmitDynamicInitializers): Use it.
6899
6900 2002-03-17  Miguel de Icaza  <miguel@ximian.com>
6901
6902         * expression.cs (Invocation.EmitArguments): Only probe for array
6903         property if there is more than one argument.  Sorry about that.
6904
6905         * class.cs (Invocation.EmitArguments): Fix to emit arguments for
6906         empty param arrays.
6907         
6908         * class.cs (Method.LabelParameters): Fix incorrect code path that
6909         prevented the `ParamArrayAttribute' from being applied to the
6910         params attribute.
6911
6912 2002-03-16  Miguel de Icaza  <miguel@ximian.com>
6913
6914         * support.cs (ReflectionParameters): Correctly compute whether the
6915         last argument is a params array.  Fixes the problem with
6916         string.Split ('a')
6917
6918         * typemanager.cs: Make the assemblies array always be non-null
6919         (empty, but non-null)
6920
6921         * tree.cs (RecordDecl): New function that abstracts the recording
6922         of names.  This reports error 101, and provides a pointer to the
6923         previous declaration.  Fixes a crash in the compiler.
6924
6925         * cs-parser.jay (constructor_declaration): Update to new grammar,
6926         and provide a constructor_body that can be empty.
6927
6928 2002-03-15  Miguel de Icaza  <miguel@ximian.com>
6929
6930         * driver.cs: Add support for --resources.
6931
6932         * expression.cs: (FetchGetMethod, FetchAddressMethod, EmitAssign):
6933         Make all types for the various array helper methods be integer.
6934
6935         * ecore.cs (Expression.ConvertNumericExplicit): Pass the
6936         CheckState to ConvCast.
6937
6938         (ConvCast): Now it takes a `checked' state argument, to avoid
6939         depending on the emit context for the conversion, and just using
6940         the resolve time setting.
6941
6942         * expression.cs (ArrayCreation.EmitArrayArguments): New function,
6943         instead of Invocation.EmitArguments.  We do not emit the original
6944         arguments, instead we emit those which have been converted to
6945         unsigned int expressions.
6946
6947         * statement.cs (Block.EmitMeta): Drop tracking of indexes.
6948
6949         * codegen.cs: ditto.
6950
6951         * expression.cs (LocalVariableReference): Drop the use of the
6952         Store function that depended on the variable index.
6953
6954         * statement.cs (VariableInfo): Drop the `Idx' property from this
6955         class, as this is not taking into account the indexes for
6956         temporaries tat we generate during the execution, getting the
6957         indexes wrong.
6958
6959         * class.cs: First emit class initializers, then call the parent
6960         constructor. 
6961
6962         * expression.cs (Binary): Fix opcode emision.
6963         (UnaryMutator.EmitCode): Support checked code generation
6964
6965         * ecore.cs (MemberLookup): TypeManager.FindMembers will return
6966         matches for events for both the Static and Instance scans,
6967         pointing to the same element.   Fix that.
6968
6969 2002-03-14  Miguel de Icaza  <miguel@ximian.com>
6970
6971         * rootcontext.cs (ResolveTree): Always set the
6972         interface_resolve_order, because nested interfaces will be calling
6973         into us.
6974
6975         * class.cs (GetInterfaceOrClass): Track the same resolution
6976         process used by TypeManager.LookupType.  This fixes the nested
6977         type lookups in class declarations (separate path from
6978         LookupType). 
6979
6980         (TypeContainer.DefineType): Also define nested interfaces.
6981         (TypeContainer.RegisterOrder): New public function used to
6982         register the order in which child interfaces need to be closed.
6983
6984         Nested interfaces need to be closed after their parents have been
6985         created. 
6986         
6987         * interface.cs (InterfaceAttr): Put all the logic for computing
6988         the interface attribute here. 
6989
6990         (DefineInterface): Register our interface order with the
6991         RootContext or with the TypeContainer depending on the case.
6992
6993 2002-03-12  Miguel de Icaza  <miguel@ximian.com>
6994
6995         * cs-parser.jay: rework foreach statement to work with the new
6996         changes to the policy on SimpleNames.
6997         
6998         * report.cs: support Stacktrace on warnings as well.
6999
7000         * makefile: drop --unsafe and /unsafe from the compile.
7001
7002 2002-03-13  Ravi Pratap  <ravi@ximian.com>
7003
7004         * ecore.cs (StandardConversionExists): Modify to take an Expression
7005         as the first parameter. Ensure we do null -> reference type conversion
7006         checking.
7007
7008         * Everywhere : update calls accordingly, making use of MyEmptyExpr to store
7009         temporary Expression objects.
7010
7011 Wed Mar 13 12:32:40 CET 2002 Paolo Molaro <lupus@ximian.com>
7012
7013         * interface.cs: workaround bug in method overloading resolution
7014         (there is already a bugzilla bug for it).
7015
7016 2002-03-12  Miguel de Icaza  <miguel@ximian.com>
7017
7018         We could also solve this problem by having a separate path for
7019         performing type lookups, instead of DoResolve, we could have a
7020         ResolveType entry point, and only participating pieces of the
7021         production (simplename, deref, array) would implement this. 
7022         
7023         * codegen.cs (EmitContext): New field OnlyLookupTypes used to
7024         signal SimpleName to only resolve type names and not attempt to
7025         resolve anything else.
7026
7027         * expression.cs (Cast): Set the flag.
7028
7029         * ecore.cs (SimpleName): Use the OnlyLookupTypes flag
7030
7031         * class.cs: Only report 108 if there is no `new' modifier.
7032
7033         * cs-parser.jay: rework foreach statement to work with the new
7034         changes to the policy on SimpleNames.
7035         
7036         * report.cs: support Stacktrace on warnings as well.
7037
7038         * makefile: drop --unsafe and /unsafe from the compile.
7039
7040 2002-03-11  Miguel de Icaza  <miguel@ximian.com>
7041
7042         * ecore.cs (SimpleName.SimpleNameResolve): Perform local variable
7043         lookups here, instead of doing that at parse time.  This means
7044         that our grammar will not introduce `LocalVariableReferences' as
7045         expressions at this point.  That solves the problem of code like
7046         this:
7047
7048         class X {
7049            static void Main ()
7050            { int X = 1;
7051             { X x = null }}}
7052
7053         This is only half the fix.  The full fix requires parameters to
7054         also be handled in this way.
7055
7056         * Everywhere: Use ec.DeclSpace on calls to LookupType, as this
7057         makes the use more obvious of the DeclSpace.  The
7058         ec.TypeContainer.TypeBuilder is now only used to pull the
7059         TypeBuilder for it.
7060
7061         My theory is that I can get rid of the TypeBuilder completely from
7062         the EmitContext, and have typecasts where it is used (from
7063         DeclSpace to where it matters).  
7064
7065         The only pending problem is that the code that implements Aliases
7066         is on TypeContainer, and probably should go in DeclSpace.
7067
7068         * ecore.cs (SimpleName.SimpleNameResolve): Perform local variable
7069         lookups here, instead of doing that at parse time.  This means
7070         that our grammar will not introduce `LocalVariableReferences' as
7071         expressions at this point.  That solves the problem of code like
7072         this:
7073
7074         class X {
7075            static void Main ()
7076            { int X = 1;
7077             { X x = null }}}
7078
7079         This is only half the fix.  The full fix requires parameters to
7080         also be handled in this way.
7081
7082         * class.cs (Property.DefineMethod): When implementing an interface
7083         method, set newslot, when implementing an abstract method, do not
7084         set the flag (before we tried never setting it, or always setting
7085         it, which is the difference).
7086         (Indexer.DefineMethod): same.
7087         (Method.DefineMethod): same.
7088
7089         * ecore.cs: Only set the status used flag if we get back a Field.
7090
7091         * attribute.cs: Temporary hack, so Paolo can keep working.
7092
7093 2002-03-08  Ravi Pratap  <ravi@ximian.com>
7094
7095         * attribute.cs (Attribute.UnmanagedType): This is to keep track of
7096         the unmanaged type in the case we have a MarshalAs attribute.
7097
7098         (Resolve): Handle the case when we are parsing the special MarshalAs
7099         attribute [we need to store the unmanaged type to use later]
7100         
7101         * typemanager.cs (marshal_as_attr_type): Built in type for the 
7102         MarshalAs Attribute.
7103
7104         * attribute.cs (ApplyAttributes): Recognize the MarshalAs attribute 
7105         on parameters and accordingly set the marshalling info.
7106         
7107 2002-03-09  Miguel de Icaza  <miguel@ximian.com>
7108
7109         * class.cs: Optimizing slightly by removing redundant code after
7110         we switched to the `NoTypes' return value.
7111         (Property.DefineMethod): use NoTypes here too.
7112
7113         This fixes the bug I introduced in my last batch of changes.
7114
7115 2002-03-05  Ravi Pratap  <ravi@ximian.com>
7116
7117         * tree.cs (RecordEnum): Add. We now keep track of enums too.
7118
7119         * class.cs (LookupInterfaceOrClass): Check against the list of recorded
7120         Enums since those are types too. 
7121
7122         * cs-parser.jay (enum_declaration): Record enums as we parse them.
7123         
7124         * enum.cs (DefineEnum): Return if the TypeBuilder has already been defined 
7125         thanks to a call during the lookup process.
7126
7127 2002-03-07  Miguel de Icaza  <miguel@ximian.com>
7128
7129         * statement.cs (Foreach): Lots of work to accomodate a particular
7130         kind of foreach statement that I had not kept in mind.  It is
7131         possible to have foreachs on classes that provide a GetEnumerator
7132         method that return objects that implement the "pattern" for using
7133         a foreach, there is no need to support GetEnumerator
7134         specifically. 
7135
7136         This is needed to compile nant.
7137
7138         * decl.cs: Only report 114 if the member is not `Finalize' and if
7139         the warning level is at least 2.
7140
7141         * class.cs: Moved the compare function from Method to
7142         MethodSignature. 
7143
7144         (MethodSignature.InheritableMemberSignatureCompare): Add new
7145         filter function that is used to extract inheritable methods from a
7146         class. 
7147
7148         (Method.Define): Use the new `inheritable_method_signature_filter'
7149         delegate
7150
7151         * cs-tokenizer.cs (get_cmd_arg): Do not add white space to the
7152         command. 
7153
7154 2002-03-06  Miguel de Icaza  <miguel@ximian.com>
7155
7156         * ecore.cs (Expression.ConvertReferenceExplicit): Removed dead code.
7157
7158         * cs-parser.jay: Add opt_semicolon to the interface declaration.
7159
7160         * expression.cs: Pass location information to
7161         ConvertImplicitStandard. 
7162
7163         * class.cs: Added debugging code to track return values from
7164         interfaces. 
7165
7166 2002-03-05  Miguel de Icaza  <miguel@ximian.com>
7167
7168         * expression.cs (Is.DoResolve): If either side of the `is' is an
7169         interface, do not flag the warning.
7170
7171         * ecore.cs (ImplicitReferenceConversion): We need a separate test
7172         for interfaces
7173
7174         * report.cs: Allow for --fatal to be used with --probe.
7175         
7176         * typemanager.cs (NoTypes): Move the definition for the empty Type
7177         array here. 
7178
7179         * class.cs (TypeContainer.FindMembers): Also look for methods defined by
7180         properties. 
7181         (TypeContainer.DefineProxy): New function used to proxy to parent
7182         implementations when implementing interfaces.
7183         (TypeContainer.ParentImplements): used to lookup if our parent
7184         implements a public function that is required by an interface.
7185         (TypeContainer.VerifyPendingMethods): Hook this up.
7186
7187         * typemanager.cs (TypeManager, AddModule, AddAssembly): Make the
7188         `modules' and `assemblies' arraylists into arrays.  We only grow
7189         these are the very early start up of the program, so this improves
7190         the speedof LookupType (nicely measured).
7191
7192         * expression.cs (MakeByteBlob): Replaced unsafe code with
7193         BitConverter, as suggested by Paolo.
7194
7195         * cfold.cs (ConstantFold.Binary): Special case: perform constant
7196         folding of string concatenation, but if either side is a string,
7197         and the other is not, then return null, and let the runtime use
7198         the concatenation on the string plus the object (using
7199         `Object.ToString'). 
7200
7201 2002-03-04  Miguel de Icaza  <miguel@ximian.com>
7202
7203         Constant Folding has been implemented now.
7204         
7205         * expression.cs (Unary.Reduce): Do not throw an exception, catch
7206         the error instead on types that are not supported in one's
7207         complement. 
7208
7209         * constant.cs (Constant and all children): New set of functions to
7210         perform implict and explicit conversions.
7211         
7212         * ecore.cs (EnumConstant): Implement the new functions to perform
7213         conversion by proxying to the child expression.
7214
7215         * codegen.cs: (ConstantCheckState): Constant evaluation has its
7216         own separate setting that can not be turned off from the command
7217         line using --unchecked or --checked and is only controlled using
7218         the checked/unchecked statements and expressions.  This setting is
7219         used by the constant folder to flag errors.
7220
7221         * expression.cs (CheckedExpr, UncheckedExpr): Set the
7222         ConstantCheckState as well.   
7223
7224         During Resolve, they also have to flag the state, because the
7225         constant folder runs completely in the Resolve phase.
7226
7227         * statement.cs (Checked, Unchecked): Set the ConstantCheckState as
7228         well.
7229
7230 2002-03-01  Miguel de Icaza  <miguel@ximian.com>
7231
7232         * cfold.cs: New file, this file contains the constant folder.
7233         
7234         * ecore.cs (IMemoryLocation.AddressOf): Now takes an extra
7235         argument to track whether we are using the resulting address to
7236         load or store a value and provide better error messages. 
7237
7238         (FieldExpr.Emit, FieldExpr.EmitAssign, FieldExpr.AddressOf): Use
7239         new AddressOf arguments.
7240
7241         * statement.cs (Foreach.EmitCollectionForeach): Update
7242
7243         * expression.cs (Argument.Emit): Call AddressOf with proper
7244         arguments to track usage.
7245
7246         (New.DoEmit): Call AddressOf with new arguments.
7247
7248         (Unary.Emit): Adjust AddressOf call.
7249
7250 2002-03-01  Ravi Pratap  <ravi@ximian.com>
7251
7252         * cs-parser.jay (member_access): Change the case for pre-defined types
7253         to use a MemberAccess instead of a SimpleName. Thanks to Felix again for 
7254         this suggestion.
7255
7256         * class.cs (Operator::Emit): If we are abstract or extern, we don't have
7257         a method body.
7258
7259         * attribute.cs (CheckAttribute, ApplyAttribute): Ensure that we treat operators
7260         essentially like methods and apply attributes like MethodImplOptions to them too.
7261
7262         * ecore.cs (SimpleName.SimpleNameResolve): Perform a check on ec.TypeContainer.TypeBuilder
7263         not being null.
7264
7265         * codegen.cs (EmitContext): The constructor now takes in an extra argument specifying the
7266         DeclSpace as the distinction is important. We provide sane defaults as usually the TypeContainer
7267         is the DeclSpace.
7268
7269         * Update code everywhere accordingly.
7270
7271         * ecore.cs : Change references to ec.TypeContainer to ec.DeclSpace where appropriate.
7272
7273         * cs-parser.jay (enum_declaration): Set the current namespace of the enum.
7274
7275 2002-02-28  Ravi Pratap  <ravi@ximian.com>
7276
7277         * rootcontext.cs (LookupType): As we cycle through the chain of namespaces
7278         try performing lookups against those instead of jumping straight into using
7279         the 'using' clauses.
7280
7281         (ImplicitParent): Add. Thanks to Felix Arrese-Igor for this idea.
7282
7283         (LookupType): Perform lookups in implicit parents too.
7284
7285         * class.cs (GetInterfaceOrClass): Modify to perform the exact same lookup
7286         sequence as RootContext.LookupType. 
7287
7288         * rootcontext.cs (NamespaceLookup): Split out code from LookupType which tries 
7289         the various cases of namespace lookups into this method.
7290
7291 2002-03-01  Miguel de Icaza  <miguel@ximian.com>
7292
7293         * cs-parser.jay: Add support for [Attribute ()] (empty arguments
7294         in positional arguments)
7295
7296         * class.cs (Operator): Update the AllowedModifiers to contain
7297         extern. 
7298
7299         * cs-parser.jay: Update operator declaration to allow for the
7300         operator body to be empty.
7301
7302         * cs-tokenizer.cs: Added '\u' unicode support in strings and hex
7303         values. 
7304
7305 2002-02-27  Miguel de Icaza  <miguel@ximian.com>
7306
7307         * class.cs (Method.Emit): Label parameters.
7308
7309         * driver.cs: Return 1 or 0 as the program exit code.
7310
7311 2002-02-26  Miguel de Icaza  <miguel@ximian.com>
7312
7313         * expression.cs: Special case the `null' object when trying to
7314         auto-compute the type, as anything can be explicitly converted to
7315         that. 
7316
7317         * ecore.cs (Expression.ConvertExplicit): Bug fix, thanks for
7318         spotting this Paolo.
7319
7320         (Expression.ImplicitNumericConversion): Perform comparissions of
7321         the type using the underlying type in the case of an enumeration
7322         rather than using the enumeration type for the compare.
7323
7324         Cope with the underlying == type case, which is not possible to
7325         catch before. 
7326
7327         (Expression.ConvertNumericExplicit): Perform comparissions of
7328         the type using the underlying type in the case of an enumeration
7329         rather than using the enumeration type for the compare.
7330
7331         * driver.cs: If the user does not supply an extension, assume .exe
7332
7333         * cs-parser.jay (if_statement): Rewrote so that we can track the
7334         location for the if statement.
7335
7336         * expression.cs (Binary.ConstantFold): Only concat strings when
7337         the operation is "+", not everything ;-)
7338
7339         * statement.cs (Statement.EmitBoolExpression): Take a location
7340         argument. 
7341         (If, While, Do): Track location.
7342
7343         * expression.cs (Binary.ResolveOperator): In the object + string
7344         case, I was missing a call to ConvertImplicit
7345
7346 2002-02-25  Ravi Pratap  <ravi@ximian.com>
7347
7348         * parameter.cs (Parameter.ExternalType): Take in extra DeclSpace and
7349         Location arguments. Ensure we use RootContext.LookupType to do our work
7350         and not try to do a direct Type.GetType and ModuleBuilder.GetType
7351
7352         * interface.cs (PopulateMethod): Handle the type of the parameter being
7353         null gracefully.
7354
7355         * expression.cs (Invocation.BetterFunction): Handle the case when we 
7356         have a params method with no fixed arguments and a call is made with no
7357         arguments.
7358
7359 2002-02-25  Miguel de Icaza  <miguel@ximian.com>
7360
7361         * cs-tokenizer.cs: Add support for the quote-escape-sequence in
7362         the verbatim-string-literal
7363
7364         * support.cs (InternalParameters.ParameterModifier): handle null
7365         fixed parameters.
7366         (InternalParameters.ParameterType): ditto.
7367
7368         * parameter.cs (VerifyArgs): Also check if the fixed parameter is
7369         duplicating the name of the variable parameter.
7370         (GetParameterByName): Fix bug where we were not looking up array
7371         paramters if they were the only present (thanks Paolo!).
7372         (GetParameterInfo): We only have an empty set of types if both
7373         fixed and array are set to null.
7374         (GetParameterInfo-idx): Handle FixedParameter == null
7375
7376         * cs-parser.jay: Handle the case where there is no catch
7377         statements (missing null test).
7378
7379 2002-02-22  Miguel de Icaza  <miguel@ximian.com>
7380
7381         * driver.cs (MainDriver): Be conservative on our command line
7382         handling.
7383
7384         Catch DirectoryNotFoundException when calling GetFiles.
7385         
7386         (SplitPathAndPattern): Used to split the input specification into
7387         a path and a pattern that we can feed to Directory.GetFiles.
7388
7389 2002-02-21  Miguel de Icaza  <miguel@ximian.com>
7390
7391         * statement.cs (Fixed): Implement the last case of the Fixed
7392         statement (string handling).
7393
7394         * expression.cs (StringPtr): New class used to return a char * to
7395         a string;  Used by the Fixed statement.
7396
7397         * typemanager.cs: Add char_ptr_type.  Add get_OffsetToStringData method.
7398
7399         * expression.cs (Binary.ResolveOperator): Remove redundant
7400         MemberLookup pn parent type.
7401         Optimize union call, we do not need a union if the types are the same.
7402         (Unary.ResolveOperator): REmove redundant MemberLookup on parent
7403         type.
7404
7405         Specialize the use of MemberLookup everywhere, instead of using
7406         the default settings. 
7407
7408         (StackAlloc): Implement stackalloc keyword.
7409
7410         * cs-parser.jay: Add rule to parse stackalloc.
7411         
7412         * driver.cs: Handle /h, /help, /?
7413
7414         * expression.cs (MakeByteBlob): Removed the hacks we had in place
7415         before we supported unsafe code.
7416         
7417         * makefile: add --unsafe to the self compilation of mcs.
7418
7419 2002-02-20  Miguel de Icaza  <miguel@ximian.com>
7420
7421         * expression.cs (PointerArithmetic): New class that is used to
7422         perform pointer arithmetic.
7423         (Binary.Resolve): Handle pointer arithmetic
7424         Handle pointer comparission.
7425         (ArrayPtr): Utility expression class that is used to take the
7426         address of an array.
7427
7428         (ElementAccess): Implement array access for pointers
7429         
7430         * statement.cs (Fixed): Implement fixed statement for arrays, we
7431         are missing one more case before we are done.
7432
7433         * expression.cs (Indirection): Implement EmitAssign and set the
7434         ExprClass to Variable.  This allows pointer dereferences to be
7435         treated as variables, and to have values assigned to them.
7436         
7437         * ecore.cs (Expression.StoreFromPtr): New utility function to
7438         store values dereferencing.
7439
7440 2002-02-20  Ravi Pratap  <ravi@ximian.com>
7441
7442         * expression.cs (Binary.ResolveOperator): Ensure that we are
7443         not trying to operate on a void type - this fixes the reported
7444         bug.
7445
7446         * decl.cs (CheckMethodAgainstBase): Do not allow overriding if
7447         the parent implementation is sealed.
7448
7449         * ../errors/cs0239.cs : Add.
7450
7451         * attribute.cs (ApplyAttributes): Handle Modulebuilders too.
7452
7453         * typemanager.cs (unverifiable_code_type): Corresponds to 
7454         System.Security.UnverifiableCodeAttribute. We need to emit this for modules
7455         which have unsafe code in them.
7456
7457         * rootcontext.cs (EmitCode): Emit the above attribute when we are in an 
7458         unsafe context.
7459
7460 2002-02-19  Miguel de Icaza  <miguel@ximian.com>
7461
7462         * cs-tokenizer.cs: Add support for @"litreal strings"
7463
7464         Make tokenizer accept pre-processor directives
7465         on any column (remove the old C-like limitation). 
7466
7467         * rootcontext.cs (EmitCode): Emit any global attributes.
7468         (AddGlobalAttributes): Used to keep track of assembly attributes. 
7469
7470         * attribute.cs (ApplyAttributes): Support AssemblyAttributes.
7471
7472         * cs-parser.jay: Add support for global attributes.  
7473
7474 2002-02-17  Miguel de Icaza  <miguel@ximian.com>
7475
7476         * expression.cs (Indirection): New helper class.  Unary will
7477         create Indirection classes to be able to implement the
7478         IMemoryLocation interface on it.
7479
7480 2002-02-16  Miguel de Icaza  <miguel@ximian.com>
7481
7482         * cs-parser.jay (fixed_statement): reference the right statement.
7483
7484         * statement.cs (Fixed.Emit): Finish implementing the fixed
7485         statement for the &x case.
7486
7487 2002-02-14  Miguel de Icaza  <miguel@ximian.com>
7488
7489         * class.cs (Property.Define, Method.Define): Remove newslot when
7490         `implementing'.  
7491
7492         * modifiers.cs: My use of NewSlot when `Abstract' was set was
7493         wrong.  NewSlot should only be used if the `new' keyword is present.
7494
7495         * driver.cs (GetSystemDir): Use CodeBase instead of FullName for
7496         locating our system dir.  Sorry about this.
7497
7498 2002-02-13  Miguel de Icaza  <miguel@ximian.com>
7499
7500         * driver.cs (GetSystemDir): Compute correctly the location of our
7501         system assemblies.  I was using the compiler directory instead of
7502         the library directory.
7503
7504 2002-02-13  Ravi Pratap  <ravi@ximian.com>
7505
7506         * expression.cs (BetterFunction): Put back in what Miguel commented out
7507         since it is the correct fix. The problem is elsewhere ;-)
7508
7509         (IsParamsMethodApplicable): Fix bug where we were not checking that the fixed
7510         parameters of the parms method are themselves compatible or not !
7511
7512         (StandardConversionExists): Fix very dangerous bug where we were forgetting
7513         to check that a class implements an interface before saying that an implicit
7514         conversion was allowed. Use ImplementsInterface to do the checking.
7515
7516 2002-02-13  Miguel de Icaza  <miguel@ximian.com>
7517
7518         * class.cs (Method.Define): Track whether we are an explicit
7519         implementation or not.  And only call DefineMethodOverride if we
7520         are an explicit implementation.
7521
7522         (Property.DefineMethod): Ditto.
7523
7524 2002-02-11  Ravi Pratap  <ravi@ximian.com>
7525
7526         * expression.cs (BetterFunction): Catch hideous bug which was
7527          preventing us from detecting ambiguous calls due to implicit casts i.e
7528         cs0121.
7529
7530 2002-01-29  Miguel de Icaza  <miguel@ximian.com>
7531
7532         * support.cs (Pair): Remove un-needed method.  I figured why I was
7533         getting the error in cs-parser.jay, the variable in a foreach loop
7534         is readonly, and the compiler does not really treat this as a variable.
7535
7536         * cs-parser.jay (fixed_statement): Fix grammar.  Use ASSIGN
7537         instead of EQUALS in grammar.  
7538
7539         * typemanager.cs (VerifyUnmanaged): Report correct error (208)
7540
7541         * expression.cs (Unary.DoResolve): Check whether the argument is
7542         managed or not.
7543
7544 2002-01-28  Miguel de Icaza  <miguel@ximian.com>
7545
7546         * support.cs: Api for Pair to set a value.  Despite the fact that
7547         the variables are public the MS C# compiler refuses to compile
7548         code that accesses the field if the variable is part of a foreach
7549         statement. 
7550
7551         * statement.cs (Fixed): Begin implementation of the fixed
7552         statement.
7553
7554         (Block.AddVariable): Return the VariableInfo on success and null
7555         on failure instead of true/false. 
7556
7557         * cs-parser.jay (foreach): Catch errors on variables already
7558         defined (we were ignoring this value before) and properly unwind
7559         the block hierarchy
7560
7561         (fixed_statement): grammar for the fixed statement.
7562
7563 2002-01-25  Miguel de Icaza  <miguel@ximian.com>
7564
7565         * expression.cs (UnaryMutator.IsIncrementableNumber): Allow also
7566         pointer types to be incretemented.
7567
7568         (SizeOf): Implement.
7569
7570         * cs-parser.jay (pointer_member_access): Implement
7571         expr->IDENTIFIER production.
7572
7573         * expression.cs (IndexerAccess.DoResolve, ArrayAccess.DoResolve,
7574         MemberAccess.DoResolve, Invocation.DoResolve): Check for pointers
7575         on safe contexts.
7576
7577         (Unary): Implement indirection.
7578
7579         * ecore.cs (Expression.UnsafeError): Reports error 214 (pointer
7580         use in non-unsafe context).
7581
7582         (SimpleName.DoResolve): Check for pointers in field access on safe
7583         contexts. 
7584
7585         (Expression.LoadFromPtr): Factor the load-indirect code in this
7586         function.  This was duplicated in UnboxCast and ParameterReference
7587
7588 2002-01-24  Miguel de Icaza  <miguel@ximian.com>
7589
7590         * expression.cs (ComposedCast): report an error if a pointer cast
7591         is used in a safe region.
7592
7593         * ecore.cs (Expression.ConvertExplicit): Add rules for implicit
7594         pointer type casts in unsafe context.
7595
7596         * codegen.cs (EmitContext): Set up IsUnsafe.
7597
7598         * cs-parser.jay (non_expression_type): Add productions for pointer
7599         casts. 
7600
7601         * expression.cs (Invocation.EmitCall): Remove chunk of buggy
7602         code.  We should not use force into static mode if the method is
7603         not virtual.  Fixes bug in MIS
7604
7605         * statement.cs (Do.Emit, While.Emit, For.Emit,
7606         Statement.EmitBoolExpression): Add support to Do and While to
7607         propagate infinite loop as `I do return' semantics.
7608
7609         Improve the For case to also test for boolean constants.
7610
7611         * attribute.cs (Attribute.ApplyAttributes): Add ParameterBuilder
7612         to the list of attributes we can add.
7613
7614         Remove `EmitContext' argument.
7615
7616         * class.cs (Method.Define): Apply parameter attributes.
7617         (Constructor.Define): Apply parameter attributes.
7618         (MethodCore.LabelParameters): Move here the core of labeling
7619         parameters. 
7620
7621         * support.cs (ReflectionParameters.ParameterModifier,
7622         InternalParameters.ParameterModifier): Use IsByRef on the type and
7623         only return the OUT bit for these parameters instead of in/out/ref
7624         flags.
7625
7626         This is because I miss-understood things.  The ParameterInfo.IsIn
7627         and IsOut represent whether the parameter has the [In] and [Out]
7628         attributes set.  
7629
7630 2002-01-22  Miguel de Icaza  <miguel@ximian.com>
7631
7632         * ecore.cs (FieldExpr.Emit): Release temporaries.
7633
7634         * assign.cs (LocalTemporary.Release): new function.
7635
7636         * codegen.cs (EmitContext.GetTemporaryStorage,
7637         EmitContext.FreeTemporaryStorage): Rework the way we deal with
7638         temporary storage.  Now we can "put back" localbuilders when we
7639         are done with them
7640
7641 2002-01-21  Miguel de Icaza  <miguel@ximian.com>
7642
7643         * ecore.cs (FieldExpr.Emit): Handle initonly fields specially: we
7644         need to make a copy of the variable to generate verifiable code.
7645
7646 2002-01-19  Miguel de Icaza  <miguel@ximian.com>
7647
7648         * driver.cs: Compute dynamically the system directory.
7649
7650         * ecore.cs (CopyNewMethods): reworked, exposed, made public.
7651         Slower, but more generally useful.  Used by the abstract
7652         registering implementation. 
7653
7654         * expression.cs (ResolveMemberAccess): Reorder the way we evaluate
7655         the rules for the special rule on Type/instances.  First check if
7656         we have the same name, and if so, try that special static path
7657         rather than the instance path.
7658         
7659 2002-01-18  Miguel de Icaza  <miguel@ximian.com>
7660
7661         * cs-parser.jay: Emit 642 (warning: possible empty statement) for
7662         for, while and if.
7663
7664         * class.cs (TypeBuilder.DefineType): Do not allow inheritance from
7665         Enum, ValueType, Delegate or Array for non-corlib compiles.
7666
7667         * cs-tokenizer.cs: Catch long identifiers (645)
7668
7669         * typemanager.cs (IndexerPropetyName): Ravi never tested this
7670         piece of code.
7671
7672         * class.cs (TypeContainer.RegisterRequiredImplementations): Bug
7673         fix, we were returning too early, so we were not registering
7674         pending methods from abstract classes.
7675
7676         Do not register pending methods if the class is abstract.
7677
7678         * expression.cs (Conditional.DoResolve): Report circular implicit
7679         conversions when we neecd to compute it for conditional
7680         expressions. 
7681
7682         (Is.DoResolve): If the expression is always of the provided type,
7683         flag warning 183.  If the expression can not ever be of the
7684         provided type flag warning 184.
7685
7686         * class.cs: Catch 169 as well.
7687
7688         * ecore.cs (FieldExpr): For now in AddressOf mark as assigned and
7689         read. 
7690
7691 2002-01-18  Nick Drochak  <ndrochak@gol.com>
7692
7693         * makefile: remove path to beta2 csc.exe.  path to csc.exe must be in PATH instead.
7694
7695 2002-01-17  Miguel de Icaza  <miguel@ximian.com>
7696
7697         * interface.cs: (PopulateMethod): Check for pointers being defined
7698         only if the unsafe context is active.
7699         (PopulateProperty): ditto.
7700         (PopulateIndexer): ditto.
7701
7702         * class.cs (Method, Method.Define): Allow `unsafe' modifier to be
7703         specified.  If pointers are present, make sure that they are
7704         present in an unsafe context.
7705         (Constructor, Constructor.Define): ditto.
7706         (Field, Field.Define): ditto.
7707         (Property, Property.Define): ditto.
7708         (Event, Event.Define): ditto.
7709
7710         * interface.cs (Interface.GetInterfaceTypeByName): Only lookup the
7711         hashtable if there are classes or structs defined.
7712
7713         * expression.cs (LocalVariableReference.DoResolve): Simplify this
7714         code, as the constant resolution moved.
7715
7716         * statement.cs (Block.EmitMeta): Resolve all constants as we emit
7717         the metadata, so we can flag error 133. 
7718
7719         * decl.cs (MemberCore.UnsafeOK): New function to test that a
7720         pointer is being declared in an unsafe context.
7721
7722 2002-01-16  Miguel de Icaza  <miguel@ximian.com>
7723
7724         * modifiers.cs (Modifiers.Check): Require a Location argument.
7725         Report error 227 for Unsafe use.
7726
7727         * typemanager.cs: Remove IsPointerType, we should be using Type.IsPointer
7728
7729         * statement.cs (For.Emit): If the test is null, then report that
7730         we do `return', as we wont reach anything afterwards.
7731
7732         (Switch.SwitchGoverningType): Track the expression that matched
7733         the conversion.
7734
7735         * driver.cs: Allow negative numbers as an error code to flag.
7736
7737         * cs-parser.jay: Handle 1551.
7738
7739         * namespace.cs: Add 1537 checking (repeated using alias namespaces).
7740
7741 2002-01-15  Miguel de Icaza  <miguel@ximian.com>
7742
7743         * cs-parser.jay: Report 1518 (type declaration can only contain
7744         class, struct, interface, enum or delegate)
7745
7746         (switch_label): Report 1523 (keywords `case' or `default' must
7747         preced code)
7748
7749         (opt_switch_sections): Report 1522 (empty switch)
7750
7751         * driver.cs: Report 1515 (response file specified multiple times)
7752         Report 1516 (Source file specified multiple times).
7753
7754         * expression.cs (Argument.Resolve): Signal 1510
7755
7756         (BaseAccess.Resolve, BaseIndexer.Resolve): Signal 1511 (base
7757         access not allowed in static code)
7758
7759 2002-01-11  Ravi Pratap  <ravi@ximian.com>
7760
7761         * typemanager.cs (IsPointerType): Utility method which we are going
7762         to need a lot.
7763
7764         * ecore.cs (ImplicitReferenceConversion): A pointer type cannot be cast to
7765         the object type, so we take care of that.
7766
7767         * expression.cs (FullMethodDesc): Also include the return type in descriptions.
7768         
7769         * support.cs (ParameterDesc): Fix minor bug which was causing params tags to be
7770         added to non-params parameters :-)
7771
7772         * typemanager.cs (CSharpName): Include 'void' type too. 
7773
7774         (void_ptr_type): Include in the set of core types.
7775
7776         * ecore.cs (ConvertImplicit): Make use of ConvertImplicitStandard instead of 
7777         duplicating code.
7778
7779         (ConvertImplicitStandard): Handle standard implicit pointer conversions when we have 
7780         an unsafe context.
7781
7782         * cs-parser.jay (local_variable_pointer_type): Add support for 'void *' as I had 
7783         completely forgotten about it.
7784
7785 2002-01-10  Ravi Pratap  <ravi@ximian.com>
7786
7787         * cs-parser.jay (pointer_type): Add. This begins our implementation
7788         of parsing rules for unsafe code.
7789
7790         (unsafe_statement): Implement.
7791
7792         (embedded_statement): Modify to include the above.
7793
7794         * statement.cs (Unsafe): Implement new class for unsafe blocks.
7795
7796         * codegen.cs (EmitContext.InUnsafe): Add. This determines
7797         if the current context is an unsafe one.
7798
7799         * cs-parser.jay (local_variable_pointer_type): Since local variable types
7800         are handled differently, we need separate rules for them.
7801
7802         (local_variable_declaration): Update to use local_variable_pointer_type
7803         to allow variable declarations of unmanaged pointer types.
7804
7805         * expression.cs (Unary.ResolveOperator): Ensure that the '&' operator is used only
7806         in unsafe contexts.
7807
7808         * ../errors/cs0214.cs : Add.
7809
7810 2002-01-16  Nick Drochak  <ndrochak@gol.com>
7811
7812         * makefile: remove 'response' file when cleaning.
7813
7814 2002-01-15  Miguel de Icaza  <miguel@ximian.com>
7815
7816         * cs-parser.jay: Report 1524.
7817
7818 2002-01-14  Miguel de Icaza  <miguel@ximian.com>
7819
7820         * typemanager.cs (RegisterMethod): drop checking if we have
7821         registered this from here
7822
7823 2002-01-12  Miguel de Icaza  <miguel@ximian.com>
7824
7825         * class.cs (Method.EmitDestructor): Implement calling our base
7826         destructor. 
7827
7828         * statement.cs (Try.Emit): Fix to reset the InFinally to the old
7829         value of InFinally.
7830
7831         * codegen.cs (EmitContext.EmitTopBlock): Destructors will call
7832         this routine and will wrap the call in a try/catch block.  Deal
7833         with the case.
7834
7835 2002-01-11  Miguel de Icaza  <miguel@ximian.com>
7836
7837         * ecore.cs (Expression.MemberLookup): instead of taking a
7838         parameter `same_type' that was used to tell whether we could
7839         access private members we compute our containing type from the
7840         EmitContext.
7841
7842         (FieldExpr): Added partial support for volatile fields.  This does
7843         not work for volatile fields exposed from assemblies, as I can not
7844         figure out how to extract the modreq from it.
7845
7846         Updated all the source files to use this.
7847
7848         * codegen.cs (EmitContext): Compute ContainerType ahead of time,
7849         because it is referenced by MemberLookup very often. 
7850
7851 2002-01-09  Ravi Pratap  <ravi@ximian.com>
7852
7853         * typemanager.cs (IndexerPropertyName): If we have a TypeBuilder, use
7854         TypeBuilder.GetCustomAttributes to retrieve what we need.
7855
7856         Get rid of redundant default_member_attr_type as this is the same as
7857         default_member_type which already exists.
7858
7859         * interface.cs, attribute.cs : Update accordingly.
7860         
7861 2002-01-08  Miguel de Icaza  <miguel@ximian.com>
7862
7863         * typemanager.cs: Enable IndexerPropertyName again.  It does not
7864         work for TYpeBuilders though.  Ravi, can you please fix this?
7865
7866         * cs-tokenizer.cs: Accept _ as a name in pp-expressions.
7867
7868         * expression.cs (Argument.Emit): Handle the case of ref objects
7869         being passed to ref functions;  
7870
7871         (ParameterReference.EmitLoad): Loads the content of the pointer
7872         without dereferencing.
7873
7874 2002-01-07  Miguel de Icaza  <miguel@ximian.com>
7875
7876         * cs-tokenizer.cs: Implemented the pre-processing expressions.
7877
7878 2002-01-08  Ravi Pratap  <ravi@ximian.com>
7879
7880         * class.cs (Indexer.DefineMethod): Incorporate the interface
7881         type in the name of the method if we are doing explicit interface
7882         implementation.
7883
7884         * expression.cs (ConversionExists): Remove as it is completely obsolete.
7885
7886         (BetterConversion): Fix extremely trivial bug where we were referring to
7887         ConversionExists instead of StandardConversionExists ! Hooray, things are fine
7888         again !
7889
7890         * ../errors/bug16.cs : Add although we have fixed it.
7891
7892 2002-01-07  Miguel de Icaza  <miguel@ximian.com>
7893
7894         * expression.cs (BaseIndexer): Begin implementation.
7895
7896         * class.cs (TypeContainer.IsInterfaceMethod): Bug fix.
7897
7898         * cs-parser.jay (indexer_declarator): Use qualified_identifier
7899         production directly to remove a shift/reduce, and implement
7900         explicit interface implementation.
7901
7902         * cs-tokenizer.cs: Fix tokenizer, it was consuming one extra char
7903         after a floating point suffix.
7904
7905         * expression.cs (DoNumericPromotions): Improved the conversion for
7906         uint/uint.  If we have a constant, we avoid doing a typecast to a
7907         larger type.
7908
7909         * class.cs (Indexer): Implement explicit interface implementation
7910         for indexers.
7911         
7912 Sat Jan 5 16:08:23 CET 2002 Paolo Molaro <lupus@ximian.com>
7913
7914         * class.cs: make the default instance constructor public and hidebysig.
7915
7916 2001-01-03  Ravi Pratap  <ravi@ximian.com>
7917
7918         * interface.cs (EmitDefaultMemberAttr): Make this helper method static
7919         so we can call it from elsewhere.
7920
7921         * class.cs (TypeContainer.Emit): Emit the attribute here too. The rule is that
7922         we emit it internally if the class has a defined indexer; otherwise the user
7923         emits it by decorating the class definition with the DefaultMemberAttribute.
7924
7925         * attribute.cs (ApplyAttributes): Perform checks to see that the DefaultMember
7926         attribute is not used on a type which defines an indexer.
7927
7928         * cs-tokenizer.cs (get_cmd_arg): Ensure we trim whitespace and also include the tab
7929         character when we skip whitespace.
7930
7931         * ../errors/cs0646.cs : Add.
7932
7933 2002-01-03  Miguel de Icaza  <miguel@ximian.com>
7934
7935         * ecore.cs (SimpleName.ResolveSimpleName): Report error 120
7936         again. 
7937
7938         * makefile: Add practical target `mcs3.exe' which builds the third
7939         generation compiler. 
7940
7941         * expression.cs (New): Fix structures constructor calling.
7942
7943         * class.cs (Property, Method, Indexer): Emit Final flag on the
7944         method if we are an interface implementation and we are not
7945         abstract. 
7946
7947         * ecore.cs (PropertyExpr): New public field `IsBase', tells
7948         whether this property is referencing a `base' method.
7949
7950         * expression.cs (Invocation.EmitCall): take an extra argument:
7951         is_base, this is used to determine whether the `call' or
7952         `callvirt' opcode should be used.
7953
7954         
7955         * delegate.cs: update EmitCall.
7956
7957         * class.cs (Method.Define): Set NewSlot for the cases where we are
7958         not implementing an interface method.
7959
7960         (Property.Define): ditto.
7961
7962 2002-01-02  Miguel de Icaza  <miguel@ximian.com>
7963
7964         * cs-tokenizer.cs: (Tokenizer.escape): Escape '\r' as '\r' not as
7965         'r'.  Allows mcs to parse itself fully.
7966
7967 2002-01-02  Ravi Pratap  <ravi@ximian.com>
7968
7969         * expression.cs (ArrayCreation.num_automatic_initializers): Keep track
7970         of the number of initializers that require the InitializeArray method.
7971
7972         (CheckIndices): Store the Expression in all cases - not the plain value. Also
7973         update the above field where necessary.
7974
7975         (MakeByteBlob): Update accordingly.
7976
7977         (DoEmit): Call EmitStaticInitializers only if the number of initializers is 
7978         greater than 2.
7979
7980         (EmitDynamicInitializers): Update in accordance with the new optimization.
7981
7982         (ArrayAccess.EmitStoreOpcode): Include char type along with short and ushort - the
7983         same OpCode applies.
7984
7985         * cs-parser.jay : Fix some glaring errors I introduced.
7986
7987 2002-01-01  Ravi Pratap  <ravi@ximian.com> 
7988
7989         * parameters.cs (AddVariable, AddConstant): Pass in current_local_parameters
7990         so that we can check for name clashes there too.
7991
7992         * typemanager.cs (default_member_attr_type): The attribute that we need to emit
7993         for interface indexers.
7994
7995         * interfaces.cs (Define): Emit the default member attribute.
7996
7997         * expression.cs (MakeByteBlob): Fix extremely trivial bug where the wrong
7998         variable was being referred to while setting the value ;-)
7999
8000 2002-01-01  Miguel de Icaza  <miguel@ximian.com>
8001
8002         * expression.cs (MakeByteBlob): Optimize: we do not need to fill
8003         byte-by-byte information when we know the data is zero.
8004
8005         Make the block always a multiple of 4, because
8006         DefineInitializedData has a bug.
8007
8008         * assign.cs: Fix, we should assign from the temporary, not from
8009         the source. 
8010
8011         * expression.cs (MakeByteBlob): Fix my incorrect code.
8012
8013 2001-12-31  Miguel de Icaza  <miguel@ximian.com>
8014
8015         * typemanager.cs (EnumToUnderlying): This function is used to get
8016         the underlying type from an enumeration, because it does not
8017         always work. 
8018
8019         * constant.cs: Use the I4_S form for values between -128 and 127.
8020
8021         * statement.cs (Block.LookupLabel): Looks up a label.
8022         (Block): Drop support for labeled blocks.
8023
8024         (LabeledStatement): New kind of statement that represents a label
8025         only.
8026
8027         (Goto): Finally implement this bad boy.
8028         
8029         * cs-parser.jay: Update to reflect new mechanism to implement
8030         labels.
8031
8032 2001-12-30  Miguel de Icaza  <miguel@ximian.com>
8033
8034         * codegen.cs (EmitContext.This): a codegen property that keeps the
8035         a single instance of this instead of creating many different this
8036         instances. 
8037
8038         * delegate.cs (Delegate.DoResolve): Update to use the property;
8039
8040         * ecore.cs (SimpleName.SimpleNameResolve): Ditto
8041
8042         * expression.cs (BaseAccess.DoResolve): Ditto.
8043
8044 2001-12-29  Ravi Pratap  <ravi@ximian.com>
8045
8046         * typemanager.cs (methodimpl_attr_type): Add to hold the type
8047         corresponding to System.Runtime.CompilerServices.MethodImplAttribute.
8048
8049         (InitCoreTypes): Update accordingly.
8050
8051         * attribute.cs (Resolve): Remember if the attribute is a MethodImplAttribute
8052         so we can quickly store the state.
8053
8054         (ApplyAttributes): Set the correct implementation flags
8055         for InternalCall methods.
8056
8057 2001-12-29  Miguel de Icaza  <miguel@ximian.com>
8058
8059         * expression.cs (EmitCall): if a method is not virtual, then do
8060         not use callvirt on it.
8061
8062         (ArrayAccess.EmitAssign): storing non-builtin value types (ie,
8063         user defined stuff) requires the use of stobj, which takes an
8064         address on the stack instead of an array and an index.  So emit
8065         the Ldelema operation for it.
8066
8067         (EmitStoreOpcode): Use stobj for valuetypes.
8068
8069         (UnaryMutator.EmitCode): Use the right 1 value depending on
8070         whether we are dealing with int64/uint64, float or doubles.
8071
8072         * class.cs (TypeContainer.AddConstructor): Fix the logic to define
8073         constructors that I implemented last night.
8074
8075         (Constructor.IsDefault): Fix to work properly for static
8076         constructors.
8077
8078         * cs-parser.jay (CheckDef): report method signature errors.
8079         Update error number 103 to be 132.
8080
8081         * decl.cs: New AdditionResult enumeration value: MethodExists.
8082         Although we do this check for methods later on in the semantic
8083         analysis, catching repeated default constructors is so easy that
8084         we catch these here. 
8085         
8086         * expression.cs (Binary.DoNumericPromotions): Fix the uint64 type
8087         promotions code.
8088
8089         (ParameterReference.EmitAssign, Emit): handle
8090         bools as bytes.
8091
8092         (ArrayAccess.EmitLoadOpcode): Handle bool type here.
8093         (ArrayAccess.EmitStoreOpcode): ditto.
8094
8095         * cs-tokenizer.cs (is_punct): Eliminated empty computation.
8096
8097         * expression.cs (MakeByteBlob): Complete all the missing types
8098         (uint, short, ushort, byte, sbyte)
8099
8100         * class.cs: Only init instance field initializers on instance
8101         constructors. 
8102
8103         Rename `constructors' to instance_constructors. 
8104
8105         (TypeContainer.AddConstructor): Only add constructors to the list
8106         if it is not static.
8107
8108         Make sure that we handle default_static_constructor independently
8109         everywhere where we handle instance_constructors
8110
8111 2001-12-28  Miguel de Icaza  <miguel@ximian.com>
8112
8113         * class.cs: Do not lookup or create a base initializer for a
8114         static constructor.
8115
8116         (ConstructorInitializer.Resolve): use the proper type to lookup
8117         for constructors.
8118
8119         * cs-parser.jay: Report error 1585 (modifiers between type and name).
8120
8121         * enum.cs, interface.cs: Remove CloseType, this is taken care by
8122         in DeclSpace. 
8123
8124         * decl.cs: CloseType is now an virtual method, the default
8125         implementation just closes this type.
8126         
8127 2001-12-28  Ravi Pratap  <ravi@ximian.com>
8128
8129         * attribute.cs (DefinePInvokeMethod): Set the implementation flags
8130         to PreserveSig by default. Also emit HideBySig on such methods.
8131
8132         Basically, set the defaults to standard values.
8133
8134         * expression.cs (Invocation.BetterFunction): We need to make sure that for each
8135         argument, if candidate is better, it can't be worse than the best !
8136
8137         (Invocation): Re-write bits to differentiate between methods being
8138         applicable in their expanded form and their normal form - for params
8139         methods of course.
8140
8141         Get rid of use_standard everywhere as only standard conversions are allowed
8142         in overload resolution. 
8143
8144         More spec conformance.
8145         
8146 2001-12-27  Miguel de Icaza  <miguel@ximian.com>
8147
8148         * driver.cs: Add --timestamp, to see where the compiler spends
8149         most of its time.
8150
8151         * ecore.cs (SimpleName.DoResolve): Do not create an implicit
8152         `this' in static code.
8153
8154         (SimpleName.DoResolve): Implement in terms of a helper function
8155         that allows static-references to be passed upstream to
8156         MemberAccess.
8157
8158         (Expression.ResolveWithSimpleName): Resolve specially simple
8159         names when called by MemberAccess to implement the special
8160         semantics. 
8161
8162         (Expression.ImplicitReferenceConversion): Handle conversions from
8163         Null to reference types before others, as Null's type is
8164         System.Object. 
8165
8166         * expression.cs (Invocation.EmitCall): Handle the special case of
8167         calling methods declared on a reference type from a ValueType
8168         (Base classes System.Object and System.Enum)
8169
8170         (MemberAccess.Resolve): Only perform lookups on Enumerations if
8171         the left hand side is a TypeExpr, not on every enumeration. 
8172
8173         (Binary.Resolve): If types are reference types, then do a cast to
8174         object on operators != and == of both arguments.
8175         
8176         * typemanager.cs (FindMembers): Extract instance and static
8177         members if requested.
8178
8179         * interface.cs (PopulateProperty): Use void_type instead of null
8180         as the return type for the setter method.
8181
8182         (PopulateIndexer): ditto.
8183
8184 2001-12-27  Ravi Pratap  <ravi@ximian.com>
8185
8186         * support.cs (ReflectionParameters): Fix minor bug where we
8187         were examining the wrong parameter for the ParamArray attribute.
8188
8189         Cope with requests for the type of the parameter at position
8190         greater than the params parameter's. We now return the element
8191         type of the params array as that makes more sense.
8192
8193         * expression.cs (Invocation.IsParamsMethodApplicable): Update 
8194         accordingly as we no longer have to extract the element type
8195         ourselves.
8196
8197         (Invocation.OverloadResolve): Update.
8198
8199 2001-12-27  Miguel de Icaza  <miguel@ximian.com>
8200
8201         * statement.cs (Foreach.GetEnumeratorFilter): Do not compare
8202         against IEnumerator, test whether the return value is a descendant
8203         of the IEnumerator interface.
8204
8205         * class.cs (Indexer.Define): Use an auxiliary method to implement
8206         the other bits of the method definition.  Begin support for
8207         explicit interface implementation.
8208
8209         (Property.DefineMethod): Use TypeManager.void_type instead of null
8210         for an empty return value.
8211
8212 2001-12-26  Miguel de Icaza  <miguel@ximian.com>
8213
8214         * expression.cs (MemberAccess.ResolveMemberAccess): if we are
8215         dealing with a FieldExpr which is composed of a FieldBuilder, in
8216         the code path we did extract the constant, but we should have
8217         obtained the underlying value to be able to cast it (otherwise we
8218         end up in an infinite loop, this is what Ravi was running into).
8219
8220         (ArrayCreation.UpdateIndices): Arrays might be empty.
8221
8222         (MemberAccess.ResolveMemberAccess): Add support for section
8223         14.5.4.1 that deals with the special case of E.I when E is a type
8224         and something else, that I can be a reference to a static member.
8225
8226         (ArrayCreation.MakeByteBlob): It is not an error to not be able to
8227         handle a particular array type to create byte blobs, it is just
8228         something we dont generate byteblobs for.
8229
8230         * cs-tokenizer.cs (get_cmd_arg): Ignore \r in commands and
8231         arguments. 
8232
8233         * location.cs (Push): remove the key from the hashtable that we
8234         are about to add.   This happens for empty files.
8235
8236         * driver.cs: Dispose files after we have parsed them.
8237
8238         (tokenize): new function that only runs the tokenizer on its
8239         input, for speed testing.
8240
8241 2001-12-26  Ravi Pratap  <ravi@ximian.com>
8242
8243         * class.cs (Event.Define): Define the private field only if there
8244         are no accessors defined.
8245
8246         * expression.cs (ResolveMemberAccess): If there is no associated
8247         field with the event, that means we have an event defined with its
8248         own accessors and we should flag error cs0070 since transforming
8249         ourselves into a field is not valid in that case.
8250
8251         * ecore.cs (SimpleName.DoResolve): Same as above.
8252
8253         * attribute.cs (DefinePInvokeMethod): Set the default calling convention
8254         and charset to sane values.
8255
8256 2001-12-25  Ravi Pratap  <ravi@ximian.com>
8257
8258         * assign.cs (DoResolve): Perform check on events only if they 
8259         are being accessed outside the declaring type.
8260
8261         * cs-parser.jay (event_declarations): Update rules to correctly
8262         set the type of the implicit parameter etc.
8263
8264         (add_accessor, remove_accessor): Set current local parameters.
8265
8266         * expression.cs (Binary): For delegate addition and subtraction,
8267         cast the return value from the method into the appropriate delegate
8268         type.
8269
8270 2001-12-24  Ravi Pratap  <ravi@ximian.com>
8271
8272         * typemanager.cs (RegisterDelegateData, GetDelegateData): Get rid
8273         of these as the workaround is unnecessary.
8274
8275         * delegate.cs (NewDelegate.DoResolve): Get rid of bits which registered
8276         delegate data - none of that is needed at all.
8277
8278         Re-write bits to extract the instance expression and the delegate method
8279         correctly.
8280
8281         * expression.cs (Binary.ResolveOperator): Handle the '-' binary operator 
8282         on delegates too.
8283
8284         * attribute.cs (ApplyAttributes): New method to take care of common tasks
8285         of attaching attributes instead of duplicating code everywhere.
8286
8287         * everywhere : Update code to do attribute emission using the above method.
8288
8289 2001-12-23  Miguel de Icaza  <miguel@ximian.com>
8290
8291         * expression.cs (IsParamsMethodApplicable): if there are not
8292         parameters, return immediately.
8293
8294         * ecore.cs: The 0 literal can be implicity converted to an enum
8295         type. 
8296
8297         (SimpleName.DoResolve): First lookup the type, then lookup the
8298         members. 
8299
8300         (FieldExpr.Emit): If the InstanceExpression is a ValueType, we
8301         want to get its address.  If the InstanceExpression is not
8302         addressable, store the result in a temporary variable, then get
8303         the address of it.
8304
8305         * codegen.cs: Only display 219 errors on warning level or above. 
8306
8307         * expression.cs (ArrayAccess): Make it implement the
8308         IMemoryLocation interface.
8309
8310         (Binary.DoResolve): handle the operator == (object a, object b)
8311         and operator != (object a, object b) without incurring into a
8312         BoxedCast (because 5 != o should never be performed).
8313
8314         Handle binary enumerator operators.
8315
8316         (EmitLoadOpcode): Use Ldelema if the object we are loading is a
8317         value type, otherwise use Ldelem_ref.
8318
8319         Use precomputed names;
8320
8321         (AddressOf): Implement address of
8322
8323         * cs-parser.jay (labeled_statement): Fix recursive block
8324         addition by reworking the production.
8325
8326         * expression.cs (New.DoEmit): New has a special case:
8327                 
8328                  If we are dealing with a ValueType, we have a few
8329                  situations to deal with:
8330                 
8331                     * The target of New is a ValueType variable, that is
8332                       easy, we just pass this as the variable reference
8333                 
8334                     * The target of New is being passed as an argument,
8335                       to a boxing operation or a function that takes a
8336                       ValueType.
8337                 
8338                       In this case, we need to create a temporary variable
8339                       that is the argument of New.
8340
8341
8342 2001-12-23  Ravi Pratap  <ravi@ximian.com>
8343
8344         * rootcontext.cs (LookupType): Check that current_type is not null before
8345         going about looking at nested types.
8346
8347         * ecore.cs (EventExpr.EmitAddOrRemove): Rename from EmitAssign as we do
8348         not implement the IAssignMethod interface any more.
8349
8350         * expression.cs (MemberAccess.ResolveMemberAccess): Handle EventExprs specially
8351         where we tranform them into FieldExprs if they are being resolved from within
8352         the declaring type.
8353
8354         * ecore.cs (SimpleName.DoResolve): Do the same here.
8355
8356         * assign.cs (DoResolve, Emit): Clean up code considerably. 
8357
8358         * ../errors/bug10.cs : Add.
8359
8360         * ../errors/cs0070.cs : Add.
8361
8362         * typemanager.cs : Use PtrHashtable for Delegate data hashtable etc.
8363
8364         * assign.cs : Get rid of EventIsLocal everywhere.
8365         
8366 2001-12-23  Miguel de Icaza  <miguel@ximian.com>
8367
8368         * ecore.cs (ConvertIntLiteral): finished the implementation.
8369
8370         * statement.cs (SwitchLabel): Convert the value we are using as a
8371         key before looking up the table.
8372
8373 2001-12-22  Miguel de Icaza  <miguel@ximian.com>
8374
8375         * codegen.cs (EmitTopBlock): Require a Location argument now.
8376
8377         * cs-parser.jay (constructor_declarator): We need to setup
8378         current_local_parameters before we parse the
8379         opt_constructor_initializer, to allow the variables to be bound
8380         to the constructor arguments.
8381
8382         * rootcontext.cs (LookupType): First lookup nested classes in our
8383         class and our parents before we go looking outside our class.
8384
8385         * expression.cs (ConstantFold): Extract/debox the values at the
8386         beginnning. 
8387
8388         * rootcontext.cs (EmitCode): Resolve the constants first before we
8389         resolve the types.  This is not really needed, but it helps debugging.
8390
8391         * statement.cs: report location.
8392         
8393         * cs-parser.jay: pass location to throw statement.
8394
8395         * driver.cs: Small bug fix.
8396
8397         * report.cs: Updated format to be 4-zero filled digits.
8398
8399 2001-12-22  Ravi Pratap  <ravi@ximian.com>
8400
8401         * expression.cs (CheckIndices): Fix minor bug where the wrong
8402         variable was being referred to ;-)
8403
8404         (DoEmit): Do not call EmitStaticInitializers when the 
8405         underlying type is System.Object.
8406
8407 2001-12-21  Ravi Pratap  <ravi@ximian.com>
8408
8409         * ecore.cs (EventExpr.Resolve): Implement to correctly set the type
8410         and do the usual workaround for SRE.
8411
8412         * class.cs (MyEventBuilder.EventType): New member to get at the type
8413         of the event, quickly.
8414
8415         * expression.cs (Binary.ResolveOperator): Handle delegate addition.
8416
8417         * assign.cs (Assign.DoResolve): Handle the case when the target
8418         is an EventExpr and perform the necessary checks.
8419
8420         * ecore.cs (EventExpr.EmitAssign): Implement the IAssignMethod
8421         interface.
8422
8423         (SimpleName.MemberStaticCheck): Include check for EventExpr.
8424
8425         (EventExpr): Set the type in the constructor itself since we 
8426         are meant to be born fully resolved.
8427
8428         (EventExpr.Define): Revert code I wrote earlier.
8429                 
8430         * delegate.cs (NewDelegate.Resolve): Handle the case when the MethodGroup's
8431         instance expression is null. The instance expression is a This in that case
8432         or a null, depending on whether it is a static method or not.
8433
8434         Also flag an error if the reference to a method is ambiguous i.e the MethodGroupExpr
8435         refers to more than one method.
8436
8437         * assign.cs (DoResolve): Check whether the event belongs to the same Type container
8438         and accordingly flag errors.
8439
8440 2001-12-21  Miguel de Icaza  <miguel@ximian.com>
8441
8442         * statement.cs (Throw.Emit): Add support for re-throwing exceptions.
8443
8444 2001-12-22  Miguel de Icaza  <miguel@ximian.com>
8445
8446         * location.cs (ToString): Provide useful rutine.
8447
8448 2001-12-21  Miguel de Icaza  <miguel@ximian.com>
8449
8450         * ecore.cs (Expression.ConvertIntLiteral): Do not return Constant
8451         objects, return the actual integral boxed.
8452
8453         * statement.cs (SwitchLabel): define an ILLabel for each
8454         SwitchLabel. 
8455         
8456         (Switch.CheckSwitch): If the value is a Literal, extract
8457         the underlying literal.
8458         
8459         Also in the unused hashtable we had, add the SwitchLabel so we can
8460         quickly look this value up.
8461
8462         * constant.cs: Implement a bunch of new constants.  Rewrite
8463         Literal based on this.  Made changes everywhere to adapt to this.
8464         
8465         * expression.cs (Expression.MakeByteBlob): Optimize routine by
8466         dereferencing array only once, and also copes with enumrations.
8467
8468         bytes are two bytes wide, not one.
8469
8470         (Cast): Perform constant conversions.
8471         
8472         * ecore.cs (TryImplicitIntConversion): Return literals instead of
8473         wrappers to the literals here.
8474
8475         * expression.cs (DoNumericPromotions): long literals can converted
8476         to ulong implicity (this is taken care of elsewhere, but I was
8477         missing this spot).
8478
8479         * ecore.cs (Expression.Literalize): Make the return type Literal,
8480         to improve type checking.
8481
8482         * rootcontext.cs: Lookup for nested classes in our class hierarchy.
8483
8484 2001-12-20  Miguel de Icaza  <miguel@ximian.com>
8485
8486         * literal.cs: Revert code from ravi that checked the bounds.  The
8487         bounds are sane by the definition of the type itself. 
8488
8489         * typemanager.cs: Fix implementation of ImplementsInterface.  We
8490         need to actually look up in our parent hierarchy for interfaces
8491         implemented. 
8492
8493         * const.cs: Use the underlying type for enumerations
8494
8495         * delegate.cs: Compute the basename for the delegate creation,
8496         that should fix the delegate test case, and restore the correct
8497         Type Lookup semantics in rootcontext
8498
8499         * rootcontext.cs: Revert Ravi's last patch.  The correct way of
8500         referencing a nested type with the Reflection API is using the "+"
8501         sign. 
8502
8503         * cs-parser.jay: Do not require EOF token at the end.
8504
8505 2001-12-20  Ravi Pratap  <ravi@ximian.com>
8506
8507         * rootcontext.cs (LookupType): Concatenate type names with
8508         a '.' instead of a '+' The test suite passes again.
8509
8510         * enum.cs (Enum.DefineEnum): Set RTSpecialName on the 'value__'
8511         field of the enumeration.
8512
8513         * expression.cs (MemberAccess.ResolveMemberAccess): Add support for
8514         the case when the member is an EventExpr.
8515
8516         * ecore.cs (EventExpr.InstanceExpression): Every event which is not
8517         static has an associated instance expression.
8518
8519         * typemanager.cs (RegisterEvent): The usual workaround, now for events.
8520
8521         (GetAddMethod, GetRemoveMethod): Workarounds, as usual.
8522
8523         * class.cs (Event.Define): Register event and perform appropriate checks
8524         for error #111.
8525
8526         We define the Add and Remove methods even if the use provides none because
8527         in that case, we provide default implementations ourselves.
8528
8529         Define a private field of the type of the event. This is done by the CSC compiler
8530         and we should be doing it too ;-)
8531
8532         * typemanager.cs (delegate_combine_delegate_delegate, delegate_remove_delegate_delegate):
8533         More methods we use in code we generate.
8534
8535         (multicast_delegate_type, delegate_type): Two separate types since the distinction
8536         is important.
8537
8538         (InitCoreTypes): Update accordingly for the above.
8539
8540         * class.cs (Event.Emit): Generate code for default accessors that we provide
8541
8542         (EmitDefaultMethod): Do the job in the above.
8543
8544         * delegate.cs (DefineDelegate): Use TypeManager.multicast_delegate_type in the 
8545         appropriate place.
8546
8547 2001-12-20  Miguel de Icaza  <miguel@ximian.com>
8548
8549         * class.cs (Indexer.Define): Fix bug, we were setting both Get/Set
8550         builders even if we were missing one.
8551
8552         * interface.cs, class.cs, enum.cs: When calling DefineNestedType
8553         pass the Basename as our class name instead of the Name.  The
8554         basename will be correctly composed for us.
8555
8556         * parameter.cs (Paramters): Now takes a Location argument.
8557
8558         * decl.cs (DeclSpace.LookupType): Removed convenience function and
8559         make all the code call directly LookupType in RootContext and take
8560         this chance to pass the Location information everywhere.
8561
8562         * Everywhere: pass Location information.
8563
8564 2001-12-19  Miguel de Icaza  <miguel@ximian.com>
8565
8566         * class.cs (Constructor.Define): Updated way of detecting the
8567         length of the parameters.
8568
8569         (TypeContainer.DefineType): Use basename as the type name for
8570         nested types.
8571
8572         (TypeContainer.Define): Do not recursively define types here, as
8573         definition is taken care in order by the RootContext.
8574
8575         * tree.cs: Keep track of namespaces in a per-file basis.
8576
8577         * parameter.cs (Parameter.ComputeSignature): Update to use
8578         DeclSpace. 
8579
8580         (Parameters.GetSignature): ditto.
8581
8582         * interface.cs (InterfaceMethod.GetSignature): Take a DeclSpace
8583         instead of a TypeContainer.
8584
8585         (Interface.SemanticAnalysis): Use `this' instead of our parent to
8586         resolve names.  Because we need to be resolve in our context, not
8587         our parents.
8588         
8589         * driver.cs: Implement response files.
8590
8591         * class.cs (TypeContainer.DefineType): If we are defined, do not
8592         redefine ourselves.
8593         
8594         (Event.Emit): Emit the code for add/remove handlers.
8595         (Event.Define): Save the MethodBuilders for add/remove.
8596
8597         * typemanager.cs: Use pair here too.
8598
8599         * cs-parser.jay: Replaced use of DictionaryEntry for Pair because
8600         DictionaryEntry requires the first argument to be non-null.  
8601         
8602         (enum_declaration): Compute full name for registering the
8603         enumeration.
8604         
8605         (delegate_declaration): Instead of using
8606         formal_parameter_list, use opt_formal_parameter_list as the list
8607         can be empty.
8608
8609         * cs-tokenizer.cs (PropertyParsing): renamed from `properties'
8610         (EventParsing): New property that controls whether `add' and
8611         `remove' are returned as tokens or identifiers (for events);
8612
8613 2001-12-19  Ravi Pratap  <ravi@ximian.com>
8614
8615         * class.cs (Event.Define): Revamp use of EventBuilder completely. We now
8616         use MyEventBuilder only and let it wrap the real builder for us.
8617
8618         (MyEventBuilder): Revamp constructor etc.
8619
8620         Implement all operations that we perform on EventBuilder in precisely the same
8621         way here too.
8622
8623         (FindMembers): Update to use the EventBuilder member.
8624
8625         (Event.Emit): Update accordingly.
8626
8627 2001-12-18  Ravi Pratap  <ravi@ximian.com>
8628
8629         * class.cs (MyEventBuilder.Set*): Chain to the underlying builder
8630         by calling the appropriate methods.
8631
8632         (GetCustomAttributes): Make stubs as they cannot possibly do anything
8633         useful.
8634
8635         (Event.Emit): Use MyEventBuilder everywhere - even to set attributes.
8636
8637 2001-12-17  Ravi Pratap  <ravi@ximian.com>
8638
8639         * delegate.cs (Delegate.Populate): Check that the return type
8640         and various parameters types are indeed accessible.
8641
8642         * class.cs (Constructor.Define): Same here.
8643
8644         (Field.Define): Ditto.
8645
8646         (Event.Define): Ditto.
8647
8648         (Operator.Define): Check that the underlying Method defined itself
8649         correctly - so it's MethodBuilder should not be null.
8650
8651         * delegate.cs (DelegateInvocation.DoResolve): Bale out if the type of the Instance
8652         expression happens to be null.
8653
8654         * class.cs (MyEventBuilder): Workaround for SRE lameness. Implement various abstract
8655         members but as of now we don't seem to be able to do anything really useful with it.
8656
8657         (FindMembers): Handle events separately by returning the MyEventBuilder of the event,
8658         not the EventBuilder.
8659
8660 2001-12-18  Miguel de Icaza  <miguel@ximian.com>
8661
8662         * cs-tokenizer.cs: Add support for defines.
8663         Add support for #if, #elif, #else, #endif
8664         
8665         (eval_var): evaluates a variable.
8666         (eval): stubbed for evaluating functions.
8667
8668         * cs-parser.jay: Pass the defines information
8669
8670         * driver.cs: Add --define command line option.
8671
8672         * decl.cs: Move MemberCore here.
8673
8674         Make it the base class for DeclSpace.  This allows us to catch and
8675         report 108 and 109 for everything now.
8676
8677         * class.cs (TypeContainer.Define): Extract all the members
8678         before populating and emit the warning 108 (new keyword required
8679         to override) instead of having each member implement this.
8680
8681         (MemberCore.Define): New abstract method, we will be using this in
8682         the warning reporting engine in Populate.
8683         
8684         (Operator.Define): Adjust to new MemberCore protocol. 
8685
8686         * const.cs (Const): This does not derive from Expression, it is a
8687         temporary object we use to create fields, it is a MemberCore. 
8688
8689         * class.cs (Method.Define): Allow the entry point to be in a
8690         specific class.
8691
8692         * driver.cs: Rewrite the argument handler to clean it up a bit.
8693
8694         * rootcontext.cs: Made it just an auxiliary namespace feature by
8695         making everything static.
8696
8697         * driver.cs: Adapt code to use RootContext type name instead of
8698         instance variable.
8699
8700         * delegate.cs: Remove RootContext argument.
8701
8702         * class.cs: (Struct, TypeContainer, Class): Remove RootContext
8703         argument. 
8704
8705         * class.cs (Event.Define): The lookup can fail.
8706         
8707         * cs-tokenizer.cs: Begin implementation of pre-procesor. 
8708
8709         * expression.cs: Resolve the this instance before invoking the code.
8710
8711 2001-12-17  Miguel de Icaza  <miguel@ximian.com>
8712
8713         * cs-parser.jay: Add a production in element_access that allows
8714         the thing to become a "type" reference.  This way we can parse
8715         things like "(string [])" as a type.
8716
8717         Note that this still does not handle the more complex rules of
8718         casts. 
8719         
8720
8721         * delegate.cs (Delegate.Populate): Register the delegage constructor builder here. 
8722
8723         * ecore.cs: (CopyNewMethods): new utility function used to
8724         assemble the list of methods from running FindMembers.
8725
8726         (MemberLookup): Rework FindMembers so that 
8727
8728 2001-12-16  Miguel de Icaza  <miguel@ximian.com>
8729
8730         * class.cs (TypeContainer): Remove Delegates who fail to be
8731         defined.
8732
8733         * delegate.cs (Populate): Verify that we dont get null return
8734         values.   TODO: Check for AsAccessible.
8735
8736         * cs-parser.jay: Use basename to emit error 574 (destructor should
8737         have the same name as container class), not the full name.
8738
8739         * cs-tokenizer.cs (adjust_int): Fit the integer in the best
8740         possible representation.  
8741
8742         Also implements integer type suffixes U and L.
8743
8744 2001-12-15  Miguel de Icaza  <miguel@ximian.com>
8745
8746         * expression.cs (ArrayCreation.DoResolve): We need to do the
8747         argument resolution *always*.
8748
8749         * decl.cs: Make this hold the namespace.  Hold the root context as
8750         well.
8751         (LookupType): Move here.
8752
8753         * enum.cs, class.cs, interface.cs: Adapt to new hierarchy.
8754
8755         * location.cs (Row, Name): Fixed the code, it was always returning
8756         references to the first file.
8757
8758         * interface.cs: Register properties defined through interfaces.
8759
8760         * driver.cs: Add support for globbing on the command line
8761
8762         * class.cs (Field): Make it derive from MemberCore as well.
8763         (Event): ditto.
8764
8765 2001-12-15  Ravi Pratap  <ravi@ximian.com>
8766
8767         * class.cs (Event::Define): Check that the type of the event is a delegate
8768         type else flag error #66.
8769
8770         Also, re-use TypeContainer.MethodModifiersValid here too as the rules are the
8771         same.
8772
8773         * attribute.cs (DefinePInvokeMethod): Handle named arguments and process
8774         values of EntryPoint, CharSet etc etc.
8775
8776         Pass in the values to TypeBuilder.DefinePInvokeMethod; determine Type etc neatly.
8777
8778         * class.cs (FindMembers): If a method is in transit, its MethodBuilder will
8779         be null and we should ignore this. I am not sure if this is really clean. Apparently,
8780         there's no way of avoiding hitting this because the call is coming from SimpleName.DoResolve,
8781         which needs this to do its work.
8782
8783         * ../errors/cs0066.cs : Add.
8784
8785 2001-12-14  Miguel de Icaza  <miguel@ximian.com>
8786
8787         * typemanager.cs: (GetPropertyGetter, GetPropertyGetter): New
8788         helper functions.
8789
8790         * class.cs: (MethodSignature.MethodSignature): Removed hack that
8791         clears out the parameters field.
8792         (MemberSignatureCompare): Cleanup
8793
8794         (MemberCore): New base class used to share code between MethodCore
8795         and Property.
8796
8797         (RegisterRequiredImplementations) BindingFlags.Public requires
8798         either BindingFlags.Instace or Static.  Use instance here.
8799
8800         (Property): Refactored code to cope better with the full spec.
8801
8802         * parameter.cs (GetParameterInfo): Return an empty array instead
8803         of null on error.
8804
8805         * class.cs (Property): Abstract or extern properties have no bodies.
8806
8807         * parameter.cs (GetParameterInfo): return a zero-sized array.
8808
8809         * class.cs (TypeContainer.MethodModifiersValid): Move all the
8810         method modifier validation to the typecontainer so we can reuse
8811         this on properties.
8812
8813         (MethodCore.ParameterTypes): return an empty sized array of types.
8814
8815         (Property.Define): Test property modifier validity.
8816
8817         Add tests for sealed/override too.
8818
8819         (Method.Emit): abstract or extern methods have no bodies.
8820
8821 2001-12-14  Ravi Pratap  <ravi@ximian.com>
8822
8823         * class.cs (Method.IsPInvoke): Get rid of it as it is an expensive
8824         thing.
8825
8826         (Method::Define, ::Emit): Modify accordingly.
8827
8828         * expression.cs (Invocation::OverloadResolve): Handle error # 121.
8829
8830         (ArrayCreation::MakeByteBlob): Handle floats and doubles.
8831
8832         * makefile: Pass in /unsafe.
8833
8834 2001-12-13  Miguel de Icaza  <miguel@ximian.com>
8835
8836         * class.cs (MakeKey): Kill routine.
8837         
8838         * class.cs (TypeContainer.Define): Correctly define explicit
8839         method implementations (they require the full interface name plus
8840         the method name).
8841
8842         * typemanager.cs: Deply the PtrHashtable here and stop using the
8843         lame keys.  Things work so much better.
8844
8845         This of course broke everyone who depended on `RegisterMethod' to
8846         do the `test for existance' test.  This has to be done elsewhere.
8847
8848         * support.cs (PtrHashtable): A hashtable that avoid comparing with
8849         the object stupid Equals method (because, that like fails all over
8850         the place).  We still do not use it.
8851
8852         * class.cs (TypeContainer.SetRequiredInterface,
8853         TypeContainer.RequireMethods): Killed these two routines and moved
8854         all the functionality to RegisterRequiredImplementations.
8855
8856         (TypeContainer.RegisterRequiredImplementations): This routine now
8857         registers all the implementations required in an array for the
8858         interfaces and abstract methods.  We use an array of structures
8859         which can be computed ahead of time to reduce memory usage and we
8860         also assume that lookups are cheap as most classes will not
8861         implement too many interfaces.
8862
8863         We also avoid creating too many MethodSignatures.
8864
8865         (TypeContainer.IsInterfaceMethod): Update and optionally does not
8866         clear the "pending" bit if we find that there are problems with
8867         the declaration.
8868
8869         (TypeContainer.VerifyPendingMethods): Update to report errors of
8870         methods that look like implementations but are not.
8871
8872         (TypeContainer.Define): Add support for explicit interface method
8873         implementation. 
8874         
8875 2001-12-12  Miguel de Icaza  <miguel@ximian.com>
8876
8877         * typemanager.cs: Keep track of the parameters here instead of
8878         being a feature of the TypeContainer.
8879
8880         * class.cs: Drop the registration of parameters here, as
8881         InterfaceMethods are also interface declarations.
8882
8883         * delegate.cs: Register methods with the TypeManager not only with
8884         the TypeContainer.  This code was buggy.
8885
8886         * interface.cs: Full registation here.
8887
8888 2001-12-11  Miguel de Icaza  <miguel@ximian.com>
8889
8890         * expression.cs: Remove reducer for binary expressions, it can not
8891         be done this way.
8892
8893         * const.cs: Put here the code that used to go into constant.cs
8894
8895         * constant.cs: Put here the code for constants, this is a new base
8896         class for Literals.
8897
8898         * literal.cs: Make Literal derive from Constant.
8899
8900 2001-12-09  Miguel de Icaza  <miguel@ximian.com>
8901
8902         * statement.cs (Return.Emit): Report error 157 if the user
8903         attempts to return from a finally block.
8904
8905         (Return.Emit): Instead of emitting a return, jump to the end of
8906         the function.
8907
8908         * codegen.cs (EmitContext): ReturnValue, ReturnLabel: new
8909         LocalBuilder to store the result of the function.  ReturnLabel is
8910         the target where we jump.
8911         
8912
8913 2001-12-09  Radek Doulik  <rodo@ximian.com>
8914
8915         * cs-parser.jay: remember alias in current namespace
8916
8917         * ecore.cs (SimpleName::DoResolve): use aliases for types or
8918         namespaces
8919
8920         * class.cs (LookupAlias): lookup alias in my_namespace
8921
8922         * namespace.cs (UsingAlias): add alias, namespace_or_type pair to
8923         aliases hashtable
8924         (LookupAlias): lookup alias in this and if needed in parent
8925         namespaces
8926
8927 2001-12-08  Miguel de Icaza  <miguel@ximian.com>
8928
8929         * support.cs: 
8930
8931         * rootcontext.cs: (ModuleBuilder) Made static, first step into
8932         making things static.  I need this to avoid passing the
8933         TypeContainer when calling ParameterType.
8934
8935         * support.cs (InternalParameters.ParameterType): Remove ugly hack
8936         that did string manipulation to compute the type and then call
8937         GetType.  Use Parameter.ParameterType instead.
8938
8939         * cs-tokenizer.cs: Consume the suffix for floating values.
8940
8941         * expression.cs (ParameterReference): figure out whether this is a
8942         reference parameter or not.  Kill an extra variable by computing
8943         the arg_idx during emission.
8944
8945         * parameter.cs (Parameters.GetParameterInfo): New overloaded
8946         function that returns whether a parameter is an out/ref value or not.
8947
8948         (Parameter.ParameterType): The type of the parameter (base,
8949         without ref/out applied).
8950         
8951         (Parameter.Resolve): Perform resolution here.
8952         (Parameter.ExternalType): The full type (with ref/out applied).
8953
8954         * statement.cs (Using.Emit, Using.EmitExpression): Implement
8955         support for expressions on the using statement.
8956
8957 2001-12-07  Miguel de Icaza  <miguel@ximian.com>
8958
8959         * statement.cs (Using.EmitLocalVariableDecls): Split the
8960         localvariable handling of the using statement.
8961
8962         (Block.EmitMeta): Keep track of variable count across blocks.  We
8963         were reusing slots on separate branches of blocks.
8964
8965         (Try.Emit): Emit the general code block, we were not emitting it. 
8966
8967         Check the type of the declaration to be an IDisposable or
8968         something that can be implicity converted to it. 
8969
8970         Emit conversions if required.
8971
8972         * ecore.cs (EmptyExpression): New utility class.
8973         (Expression.ImplicitConversionExists): New utility function.
8974
8975 2001-12-06  Miguel de Icaza  <miguel@ximian.com>
8976
8977         * statement.cs (Using): Implement.
8978
8979         * expression.cs (LocalVariableReference): Support read only variables.
8980
8981         * statement.cs: Remove the explicit emit for the Leave opcode.
8982         (VariableInfo): Add a readonly field.
8983
8984 2001-12-05  Miguel de Icaza  <miguel@ximian.com>
8985
8986         * ecore.cs (ConvCast): new class used to encapsulate the various
8987         explicit integer conversions that works in both checked and
8988         unchecked contexts.
8989
8990         (Expression.ConvertNumericExplicit): Use new ConvCast class to
8991         properly generate the overflow opcodes.
8992
8993 2001-12-04  Miguel de Icaza  <miguel@ximian.com>
8994
8995         * statement.cs: The correct type for the EmptyExpression is the
8996         element_type, not the variable type.  Ravi pointed this out.
8997
8998 2001-12-04  Ravi Pratap  <ravi@ximian.com>
8999
9000         * class.cs (Method::Define): Handle PInvoke methods specially
9001         by using DefinePInvokeMethod instead of the usual one.
9002
9003         * attribute.cs (DefinePInvokeMethod): Implement as this is what is called
9004         above to do the task of extracting information and defining the method.
9005         
9006 2001-12-04  Ravi Pratap  <ravi@ximian.com>
9007
9008         * expression.cs (ArrayCreation::EmitStaticInitializers): Get rid
9009         of the condition for string type.
9010
9011         (Emit): Move that here. 
9012
9013         (ArrayCreation::CheckIndices): Keep string literals in their expression
9014         form.
9015
9016         (EmitDynamicInitializers): Handle strings appropriately.
9017
9018 2001-12-04  Miguel de Icaza  <miguel@ximian.com>
9019
9020         * codegen.cs (EmitContext): Replace multiple variables with a
9021         single pointer to the current Switch statement.
9022
9023         * statement.cs (GotoDefault, Switch): Adjust to cleaned up
9024         EmitContext.
9025
9026 2001-12-03  Miguel de Icaza  <miguel@ximian.com>
9027
9028         * statement.cs 
9029
9030         * statement.cs (GotoDefault), cs-parser.jay: Implement `goto
9031         default'.
9032         
9033         (Foreach.Emit): Foreach on arrays was not setting
9034         up the loop variables (for break/continue).
9035
9036         (GotoCase): Semi-implented.
9037         
9038 2001-12-03  Ravi Pratap  <ravi@ximian.com>
9039
9040         * attribute.cs (CheckAttribute): Handle system attributes by using
9041         Attribute.GetAttributes to examine information we need.
9042
9043         (GetValidPlaces): Same here.
9044
9045         * class.cs (Method::Define): Catch invalid use of extern and abstract together.
9046
9047         * typemanager.cs (dllimport_type): Core type for System.DllImportAttribute.
9048
9049         * class.cs (Method.IsPinvoke): Used to determine if we are a PInvoke method.
9050
9051         (Method::Define): Set appropriate flags if we have a DllImport attribute.
9052
9053         (Method::Emit): Handle the case when we are a PInvoke method.
9054
9055 2001-12-03  Miguel de Icaza  <miguel@ximian.com>
9056
9057         * expression.cs: Use ResolveWithSimpleName on compound names.
9058
9059 2001-12-02  Ravi Pratap  <ravi@ximian.com>
9060
9061         * constant.cs (EmitConstant): Make sure we resolve the associated expression
9062         before trying to reduce it.
9063
9064         * typemanager.cs (RegisterConstant, LookupConstant): Implement.
9065
9066         * constant.cs (LookupConstantValue): Implement.
9067
9068         (EmitConstant): Use the above in emitting the constant.
9069
9070         * expression.cs (MemberAccess::ResolveMemberAccess): Handle constants
9071         that are user-defined by doing a LookupConstantValue on them.
9072
9073         (SimpleName::DoResolve): When we have a FieldExpr, cope with constants
9074         too, like above.
9075
9076 2001-11-29  Miguel de Icaza  <miguel@ximian.com>
9077
9078         * expression.cs (BaseAccess, BaseIndexer): Also split this out.
9079
9080         (BaseAccess.DoResolve): Implement.
9081
9082         (MemberAccess.DoResolve): Split this routine into a
9083         ResolveMemberAccess routine that can be used independently
9084
9085 2001-11-28  Miguel de Icaza  <miguel@ximian.com>
9086
9087         * expression.cs (Probe, Is, As): Split Probe in two classes Is and
9088         As that share bits of the implementation.  Is returns a boolean,
9089         while As returns the Type that is being probed.
9090
9091 2001-12-01  Ravi Pratap  <ravi@ximian.com>
9092
9093         * enum.cs (LookupEnumValue): Re-write various bits, return an object value
9094         instead of a Literal - much easier.
9095
9096         (EnumInTransit): Remove - utterly useless :-)
9097
9098         (Populate): Re-write bits - remove duplicate code etc. The code is much neater now.
9099
9100         * expression.cs (MemberLookup): Cope with user-defined enums when they are in transit.
9101
9102         * enum.cs (LookupEnumValue): Auto-compute next values by going down the dependency
9103         chain when we have no associated expression.
9104
9105 2001-11-30  Ravi Pratap  <ravi@ximian.com>
9106
9107         * constant.cs (Define): Use Location while reporting the errror.
9108
9109         Also emit a warning when 'new' is used and there is no inherited
9110         member to hide.
9111
9112         * enum.cs (EnumInTransit): Used to tell if an enum type is in the process of being 
9113         populated.
9114
9115         (LookupEnumValue): Implement to lookup an enum member's value and define it
9116         if necessary.
9117
9118         (Populate): Re-write accordingly to use the above routine.
9119
9120 2001-11-27  Miguel de Icaza  <miguel@ximian.com>
9121
9122         * expression.cs (This): Fix prototype for DoResolveLValue to
9123         override the base class DoResolveLValue.
9124
9125         * cs-parser.cs: Report errors cs574 and cs575 (destructor
9126         declarations) 
9127
9128         * ecore.cs (FieldExpr.EmitAssign): Handle value types specially
9129         (we need to load the address of the field here).  This fixes
9130         test-22. 
9131         
9132         (FieldExpr.DoResolveLValue): Call the DoResolve
9133         function to initialize the Instance expression.
9134         
9135         * statement.cs (Foreach.Emit): Fix the bug where we did not invoke
9136         correctly the GetEnumerator operation on a value type.
9137
9138         * cs-parser.jay: Add more simple parsing error catches.
9139
9140         * statement.cs (Switch): Add support for string switches.
9141         Handle null specially.
9142
9143         * literal.cs (NullLiteral): Make NullLiteral objects singletons. 
9144
9145 2001-11-28  Ravi Pratap  <ravi@ximian.com>
9146
9147         * cs-parser.jay (local_constant_declaration): Use declare_local_constant.
9148
9149         (declare_local_constant): New helper function.
9150
9151         * statement.cs (AddConstant): Keep a separate record of constants
9152
9153         (IsConstant): Implement to determine if a variable is a constant.
9154
9155         (GetConstantExpression): Implement.
9156
9157         * expression.cs (LocalVariableReference): Handle the case when it is a constant.
9158
9159         * statement.cs (IsVariableDefined): Re-write.
9160
9161 2001-11-27  Ravi Pratap  <ravi@ximian.com>
9162
9163         * class.cs (TypeContainer::FindMembers): Look for constants
9164         in the case when we are looking for MemberTypes.Field
9165
9166         * expression.cs (MemberAccess::DoResolve): Check that in the
9167         case we are a FieldExpr and a Literal, we are not being accessed
9168         by an instance reference.
9169
9170         * cs-parser.jay (local_constant_declaration): Implement.
9171
9172         (declaration_statement): Implement for constant declarations.
9173
9174 2001-11-26  Miguel de Icaza  <miguel@ximian.com>
9175
9176         * statement.cs (Switch): Catch double defaults.
9177
9178         (Switch): More work on the switch() statement
9179         implementation.  It works for integral values now, need to finish
9180         string support.
9181
9182
9183 2001-11-24  Miguel de Icaza  <miguel@ximian.com>
9184
9185         * ecore.cs (Expression.ConvertIntLiteral): New function to convert
9186         integer literals into other integer literals.  To be used by
9187         switch. 
9188
9189 2001-11-24  Ravi Pratap  <ravi@ximian.com>
9190
9191         * expression.cs (ArrayCreation): Get rid of ArrayExprs : we save
9192         some memory.
9193
9194         (EmitDynamicInitializers): Cope with the above since we extract data
9195         directly from ArrayData now.
9196
9197         (ExpectInitializers): Keep track of whether initializers are mandatory
9198         or not.
9199
9200         (Bounds): Make it a hashtable to prevent the same dimension being 
9201         recorded for every element in that dimension.
9202
9203         (EmitDynamicInitializers): Fix bug which prevented the Set array method
9204         from being found.
9205
9206         Also fix bug which was causing the indices to be emitted in the reverse
9207         order.
9208
9209 2001-11-24  Miguel de Icaza  <miguel@ximian.com>
9210
9211         * expression.cs (ArrayCreation): Implement the bits that Ravi left
9212         unfinished.  They do not work, because the underlying code is
9213         sloppy.
9214
9215 2001-11-22  Miguel de Icaza  <miguel@ximian.com>
9216
9217         * cs-parser.jay: Remove bogus fixme.
9218
9219         * statement.cs (Switch, SwitchSection, SwithLabel): Started work
9220         on Switch statement.
9221         
9222 2001-11-23  Ravi Pratap  <ravi@ximian.com>
9223
9224         * typemanager.cs (IsDelegateType, IsEnumType): Fix logic to determine
9225         the same. 
9226         
9227         * expression.cs (ArrayCreation::CheckIndices): Get rid of the require_constant
9228         parameter. Apparently, any expression is allowed. 
9229
9230         (ValidateInitializers): Update accordingly.
9231
9232         (CheckIndices): Fix some tricky bugs thanks to recursion.
9233
9234         * delegate.cs (NewDelegate::DoResolve): Re-write large portions as 
9235         I was being completely brain-dead.
9236
9237         (VerifyMethod, VerifyApplicability, VerifyDelegate): Make static
9238         and re-write acordingly.
9239
9240         (DelegateInvocation): Re-write accordingly.
9241
9242         * expression.cs (ArrayCreation::Emit): Handle string initialization separately.
9243
9244         (MakeByteBlob): Handle types more correctly.
9245
9246         * expression.cs (ArrayCreation:Emit): Write preliminary code to do
9247         initialization from expressions but it is incomplete because I am a complete
9248         Dodo :-|
9249
9250 2001-11-22  Miguel de Icaza  <miguel@ximian.com>
9251
9252         * statement.cs (If.Emit): Fix a bug that generated incorrect code
9253         on If.  Basically, we have to return `true' (ie, we do return to
9254         our caller) only if both branches of the if return.
9255
9256         * expression.cs (Binary.Emit): LogicalOr and LogicalAnd are
9257         short-circuit operators, handle them as short circuit operators. 
9258
9259         (Cast.DoResolve): Resolve type.
9260         (Cast.Cast): Take an expression as the target type.
9261
9262         * cs-parser.jay (cast_expression): Remove old hack that only
9263         allowed a limited set of types to be handled.  Now we take a
9264         unary_expression and we resolve to a type during semantic
9265         analysis.
9266
9267         Use the grammar productions from Rhys to handle casts (this is
9268         not complete like Rhys syntax yet, we fail to handle that corner
9269         case that C# has regarding (-x), but we will get there.
9270         
9271 2001-11-22  Ravi Pratap  <ravi@ximian.com>
9272
9273         * class.cs (EmitFieldInitializer): Take care of the case when we have a
9274         field which is an array type.
9275
9276         * cs-parser.jay (declare_local_variables): Support array initialization too.
9277
9278         * typemanager.cs (MakeKey): Implement.
9279
9280         (everywhere): Use the above appropriately.
9281
9282         * cs-parser.jay (for_statement): Update for array initialization while
9283         declaring variables.
9284
9285         * ecore.cs : The error message was correct, it's the variable's names that
9286         were misleading ;-) Make the code more readable.
9287
9288         (MemberAccess::DoResolve): Fix the code which handles Enum literals to set
9289         the correct type etc.
9290
9291         (ConvertExplicit): Handle Enum types by examining the underlying type.
9292
9293 2001-11-21  Ravi Pratap  <ravi@ximian.com>
9294
9295         * parameter.cs (GetCallingConvention): Always return
9296         CallingConventions.Standard for now.
9297
9298 2001-11-22  Miguel de Icaza  <miguel@ximian.com>
9299
9300         * expression.cs (Binary.ResolveOperator): Update the values of `l'
9301         and `r' after calling DoNumericPromotions.
9302
9303         * ecore.cs: Fix error message (the types were in the wrong order).
9304
9305         * statement.cs (Foreach.ProbeCollectionType): Need to pass
9306         BindingFlags.Instance as well 
9307
9308         * ecore.cs (Expression.TryImplicitIntConversion): Wrap the result
9309         implicit int literal conversion in an empty cast so that we
9310         propagate the right type upstream.
9311
9312         (UnboxCast): new class used to unbox value types.
9313         (Expression.ConvertExplicit): Add explicit type conversions done
9314         by unboxing.
9315
9316         (Expression.ImplicitNumericConversion): Oops, forgot to test for
9317         the target type before applying the implicit LongLiterals to ULong
9318         literal cast.
9319
9320 2001-11-21  Miguel de Icaza  <miguel@ximian.com>
9321
9322         * cs-parser.jay (for_statement): Reworked the way For works: now
9323         we declare manually any variables that are introduced in
9324         for_initializer to solve the problem of having out-of-band code
9325         emition (that is what got for broken).
9326
9327         (declaration_statement): Perform the actual variable declaration
9328         that used to be done in local_variable_declaration here.
9329
9330         (local_variable_declaration): Do not declare anything, just pass
9331         the information on a DictionaryEntry
9332
9333 2001-11-20  Ravi Pratap  <ravi@ximian.com>
9334
9335         * expression.cs (ArrayCreation::CheckIndices): The story continues :-) Complete
9336         re-write of the logic to now make it recursive.
9337
9338         (UpdateIndices): Re-write accordingly.
9339
9340         Store element data in a separate ArrayData list in the above methods.
9341
9342         (MakeByteBlob): Implement to dump the array data into a byte array.
9343
9344 2001-11-19  Ravi Pratap  <ravi@ximian.com>
9345
9346         * expression.cs (ArrayCreation): Factor out some code from ValidateInitializers
9347         into CheckIndices.
9348
9349         * constant.cs (Define): Implement.
9350
9351         (EmitConstant): Re-write fully.
9352
9353         Pass in location info.
9354
9355         * class.cs (Populate, Emit): Call Constant::Define and Constant::EmitConstant
9356         respectively.
9357
9358         * cs-parser.jay (constant_declarator): Use VariableDeclaration instead of
9359         DictionaryEntry since we need location info too.
9360
9361         (constant_declaration): Update accordingly.
9362
9363         * expression.cs (ArrayCreation): Make ValidateInitializers simpler by factoring
9364         code into another method : UpdateIndices.
9365
9366 2001-11-18  Ravi Pratap  <ravi@ximian.com>
9367
9368         * expression.cs (ArrayCreation::ValidateInitializers): Update to perform
9369         some type checking etc.
9370
9371 2001-11-17  Ravi Pratap  <ravi@ximian.com>
9372
9373         * expression.cs (ArrayCreation::ValidateInitializers): Implement
9374         bits to provide dimension info if the user skips doing that.
9375
9376         Update second constructor to store the rank correctly.
9377
9378 2001-11-16  Ravi Pratap  <ravi@ximian.com>
9379
9380         * expression.cs (ArrayCreation::ValidateInitializers): Poke around
9381         and try to implement.
9382
9383         * ../errors/cs0150.cs : Add.
9384
9385         * ../errors/cs0178.cs : Add.
9386
9387 2001-11-16  Miguel de Icaza  <miguel@ximian.com>
9388
9389         * statement.cs: Implement foreach on multi-dimensional arrays. 
9390
9391         * parameter.cs (Parameters.GetParameterByName): Also lookup the
9392         name of the params argument.
9393
9394         * expression.cs: Use EmitStoreOpcode to get the right opcode while
9395         initializing the array.
9396
9397         (ArrayAccess.EmitStoreOpcode): move the opcode generation here, so
9398         we can use this elsewhere.
9399
9400         * statement.cs: Finish implementation of foreach for single
9401         dimension arrays.
9402
9403         * cs-parser.jay: Use an out-of-band stack to pass information
9404         around, I wonder why I need this.
9405
9406         foreach_block: Make the new foreach_block the current_block.
9407
9408         * parameter.cs (Parameters.GetEmptyReadOnlyParameters): New
9409         function used to return a static Parameters structure.  Used for
9410         empty parameters, as those are created very frequently.
9411
9412         * cs-parser.jay, class.cs: Use GetEmptyReadOnlyParameters
9413
9414 2001-11-15  Ravi Pratap  <ravi@ximian.com>
9415
9416         * interface.cs : Default modifier is private, not public. The
9417         make verify test passes again.
9418
9419 2001-11-15  Ravi Pratap  <ravi@ximian.com>
9420
9421         * support.cs (ReflectionParameters): Fix logic to determine
9422         whether the last parameter is a params one. Test 9 passes again.
9423
9424         * delegate.cs (Populate): Register the builders we define with
9425         RegisterParameterForBuilder. Test 19 passes again.
9426
9427         * cs-parser.jay (property_declaration): Reference $6 instead
9428         of $$ to get at the location.
9429
9430         (indexer_declaration): Similar stuff.
9431
9432         (attribute): Ditto.
9433
9434         * class.cs (Property): Register parameters for the Get and Set methods
9435         if they exist. Test 23 passes again.
9436
9437         * expression.cs (ArrayCreation::Emit): Pass null for the method in the
9438         call to EmitArguments as we are sure there aren't any params arguments. 
9439         Test 32 passes again.
9440
9441         * suppor.cs (ParameterDesc, ParameterModifier): Fix trivial bug causing
9442         IndexOutOfRangeException. 
9443
9444         * class.cs (Property::Define): Register property using TypeManager.RegisterProperty
9445         Test 33 now passes again.
9446         
9447 2001-11-15  Miguel de Icaza  <miguel@ximian.com>
9448
9449         * cs-parser.jay: Kill horrendous hack ($??? = lexer.Location) that
9450         broke a bunch of things.  Will have to come up with a better way
9451         of tracking locations.
9452
9453         * statement.cs: Implemented foreach for single dimension arrays.
9454
9455 2001-11-09  Miguel de Icaza  <miguel@ximian.com>
9456
9457         * enum.cs (Enum.Emit): Delay the lookup of loc until we run into
9458         an error.  This removes the lookup from the critical path.
9459
9460         * cs-parser.jay: Removed use of temporary_loc, which is completely
9461         broken. 
9462
9463 2001-11-14  Miguel de Icaza  <miguel@ximian.com>
9464
9465         * support.cs (ReflectionParameters.ParameterModifier): Report
9466         whether the argument is a PARAMS argument or not.
9467
9468         * class.cs: Set the attribute `ParamArrayAttribute' on the
9469         parameter argument.
9470
9471         * typemanager.cs: Define param_array_type (ParamArrayAttribute)
9472         and cons_param_array_attribute (ConstructorInfo for
9473         ParamArrayAttribute)., 
9474
9475         * codegen.cs: Emit the return using the `Return' statement, that
9476         way we can report the error correctly for missing return values. 
9477
9478         * class.cs (Method.Emit): Clean up.
9479
9480         * expression.cs (Argument.Resolve): Take another argument: the
9481         location where this argument is used.  Notice that this is not
9482         part of the "Argument" class as to reduce the size of the
9483         structure (we know the approximate location anyways).
9484
9485         Test if the argument is a variable-reference, if not, then
9486         complain with a 206.
9487
9488         (Argument.Emit): Emit addresses of variables.
9489
9490         (Argument.FullDesc): Simplify.
9491
9492         (Invocation.DoResolve): Update for Argument.Resolve.
9493
9494         (ElementAccess.DoResolve): ditto.
9495
9496         * delegate.cs (DelegateInvocation.Emit): Invocation of Invoke
9497         method should be virtual, as this method is always virtual.
9498
9499         (NewDelegate.DoResolve): Update for Argument.Resolve.
9500
9501         * class.cs (ConstructorInitializer.DoResolve): ditto.
9502         
9503         * attribute.cs (Attribute.Resolve): ditto.
9504
9505 2001-11-13  Miguel de Icaza  <miguel@ximian.com>
9506
9507         * statement.cs (Foreach.Emit): Use EmitAssign instead of Store.
9508
9509         * expression.cs (ParameterReference): Drop IStackStorage and implement
9510         IAssignMethod instead. 
9511
9512         (LocalVariableReference): ditto.
9513         
9514         * ecore.cs (FieldExpr): Drop IStackStorage and implement
9515         IAssignMethod instead. 
9516
9517 2001-11-13  Miguel de Icaza <miguel@ximian.com>
9518
9519         * parameter.cs, expression.cs, class.cs, ecore.cs: Made all
9520         enumerations that are used in heavily used structures derive from
9521         byte in a laughable and pathetic attempt to reduce memory usage.
9522         This is the kind of pre-optimzations that you should not do at
9523         home without adult supervision.
9524
9525         * expression.cs (UnaryMutator): New class, used to handle ++ and
9526         -- separatedly from the other unary operators.  Cleans up the
9527         code, and kills the ExpressionStatement dependency in Unary.
9528
9529         (Unary): Removed `method' and `Arguments' from this class, making
9530         it smaller, and moving it all to SimpleCall, so I can reuse this
9531         code in other locations and avoid creating a lot of transient data
9532         strucutres when not required.
9533
9534         * cs-parser.jay: Adjust for new changes.
9535
9536 2001-11-11  Miguel de Icaza  <miguel@ximian.com>
9537
9538         * enum.cs (Enum.Populate): If there is a failure during
9539         definition, return
9540
9541         * cs-parser.jay (opt_enum_base): we used to catch type errors
9542         here, but this is really incorrect.  The type error should be
9543         catched during semantic analysis.
9544
9545 2001-12-11  Ravi Pratap  <ravi@ximian.com>
9546
9547         * cs-parser.jay (operator_declarator, conversion_operator_declarator): Set
9548         current_local_parameters as expected since I, in my stupidity, had forgotten
9549         to do this :-)
9550
9551         * attribute.cs (GetValidPlaces): Fix stupid bug.
9552
9553         * class.cs (Method::Emit): Perform check on applicability of attributes.
9554
9555         (Constructor::Emit): Ditto.
9556
9557         (Field::Emit): Ditto.
9558
9559         (Field.Location): Store location information.
9560
9561         (Property, Event, Indexer, Operator): Ditto.
9562
9563         * cs-parser.jay (field_declaration): Pass in location for each field.
9564
9565         * ../errors/cs0592.cs : Add.
9566
9567 2001-11-12  Ravi Pratap  <ravi@ximian.com>
9568
9569         * typemanager.cs (attribute_usage_type): New static member for System.AttributeUsage.
9570
9571         (InitCoreTypes): Update accordingly.
9572
9573         (RegisterAttrType, LookupAttr): Implement.
9574
9575         * attribute.cs (Attribute.Targets, AllowMultiple, Inherited): New fields to hold
9576         info about the same.
9577
9578         (Resolve): Update to populate the above as necessary.
9579
9580         (Error592): Helper.
9581
9582         (GetValidPlaces): Helper to the above.
9583
9584         (CheckAttribute): Implement to perform validity of attributes on declarative elements.
9585
9586         * class.cs (TypeContainer::Emit): Update attribute emission code to perform checking etc.
9587
9588 2001-11-12  Ravi Pratap  <ravi@ximian.com>
9589
9590         * attribute.cs (Attribute::Resolve): Expand to handle named arguments too.
9591
9592         * ../errors/cs0617.cs : Add.
9593
9594 2001-11-11  Ravi Pratap  <ravi@ximian.com>
9595
9596         * enum.cs (Emit): Rename to Populate to be more consistent with what
9597         we expect it to do and when exactly it is called.
9598
9599         * class.cs, rootcontext.cs : Update accordingly.
9600
9601         * typemanager.cs (RegisterField, GetValue): Workarounds for the fact that
9602         FieldInfo.GetValue does not work on dynamic types ! S.R.E lameness strikes again !
9603
9604         * enum.cs (Populate): Register fields with TypeManager.RegisterField.
9605
9606         * expression.cs (MemberAccess.DoResolve): Adjust code to obtain the value
9607         of a fieldinfo using the above, when dealing with a FieldBuilder.
9608
9609 2001-11-10  Ravi Pratap  <ravi@ximian.com>
9610
9611         * ../errors/cs0031.cs : Add.
9612
9613         * ../errors/cs1008.cs : Add.
9614
9615         * ../errrors/cs0543.cs : Add.
9616
9617         * enum.cs (DefineEnum): Check the underlying type and report an error if not a valid
9618         enum type.
9619
9620         (FindMembers): Implement.
9621
9622         * typemanager.cs (FindMembers): Re-write to call the appropriate methods for
9623         enums and delegates too.
9624
9625         (enum_types): Rename to builder_to_enum.
9626
9627         (delegate_types): Rename to builder_to_delegate.
9628
9629         * delegate.cs (FindMembers): Implement.
9630
9631 2001-11-09  Ravi Pratap  <ravi@ximian.com>
9632
9633         * typemanager.cs (IsEnumType): Implement.
9634
9635         * enum.cs (Emit): Re-write parts to account for the underlying type
9636         better and perform checking etc.
9637
9638         (GetNextDefaultValue): Helper to ensure we don't overshoot max value
9639         of the underlying type.
9640
9641         * literal.cs (GetValue methods everywhere): Perform bounds checking and return
9642         value
9643
9644         * enum.cs (error31): Helper to report error #31.
9645
9646         * cs-parser.jay (enum_declaration): Store location of each member too.
9647
9648         * enum.cs (member_to_location): New hashtable. 
9649
9650         (AddEnumMember): Update location hashtable.
9651
9652         (Emit): Use the location of each member while reporting errors.
9653
9654 2001-11-09  Miguel de Icaza  <miguel@ximian.com>
9655
9656         * cs-parser.jay: A for_initializer if is a
9657         local_variable_declaration really ammount to have an implicit
9658         block with the variable declaration and no initializer for for.
9659
9660         * statement.cs (For.Emit): Cope with null initializers.
9661
9662         This fixes the infinite loop on for initializers.
9663
9664 2001-11-08  Miguel de Icaza  <miguel@ximian.com>
9665
9666         * enum.cs: More cleanup.
9667
9668         * ecore.cs: Remove dead code.
9669
9670         * class.cs (Property.Emit): More simplification.
9671         (Event.Emit): ditto.
9672
9673         Reworked to have less levels of indentation.
9674         
9675 2001-11-08  Ravi Pratap  <ravi@ximian.com>
9676
9677         * class.cs (Property): Emit attributes.
9678
9679         (Field): Ditto.
9680         
9681         (Event): Ditto.
9682
9683         (Indexer): Ditto.
9684
9685         (Operator): Ditto.
9686
9687         * enum.cs (Emit): Ditto.
9688
9689         * rootcontext.cs (ResolveTree, EmitCode, CloseTypes): Do the same for
9690         Enums too.
9691
9692         * class.cs (Field, Event, etc.): Move attribute generation into the
9693         Emit method everywhere.
9694
9695         * enum.cs (Enum): Revamp to use the same definition semantics as delegates so
9696         we have a DefineEnum, CloseEnum etc. The previous way of doing things was not right
9697         as we had no way of defining nested enums !
9698
9699         * rootcontext.cs : Adjust code accordingly.
9700
9701         * typemanager.cs (AddEnumType): To keep track of enum types separately.
9702
9703 2001-11-07  Ravi Pratap  <ravi@ximian.com>
9704
9705         * expression.cs (EvalConstantExpression): Move into ecore.cs
9706         
9707         * enum.cs (Enum): Rename some members and make them public and readonly
9708         according to our convention.
9709
9710         * modifiers.cs (EnumAttr): Implement as we need to set only visibility flags,
9711         nothing else.
9712
9713         * enum.cs (Enum::Define): Use the above instead of TypeAttr.
9714
9715         (Enum::Emit): Write a simple version for now which doesn't try to compute
9716         expressions. I shall modify this to be more robust in just a while.
9717
9718         * class.cs (TypeContainer::Emit): Make sure we include Enums too.
9719
9720         (TypeContainer::CloseType): Create the Enum types too.
9721
9722         * attribute.cs (Resolve): Use the new Reduce method instead of EvalConstantExpression.
9723
9724         * expression.cs (EvalConstantExpression): Get rid of completely.
9725
9726         * enum.cs (Enum::Emit): Use the new expression reducer. Implement assigning
9727         user-defined values and other cases.
9728
9729         (IsValidEnumLiteral): Helper function.
9730
9731         * expression.cs (ExprClassfromMemberInfo): Modify to not do any literalizing 
9732         out there in the case we had a literal FieldExpr.
9733
9734         (MemberAccess:DoResolve): Do the literalizing of the FieldExpr here.
9735
9736         (Literalize): Revamp a bit to take two arguments.
9737         
9738         (EnumLiteral): New class which derives from Literal to wrap enum literals.
9739         
9740 2001-11-06  Ravi Pratap  <ravi@ximian.com>
9741
9742         * cs-parser.jay (compilation_unit): Remove extra opt_attributes for now.
9743
9744         * expression.cs (ArrayCreation::ValidateInitializers): Implement.
9745
9746         (Resolve): Use the above to ensure we have proper initializers.
9747
9748 2001-11-05  Ravi Pratap  <ravi@ximian.com>
9749
9750         * expression.cs (Expression::EvalConstantExpression): New method to 
9751         evaluate constant expressions.
9752
9753         * attribute.cs (Attribute::Resolve): Modify bits to use the above function.
9754
9755 2001-11-07  Miguel de Icaza  <miguel@ximian.com>
9756
9757         * expression.cs (ArrayCreation.Emit): Some bits to initialize data
9758         in an array.
9759
9760         (Binary.ResolveOperator): Handle operator != (object a, object b)
9761         and operator == (object a, object b);
9762
9763         (Binary.DoNumericPromotions): Indicate whether the numeric
9764         promotion was possible.
9765
9766         (ArrayAccess.DoResolve, ArrayAccess.Emit, ArrayAccess.EmitAssign):
9767         Implement.  
9768
9769         Made the ArrayAccess implement interface IAssignMethod instead of
9770         IStackStore as the order in which arguments are passed reflects
9771         this.
9772
9773         * assign.cs: Instead of using expr.ExprClass to select the way of
9774         assinging, probe for the IStackStore/IAssignMethod interfaces.
9775
9776         * typemanager.cs: Load InitializeArray definition.
9777
9778         * rootcontext.cs (RootContext.MakeStaticData): Used to define
9779         static data that can be used to initialize arrays. 
9780
9781 2001-11-05  Miguel de Icaza  <miguel@ximian.com>
9782
9783         * expression.cs: Handle operator== and operator!= for booleans.
9784
9785         (Conditioal.Reduce): Implement reducer for the ?: operator.
9786
9787         (Conditional.Resolve): Implement dead code elimination.
9788
9789         (Binary.Resolve): Catch string literals and return a new
9790         concatenated string.
9791
9792         (Unary.Reduce): Implement reduction of unary expressions.
9793
9794         * ecore.cs: Split out the expression core handling here.
9795
9796         (Expression.Reduce): New method used to perform constant folding
9797         and CSE.  This is needed to support constant-expressions. 
9798         
9799         * statement.cs (Statement.EmitBoolExpression): Pass true and false
9800         targets, and optimize for !x.
9801
9802 2001-11-04  Ravi Pratap  <ravi@ximian.com>
9803
9804         * attribute.cs (Attribute::Resolve): Implement guts. Note that resolution
9805         of an attribute gives us a CustomAttributeBuilder which we use accordingly to
9806         set custom atttributes.
9807
9808         * literal.cs (Literal::GetValue): New abstract method to return the actual
9809         value of the literal, cast as an object.
9810
9811         (*Literal): Implement GetValue method.
9812
9813         * cs-parser.jay (positional_argument_list, named_argument_list): Add not just plain
9814         expressions to the arraylist but objects of type Argument.
9815
9816         * class.cs (TypeContainer::Emit): Emit our attributes too.
9817
9818         (Method::Emit, Constructor::Emit): Ditto.
9819
9820         * cs-parser.jay (constructor_declaration): Set attributes too, which we seemed
9821         to be ignoring earlier.
9822
9823 2001-11-03  Ravi Pratap  <ravi@ximian.com>
9824
9825         * attribute.cs (AttributeSection::Define): Implement to do the business
9826         of constructing a CustomAttributeBuilder.
9827
9828         (Attribute): New trivial class. Increases readability of code.  
9829
9830         * cs-parser.jay : Update accordingly.
9831
9832         (positional_argument_list, named_argument_list, named_argument): New rules
9833
9834         (attribute_arguments): Use the above so that we are more correct.
9835         
9836 2001-11-02  Ravi Pratap  <ravi@ximian.com>
9837         
9838         * expression.cs (Invocation::IsParamsMethodApplicable): Implement
9839         to perform all checks for a method with a params parameter.
9840
9841         (Invocation::OverloadResolve): Update to use the above method and therefore
9842         cope correctly with params method invocations.
9843
9844         * support.cs (InternalParameters::ParameterDesc): Provide a desc for 
9845         params too.
9846
9847         * class.cs (ConstructorInitializer::Resolve): Make sure we look for Non-public
9848         constructors in our parent too because we can't afford to miss out on 
9849         protected ones ;-)
9850
9851         * attribute.cs (AttributeSection): New name for the class Attribute
9852
9853         Other trivial changes to improve readability.
9854
9855         * cs-parser.jay (opt_attributes, attribute_section etc.): Modify to
9856         use the new class names.
9857         
9858 2001-11-01  Ravi Pratap  <ravi@ximian.com>
9859
9860         * class.cs (Method::Define): Complete definition for params types too
9861
9862         (Indexer::Define): Ditto.
9863
9864         * support.cs (InternalParameters::ParameterType, ParameterDesc, ParameterModifier):
9865         Cope everywhere with a request for info about the array parameter.
9866
9867 2001-11-01  Ravi Pratap  <ravi@ximian.com>
9868
9869         * tree.cs (RecordNamespace): Fix up to check for the correct key.
9870
9871         * cs-parser.jay (GetQualifiedIdentifier): New Helper method used in 
9872         local_variable_type to extract the string corresponding to the type.
9873
9874         (local_variable_type): Fixup the action to use the new helper method.
9875
9876         * codegen.cs : Get rid of RefOrOutParameter, it's not the right way to 
9877         go.
9878
9879         * expression.cs : Clean out code which uses the above.
9880
9881 2001-10-31  Ravi Pratap  <ravi@ximian.com>
9882         
9883         * typemanager.cs (RegisterMethod): Check if we already have an existing key
9884         and bale out if necessary by returning a false.
9885
9886         (RegisterProperty): Ditto.
9887
9888         * class.cs (everywhere): Check the return value from TypeManager.RegisterMethod
9889         and print out appropriate error messages.
9890
9891         * interface.cs (everywhere): Ditto.
9892
9893         * cs-parser.jay (property_declaration, event_declaration, indexer_declaration): Pass
9894         location to constructor.
9895
9896         * class.cs (Property, Event, Indexer): Update accordingly.
9897
9898         * ../errors/cs111.cs : Added.
9899
9900         * expression.cs (Invocation::IsApplicable): New static method to determine applicability
9901         of a method, as laid down by the spec.
9902
9903         (Invocation::OverloadResolve): Use the above method.
9904
9905 2001-10-31  Ravi Pratap  <ravi@ximian.com>
9906
9907         * support.cs (InternalParameters): Get rid of crap taking in duplicate info. We
9908         now take a TypeContainer and a Parameters object.
9909
9910         (ParameterData): Modify return type of ParameterModifier method to be 
9911         Parameter.Modifier and not a string.
9912
9913         (ReflectionParameters, InternalParameters): Update accordingly.
9914
9915         * expression.cs (Argument::GetParameterModifier): Same here.
9916
9917         * support.cs (InternalParameters::ParameterType): Find a better way of determining
9918         if we are a ref/out parameter. Actually, the type shouldn't be holding the '&'
9919         symbol in it at all so maybe this is only for now.
9920
9921 2001-10-30  Ravi Pratap  <ravi@ximian.com>
9922
9923         * support.cs (InternalParameters): Constructor now takes an extra argument 
9924         which is the actual Parameters class.
9925
9926         (ParameterDesc): Update to provide info on ref/out modifiers.
9927
9928         * class.cs (everywhere): Update call to InternalParameters to pass in
9929         the second argument too.
9930
9931         * support.cs (ParameterData): Add ParameterModifier, which is a method 
9932         to return the modifier info [ref/out etc]
9933
9934         (InternalParameters, ReflectionParameters): Implement the above.
9935
9936         * expression.cs (Argument::ParameterModifier): Similar function to return
9937         info about the argument's modifiers.
9938
9939         (Invocation::OverloadResolve): Update to take into account matching modifiers 
9940         too.
9941
9942         * class.cs (Indexer::Define): Actually define a Parameter object and put it onto
9943         a new SetFormalParameters object which we pass to InternalParameters.
9944
9945 2001-10-30  Ravi Pratap  <ravi@ximian.com>
9946
9947         * expression.cs (NewArray): Merge into the ArrayCreation class.
9948
9949 2001-10-29  Ravi Pratap  <ravi@ximian.com>
9950
9951         * expression.cs (NewArray): Merge classes NewBuiltinArray and 
9952         NewUserdefinedArray into one as there wasn't much of a use in having
9953         two separate ones.
9954
9955         * expression.cs (Argument): Change field's name to ArgType from Type.
9956
9957         (Type): New readonly property which returns the proper type, taking into 
9958         account ref/out modifiers.
9959
9960         (everywhere): Adjust code accordingly for the above.
9961
9962         * codegen.cs (EmitContext.RefOrOutParameter): New field to determine
9963         whether we are emitting for a ref or out parameter.
9964
9965         * expression.cs (Argument::Emit): Use the above field to set the state.
9966
9967         (LocalVariableReference::Emit): Update to honour the flag and emit the
9968         right stuff.
9969
9970         * parameter.cs (Attributes): Set the correct flags for ref parameters.
9971
9972         * expression.cs (Argument::FullDesc): New function to provide a full desc.
9973
9974         * support.cs (ParameterData): Add method ParameterDesc to the interface.
9975
9976         (ReflectionParameters, InternalParameters): Implement the above method.
9977
9978         * expression.cs (Invocation::OverloadResolve): Use the new desc methods in
9979         reporting errors.
9980
9981         (Invocation::FullMethodDesc): Ditto. 
9982
9983 2001-10-29  Miguel de Icaza  <miguel@ximian.com>
9984
9985         * cs-parser.jay: Add extra production for the second form of array
9986         creation. 
9987
9988         * expression.cs (ArrayCreation): Update to reflect the above
9989         change. 
9990
9991         * Small changes to prepare for Array initialization.
9992
9993 2001-10-28  Miguel de Icaza  <miguel@ximian.com>
9994
9995         * typemanager.cs (ImplementsInterface): interface might be null;
9996         Deal with this problem;
9997
9998         Also, we do store negative hits on the cache (null values), so use
9999         this instead of calling t.GetInterfaces on the type everytime.
10000
10001 2001-10-28  Ravi Pratap  <ravi@ximian.com>
10002
10003         * typemanager.cs (IsBuiltinType): New method to help determine the same.
10004
10005         * expression.cs (New::DoResolve): Get rid of array creation code and instead
10006         split functionality out into different classes.
10007
10008         (New::FormArrayType): Move into NewBuiltinArray.
10009
10010         (Invocation::EmitArguments): Get rid of the MethodBase argument. Appears
10011         quite useless.
10012
10013         (NewBuiltinArray): New class to handle creation of built-in arrays.
10014
10015         (NewBuiltinArray::DoResolve): Implement guts of array creation. Also take into
10016         account creation of one-dimensional arrays.
10017
10018         (::Emit): Implement to use Newarr and Newobj opcodes accordingly.
10019
10020         (NewUserdefinedArray::DoResolve): Implement.
10021
10022         * cs-parser.jay (local_variable_type): Fix up to add the rank to the variable too.
10023
10024         * typemanager.cs (AddModule): Used to add a ModuleBuilder to the list of modules
10025         we maintain inside the TypeManager. This is necessary to perform lookups on the
10026         module builder.
10027
10028         (LookupType): Update to perform GetType on the module builders too.     
10029
10030         * driver.cs (Driver): Add the ModuleBuilder to the list maintained by the TypeManager.
10031
10032         * exprssion.cs (NewUserdefinedArray::Emit): Implement.
10033
10034 2001-10-23  Ravi Pratap  <ravi@ximian.com>
10035
10036         * expression.cs (New::DoResolve): Implement guts of array creation.
10037
10038         (New::FormLookupType): Rename to FormArrayType and modify ever so slightly.
10039         
10040 2001-10-27  Miguel de Icaza  <miguel@ximian.com>
10041
10042         * expression.cs: Fix bug I introduced lsat night that broke
10043         Delegates. 
10044
10045         (Expression.Resolve): Report a 246 error (can not resolve name)
10046         if we find a SimpleName in the stream.
10047         
10048         (Expression.ResolveLValue): Ditto.
10049         
10050         (Expression.ResolveWithSimpleName): This function is a variant of
10051         ResolveName, this one allows SimpleNames to be returned without a
10052         warning.  The only consumer of SimpleNames is MemberAccess
10053
10054 2001-10-26  Miguel de Icaza  <miguel@ximian.com>
10055
10056         * expression.cs (Invocation::DoResolve): Catch SimpleNames that
10057         might arrive here.  I have my doubts that this is correct.
10058
10059         * statement.cs (Lock): Implement lock statement.
10060
10061         * cs-parser.jay: Small fixes to support `lock' and `using'
10062
10063         * cs-tokenizer.cs: Remove extra space
10064
10065         * driver.cs: New flag --checked, allows to turn on integer math
10066         checking. 
10067
10068         * typemanger.cs: Load methodinfos for Threading.Monitor.Enter and
10069         Threading.Monitor.Exit 
10070         
10071 2001-10-23  Miguel de Icaza  <miguel@ximian.com>
10072
10073         * expression.cs (IndexerAccess::DoResolveLValue): Set the
10074         Expression Class to be IndexerAccess.
10075
10076         Notice that Indexer::DoResolve sets the eclass to Value.
10077
10078 2001-10-22  Miguel de Icaza  <miguel@ximian.com>
10079
10080         * class.cs (TypeContainer::Emit): Emit code for indexers.
10081
10082         * assign.cs (IAssignMethod): New interface implemented by Indexers
10083         and Properties for handling assignment.
10084
10085         (Assign::Emit): Simplify and reuse code. 
10086         
10087         * expression.cs (IndexerAccess, PropertyExpr): Implement
10088         IAssignMethod, clean up old code. 
10089
10090 2001-10-22  Ravi Pratap  <ravi@ximian.com>
10091
10092         * typemanager.cs (ImplementsInterface): New method to determine if a type
10093         implements a given interface. Provides a nice cache too.
10094
10095         * expression.cs (ImplicitReferenceConversion): Update checks to use the above
10096         method.
10097
10098         (ConvertReferenceExplicit): Ditto.
10099
10100         * delegate.cs (Delegate::Populate): Update to define the parameters on the 
10101         various methods, with correct names etc.
10102
10103         * class.cs (Operator::OpType): New members Operator.UnaryPlus and 
10104         Operator.UnaryNegation.
10105
10106         * cs-parser.jay (operator_declarator): Be a little clever in the case where
10107         we have a unary plus or minus operator.
10108
10109         * expression.cs (Unary): Rename memebers of Operator enum to UnaryPlus and 
10110         UnaryMinus.
10111
10112         * everywhere : update accordingly.
10113
10114         * everywhere : Change Negate and BitComplement to LogicalNot and OnesComplement
10115         respectively.
10116
10117         * class.cs (Method::Define): For the case where we are implementing a method
10118         inherited from an interface, we need to set the MethodAttributes.Final flag too. 
10119         Also set MethodAttributes.NewSlot and MethodAttributes.HideBySig.
10120         
10121 2001-10-21  Ravi Pratap  <ravi@ximian.com>
10122
10123         * interface.cs (FindMembers): Implement to work around S.R.E
10124         lameness.
10125
10126         * typemanager.cs (IsInterfaceType): Implement.
10127
10128         (FindMembers): Update to handle interface types too.
10129
10130         * expression.cs (ImplicitReferenceConversion): Re-write bits which
10131         use IsAssignableFrom as that is not correct - it doesn't work.
10132
10133         * delegate.cs (DelegateInvocation): Derive from ExpressionStatement
10134         and accordingly override EmitStatement.
10135
10136         * expression.cs (ConvertReferenceExplicit): Re-write similary, this time
10137         using the correct logic :-)
10138
10139 2001-10-19  Ravi Pratap  <ravi@ximian.com>
10140
10141         * ../errors/cs-11.cs : Add to demonstrate error -11 
10142
10143 2001-10-17  Miguel de Icaza  <miguel@ximian.com>
10144
10145         * assign.cs (Assign::Resolve): Resolve right hand side first, and
10146         then pass this as a hint to ResolveLValue.
10147         
10148         * expression.cs (FieldExpr): Add Location information
10149
10150         (FieldExpr::LValueResolve): Report assignment to readonly
10151         variable. 
10152         
10153         (Expression::ExprClassFromMemberInfo): Pass location information.
10154
10155         (Expression::ResolveLValue): Add new method that resolves an
10156         LValue. 
10157
10158         (Expression::DoResolveLValue): Default invocation calls
10159         DoResolve. 
10160
10161         (Indexers): New class used to keep track of indexers in a given
10162         Type. 
10163
10164         (IStackStore): Renamed from LValue, as it did not really describe
10165         what this did.  Also ResolveLValue is gone from this interface and
10166         now is part of Expression.
10167
10168         (ElementAccess): Depending on the element access type
10169         
10170         * typemanager.cs: Add `indexer_name_type' as a Core type
10171         (System.Runtime.CompilerServices.IndexerNameAttribute)
10172
10173         * statement.cs (Goto): Take a location.
10174         
10175 2001-10-18  Ravi Pratap  <ravi@ximian.com>
10176
10177         * delegate.cs (Delegate::VerifyDelegate): New method to verify
10178         if two delegates are compatible.
10179
10180         (NewDelegate::DoResolve): Update to take care of the case when
10181         we instantiate a delegate from another delegate.
10182
10183         * typemanager.cs (FindMembers): Don't even try to look up members
10184         of Delegate types for now.
10185
10186 2001-10-18  Ravi Pratap  <ravi@ximian.com>
10187
10188         * delegate.cs (NewDelegate): New class to take care of delegate
10189         instantiation.
10190
10191         * expression.cs (New): Split the delegate related code out into 
10192         the NewDelegate class.
10193
10194         * delegate.cs (DelegateInvocation): New class to handle delegate 
10195         invocation.
10196
10197         * expression.cs (Invocation): Split out delegate related code into
10198         the DelegateInvocation class.
10199
10200 2001-10-17  Ravi Pratap  <ravi@ximian.com>
10201
10202         * expression.cs (New::DoResolve): Implement delegate creation fully
10203         and according to the spec.
10204
10205         (New::DoEmit): Update to handle delegates differently.
10206
10207         (Invocation::FullMethodDesc): Fix major stupid bug thanks to me
10208         because of which we were printing out arguments in reverse order !
10209
10210         * delegate.cs (VerifyMethod): Implement to check if the given method
10211         matches the delegate.
10212
10213         (FullDelegateDesc): Implement.
10214
10215         (VerifyApplicability): Implement.
10216
10217         * expression.cs (Invocation::DoResolve): Update to accordingly handle
10218         delegate invocations too.
10219
10220         (Invocation::Emit): Ditto.
10221
10222         * ../errors/cs1593.cs : Added.
10223
10224         * ../errors/cs1594.cs : Added.
10225
10226         * delegate.cs (InstanceExpression, TargetMethod): New properties.
10227
10228 2001-10-16  Ravi Pratap  <ravi@ximian.com>
10229
10230         * typemanager.cs (intptr_type): Core type for System.IntPtr
10231
10232         (InitCoreTypes): Update for the same.
10233
10234         (iasyncresult_type, asynccallback_type): Ditto.
10235
10236         * delegate.cs (Populate): Fix to use System.Intptr as it is indeed
10237         correct.
10238
10239         * typemanager.cs (AddDelegateType): Store a pointer to the Delegate class
10240         too.
10241
10242         * delegate.cs (ConstructorBuilder, InvokeBuilder, ...): New members to hold
10243         the builders for the 4 members of a delegate type :-)
10244
10245         (Populate): Define the BeginInvoke and EndInvoke methods on the delegate
10246         type.
10247
10248         * expression.cs (New::DoResolve): Implement guts for delegate creation.
10249
10250         * ../errors/errors.txt : Update for an error (-11) which only we catch :-)
10251
10252 2001-10-15  Miguel de Icaza  <miguel@ximian.com>
10253
10254         * statement.cs (Break::Emit): Implement.   
10255         (Continue::Emit): Implement.
10256
10257         (For::Emit): Track old being/end loops;  Set Begin loop, ack end loop
10258         (While::Emit): Track old being/end loops;  Set Begin loop, ack end loop
10259         (Do::Emit): Track old being/end loops;  Set Begin loop, ack end loop
10260         (Foreach::Emit): Track old being/end loops;  Set Begin loop, ack
10261         end loop
10262         
10263         * codegen.cs (EmitContext::LoopEnd, EmitContext::LoopBegin): New
10264         properties that track the label for the current loop (begin of the
10265         loop and end of the loop).
10266
10267 2001-10-15  Ravi Pratap  <ravi@ximian.com>
10268
10269         * delegate.cs (Emit): Get rid of it as there doesn't seem to be any ostensible
10270         use of emitting anything at all.
10271
10272         * class.cs, rootcontext.cs : Get rid of calls to the same.
10273
10274         * delegate.cs (DefineDelegate): Make sure the class we define is also sealed.
10275
10276         (Populate): Define the constructor correctly and set the implementation
10277         attributes.
10278
10279         * typemanager.cs (delegate_types): New hashtable to hold delegates that
10280         have been defined.
10281
10282         (AddDelegateType): Implement.
10283
10284         (IsDelegateType): Implement helper method.
10285
10286         * delegate.cs (DefineDelegate): Use AddDelegateType instead of AddUserType.
10287
10288         * expression.cs (New::DoResolve): Check if we are trying to instantiate a delegate type
10289         and accordingly handle it.
10290
10291         * delegate.cs (Populate): Take TypeContainer argument.
10292         Implement bits to define the Invoke method. However, I still haven't figured out
10293         how to take care of the native int bit :-(
10294
10295         * cs-parser.jay (delegate_declaration): Fixed the bug that I had introduced :-) 
10296         Qualify the name of the delegate, not its return type !
10297
10298         * expression.cs (ImplicitReferenceConversion): Implement guts of implicit array
10299         conversion.
10300
10301         (StandardConversionExists): Checking for array types turns out to be recursive.
10302
10303         (ConvertReferenceExplicit): Implement array conversion.
10304
10305         (ExplicitReferenceConversionExists): New method to determine precisely that :-)
10306         
10307 2001-10-12  Ravi Pratap  <ravi@ximian.com>
10308
10309         * cs-parser.jay (delegate_declaration): Store the fully qualified
10310         name as it is a type declaration.
10311
10312         * delegate.cs (ReturnType, Name): Rename members to these. Make them 
10313         readonly.
10314
10315         (DefineDelegate): Renamed from Define. Does the same thing essentially,
10316         as TypeContainer::DefineType.
10317
10318         (Populate): Method in which all the definition of the various methods (Invoke)
10319         etc is done.
10320
10321         (Emit): Emit any code, if necessary. I am not sure about this really, but let's
10322         see.
10323         
10324         (CloseDelegate): Finally creates the delegate.
10325
10326         * class.cs (TypeContainer::DefineType): Update to define delegates.
10327         (Populate, Emit and CloseType): Do the same thing here too.
10328
10329         * rootcontext.cs (ResolveTree, PopulateTypes, EmitCode, CloseTypes): Include
10330         delegates in all these operations.
10331
10332 2001-10-14  Miguel de Icaza  <miguel@ximian.com>
10333
10334         * expression.cs: LocalTemporary: a new expression used to
10335         reference a temporary that has been created.
10336
10337         * assign.cs: Handle PropertyAccess back here, so that we can
10338         provide the proper semantic access to properties.
10339
10340         * expression.cs (Expression::ConvertReferenceExplicit): Implement
10341         a few more explicit conversions. 
10342
10343         * modifiers.cs: `NEW' modifier maps to HideBySig.
10344
10345         * expression.cs (PropertyExpr): Make this into an
10346         ExpressionStatement, and support the EmitStatement code path. 
10347
10348         Perform get/set error checking, clean up the interface.
10349
10350         * assign.cs: recognize PropertyExprs as targets, and if so, turn
10351         them into toplevel access objects.
10352
10353 2001-10-12  Miguel de Icaza  <miguel@ximian.com>
10354
10355         * expression.cs: PropertyExpr::PropertyExpr: use work around the
10356         SRE.
10357
10358         * typemanager.cs: Keep track here of our PropertyBuilders again to
10359         work around lameness in SRE.
10360
10361 2001-10-11  Miguel de Icaza  <miguel@ximian.com>
10362
10363         * expression.cs (LValue::LValueResolve): New method in the
10364         interface, used to perform a second resolution pass for LValues. 
10365         
10366         (This::DoResolve): Catch the use of this in static methods.
10367
10368         (This::LValueResolve): Implement.
10369
10370         (This::Store): Remove warning, assigning to `this' in structures
10371         is 
10372
10373         (Invocation::Emit): Deal with invocation of
10374         methods on value types.  We need to pass the address to structure
10375         methods rather than the object itself.  (The equivalent code to
10376         emit "this" for structures leaves the entire structure on the
10377         stack instead of a pointer to it). 
10378
10379         (ParameterReference::DoResolve): Compute the real index for the
10380         argument based on whether the method takes or not a `this' pointer
10381         (ie, the method is static).
10382
10383         * codegen.cs (EmitContext::GetTemporaryStorage): Used to store
10384         value types returned from functions when we need to invoke a
10385         method on the sturcture.
10386         
10387
10388 2001-10-11  Ravi Pratap  <ravi@ximian.com>
10389
10390         * class.cs (TypeContainer::DefineType): Method to actually do the business of
10391         defining the type in the Modulebuilder or Typebuilder. This is to take
10392         care of nested types which need to be defined on the TypeBuilder using
10393         DefineNestedMethod.
10394
10395         (TypeContainer::GetClassBases): Implement. Essentially the code from the 
10396         methods in RootContext, only ported to be part of TypeContainer.
10397
10398         (TypeContainer::GetInterfaceOrClass): Ditto.
10399
10400         (TypeContainer::LookupInterfaceOrClass, ::MakeFQN): Ditto.
10401
10402         * interface.cs (Interface::DefineInterface): New method. Does exactly
10403         what RootContext.CreateInterface did earlier, only it takes care of nested types 
10404         too.
10405
10406         (Interface::GetInterfaces): Move from RootContext here and port.
10407
10408         (Interface::GetInterfaceByName): Same here.
10409
10410         * rootcontext.cs (ResolveTree): Re-write.
10411
10412         (PopulateTypes): Re-write.
10413
10414         * class.cs (TypeContainer::Populate): Populate nested types too.
10415         (TypeContainer::Emit): Emit nested members too.
10416
10417         * typemanager.cs (AddUserType): Do not make use of the FullName property,
10418         instead just use the name argument passed in as it is already fully
10419         qualified.
10420
10421         (FindMembers): Check in the Builders to TypeContainer mapping instead of the name
10422         to TypeContainer mapping to see if a type is user-defined.
10423
10424         * class.cs (TypeContainer::CloseType): Implement. 
10425
10426         (TypeContainer::DefineDefaultConstructor): Use Basename, not Name while creating
10427         the default constructor.
10428         
10429         (TypeContainer::Populate): Fix minor bug which led to creating default constructors
10430         twice.
10431
10432         (Constructor::IsDefault): Fix up logic to determine if it is the default constructor
10433
10434         * interface.cs (CloseType): Create the type here.
10435         
10436         * rootcontext.cs (CloseTypes): Re-write to recursively close types by running through
10437         the hierarchy.
10438
10439         Remove all the methods which are now in TypeContainer.
10440
10441 2001-10-10  Ravi Pratap  <ravi@ximian.com>
10442
10443         * delegate.cs (Define): Re-write bits to define the delegate
10444         correctly.
10445
10446 2001-10-10  Miguel de Icaza  <miguel@ximian.com>
10447
10448         * makefile: Renamed the compiler to `mcs.exe' instead of compiler.exe
10449
10450         * expression.cs (ImplicitReferenceConversion): handle null as well
10451         as a source to convert to any reference type.
10452
10453         * statement.cs (Return): Perform any implicit conversions to
10454         expected return type.  
10455
10456         Validate use of return statement.  
10457
10458         * codegen.cs (EmitContext): Pass the expected return type here.
10459
10460         * class.cs (Method, Constructor, Property): Pass expected return
10461         type to EmitContext.
10462
10463 2001-10-09  Miguel de Icaza  <miguel@ximian.com>
10464
10465         * expression.cs: Make DoResolve take an EmitContext instead of a
10466         TypeContainer.
10467
10468         Replaced `l' and `location' for `loc', for consistency.
10469         
10470         (Error, Warning): Remove unneeded Tc argument.
10471
10472         * assign.cs, literal.cs, constant.cs: Update to new calling
10473         convention. 
10474         
10475         * codegen.cs: EmitContext now contains a flag indicating whether
10476         code is being generated in a static method or not.
10477
10478         * cs-parser.jay: DecomposeQI, new function that replaces the old
10479         QualifiedIdentifier.  Now we always decompose the assembled
10480         strings from qualified_identifier productions into a group of
10481         memberaccesses.
10482
10483 2001-10-08  Miguel de Icaza  <miguel@ximian.com>
10484
10485         * rootcontext.cs: Deal with field-less struct types correctly now
10486         by passing the size option to Define Type.
10487
10488         * class.cs: Removed hack that created one static field. 
10489
10490 2001-10-07  Miguel de Icaza  <miguel@ximian.com>
10491
10492         * statement.cs: Moved most of the code generation here. 
10493
10494 2001-10-09  Ravi Pratap  <ravi@ximian.com>
10495
10496         * expression.cs (New::DoResolve): Revert changes for array creation, doesn't
10497         seem very right.
10498
10499         (ElementAccess): Remove useless bits for now - keep checks as the spec
10500         says.
10501
10502 2001-10-08  Ravi Pratap  <ravi@ximian.com>
10503
10504         * expression.cs (ElementAccess::DoResolve): Remove my crap code
10505         and start performing checks according to the spec.
10506
10507 2001-10-07  Ravi Pratap  <ravi@ximian.com>
10508
10509         * cs-parser.jay (type_suffix*): Remove - they are redundant. Use
10510         rank_specifiers instead.
10511
10512         (rank_specifiers): Change the order in which the rank specifiers are stored
10513
10514         (local_variable_declaration): Use opt_rank_specifier instead of type_suffixes.
10515
10516         * expression.cs (ElementAccess): Implement the LValue interface too.
10517         
10518 2001-10-06  Ravi Pratap  <ravi@ximian.com>
10519         
10520         * expression.cs (ConvertExplicitStandard): Add. Same as ConvertExplicit
10521         except that user defined conversions are not included.
10522
10523         (UserDefinedConversion): Update to use the ConvertExplicitStandard to 
10524         perform the conversion of the return type, if necessary.
10525
10526         (New::DoResolve): Check whether we are creating an array or an object
10527         and accordingly do the needful.
10528
10529         (New::Emit): Same here.
10530
10531         (New::DoResolve): Implement guts of array creation.
10532
10533         (New::FormLookupType): Helper function.
10534
10535 2001-10-07  Miguel de Icaza  <miguel@ximian.com>
10536
10537         * codegen.cs: Removed most of the code generation here, and move the
10538         corresponding code generation bits to the statement classes. 
10539
10540         Added support for try/catch/finalize and throw.
10541         
10542         * cs-parser.jay: Added support for try/catch/finalize.
10543
10544         * class.cs: Catch static methods having the flags override,
10545         virtual or abstract.
10546
10547         * expression.cs (UserCast): This user cast was not really doing
10548         what it was supposed to do.  Which is to be born in fully resolved
10549         state.  Parts of the resolution were being performed at Emit time! 
10550
10551         Fixed this code.
10552
10553 2001-10-05  Miguel de Icaza  <miguel@ximian.com>
10554
10555         * expression.cs: Implicity convert the result from UserCast.
10556
10557 2001-10-05  Ravi Pratap  <ravi@ximian.com>
10558
10559         * expression.cs (Expression::FindMostEncompassingType): Fix bug which
10560         prevented it from working correctly. 
10561
10562         (ConvertExplicit): Make the first try, a call to ConvertImplicitStandard, not
10563         merely ConvertImplicit.
10564
10565 2001-10-05  Miguel de Icaza  <miguel@ximian.com>
10566
10567         * typemanager.cs: Make the LookupTypeContainer function static,
10568         and not per-instance.  
10569
10570         * class.cs: Make static FindMembers (the one that takes a Type
10571         argument). 
10572
10573         * codegen.cs: Add EmitForeach here.
10574
10575         * cs-parser.jay: Make foreach a toplevel object instead of the
10576         inline expansion, as we need to perform semantic analysis on it. 
10577
10578 2001-10-05  Ravi Pratap  <ravi@ximian.com>
10579
10580         * expression.cs (Expression::ImplicitUserConversion): Rename to
10581         UserDefinedConversion.
10582
10583         (Expression::UserDefinedConversion): Take an extra argument specifying 
10584         whether we look for explicit user conversions too.
10585
10586         (Expression::ImplicitUserConversion): Make it a call to UserDefinedConversion.
10587
10588         (UserDefinedConversion): Incorporate support for user defined explicit conversions.
10589
10590         (ExplicitUserConversion): Make it a call to UserDefinedConversion
10591         with the appropriate arguments.
10592
10593         * cs-parser.jay (cast_expression): Record location too.
10594
10595         * expression.cs (Cast): Record location info.
10596
10597         (Expression::ConvertExplicit): Take location argument.
10598
10599         (UserImplicitCast): Change name to UserCast. Take an extra constructor argument
10600         to determine if we are doing explicit conversions.
10601
10602         (UserCast::Emit): Update accordingly.
10603
10604         (Expression::ConvertExplicit): Report an error if everything fails.
10605
10606         * ../errors/cs0030.cs : Add.
10607
10608 2001-10-04  Miguel de Icaza  <miguel@ximian.com>
10609
10610         * modifiers.cs: If the ABSTRACT keyword is present, also set the
10611         virtual and newslot bits. 
10612
10613         * class.cs (TypeContainer::RegisterRequiredImplementations):
10614         Record methods we need.
10615
10616         (TypeContainer::MakeKey): Helper function to make keys for
10617         MethodBases, since the Methodbase key is useless.
10618
10619         (TypeContainer::Populate): Call RegisterRequiredImplementations
10620         before defining the methods.   
10621
10622         Create a mapping for method_builders_to_methods ahead of time
10623         instead of inside a tight loop.
10624
10625         (::RequireMethods):  Accept an object as the data to set into the
10626         hashtable so we can report interface vs abstract method mismatch.
10627
10628 2001-10-03  Miguel de Icaza  <miguel@ximian.com>
10629
10630         * report.cs: Make all of it static.
10631
10632         * rootcontext.cs: Drop object_type and value_type computations, as
10633         we have those in the TypeManager anyways.
10634
10635         Drop report instance variable too, now it is a global.
10636
10637         * driver.cs: Use try/catch on command line handling.
10638
10639         Add --probe option to debug the error reporting system with a test
10640         suite. 
10641
10642         * report.cs: Add support for exiting program when a probe
10643         condition is reached.
10644
10645 2001-10-03  Ravi Pratap  <ravi@ximian.com>
10646
10647         * expression.cs (Binary::DoNumericPromotions): Fix the case when
10648         we do a forcible conversion regardless of type, to check if 
10649         ForceConversion returns a null.
10650
10651         (Binary::error19): Use location to report error.
10652
10653         (Unary::error23): Use location here too.
10654
10655         * ../errors/cs0019.cs : Check in.
10656
10657         * ../errors/cs0023.cs : Check in.
10658
10659         * expression.cs (Expression.MemberLookup): Return null for a rather esoteric
10660         case of a non-null MethodInfo object with a length of 0 !
10661
10662         (Binary::ResolveOperator): Flag error if overload resolution fails to find
10663         an applicable member - according to the spec :-)
10664         Also fix logic to find members in base types.
10665
10666         (Unary::ResolveOperator): Same here.
10667
10668         (Unary::report23): Change name to error23 and make first argument a TypeContainer
10669         as I was getting thoroughly confused between this and error19 :-)
10670         
10671         * expression.cs (Expression::ImplicitUserConversion): Re-write fully
10672         (::FindMostEncompassedType): Implement.
10673         (::FindMostEncompassingType): Implement.
10674         (::StandardConversionExists): Implement.
10675
10676         (UserImplicitCast): Re-vamp. We now need info about most specific
10677         source and target types so that we can do the necessary conversions.
10678
10679         (Invocation::MakeUnionSet): Completely re-write to make sure we form a proper
10680         mathematical union with no duplicates.
10681
10682 2001-10-03  Miguel de Icaza  <miguel@ximian.com>
10683
10684         * rootcontext.cs (RootContext::PopulateTypes): Populate containers
10685         in order from base classes to child classes, so that we can in
10686         child classes look up in our parent for method names and
10687         attributes (required for handling abstract, virtual, new, override
10688         constructs: we need to instrospect our base class, and if we dont
10689         populate the classes in order, the introspection might be
10690         incorrect.  For example, a method could query its parent before
10691         the parent has any methods and would determine that the parent has
10692         no abstract methods (while it could have had them)).
10693
10694         (RootContext::CreateType): Record the order in which we define the
10695         classes.
10696
10697 2001-10-02  Miguel de Icaza  <miguel@ximian.com>
10698
10699         * class.cs (TypeContainer::Populate): Also method definitions can
10700         fail now, keep track of this.
10701
10702         (TypeContainer::FindMembers): Implement support for
10703         DeclaredOnly/noDeclaredOnly flag.
10704
10705         (Constructor::Emit) Return the ConstructorBuilder.
10706
10707         (Method::Emit) Return the MethodBuilder. 
10708         Check for abstract or virtual methods to be public.
10709
10710         * rootcontext.cs (RootContext::CreateType): Register all the
10711         abstract methods required for the class to be complete and the
10712         interface methods that must be implemented. 
10713
10714         * cs-parser.jay: Report error 501 (method requires body if it is
10715         not marked abstract or extern).
10716
10717         * expression.cs (TypeOf::Emit): Implement.
10718
10719         * typemanager.cs: runtime_handle_type, new global type.
10720
10721         * class.cs (Property::Emit): Generate code for properties.
10722
10723 2001-10-02  Ravi Pratap  <ravi@ximian.com>
10724
10725         * expression.cs (Unary::ResolveOperator): Find operators on base type
10726         too - we now conform exactly to the spec.
10727
10728         (Binary::ResolveOperator): Same here.
10729
10730         * class.cs (Operator::Define): Fix minor quirk in the tests.
10731
10732         * ../errors/cs0215.cs : Added.
10733
10734         * ../errors/cs0556.cs : Added.
10735
10736         * ../errors/cs0555.cs : Added.
10737
10738 2001-10-01  Miguel de Icaza  <miguel@ximian.com>
10739
10740         * cs-tokenizer.cs: Reimplemented Location to be a struct with a
10741         single integer which is really efficient
10742
10743 2001-10-01  Ravi Pratap  <ravi@ximian.com>
10744
10745         *  expression.cs (Expression::ImplicitUserConversion): Use location
10746         even in the case when we are examining True operators.
10747  
10748         * class.cs (Operator::Define): Perform extensive checks to conform
10749         with the rules for operator overloading in the spec.
10750
10751         * expression.cs (Expression::ImplicitReferenceConversion): Implement
10752         some of the other conversions mentioned in the spec.
10753
10754         * typemanager.cs (array_type): New static member for the System.Array built-in
10755         type.
10756
10757         (cloneable_interface): For System.ICloneable interface.
10758
10759         * driver.cs (Driver::Driver): Initialize TypeManager's core types even before
10760         we start resolving the tree and populating types.
10761
10762         * ../errors/errors.txt : Update for error numbers -7, -8, -9, -10
10763  
10764 2001-10-01  Miguel de Icaza  <miguel@ximian.com>
10765
10766         * expression.cs (Expression::ExprClassFromMemberInfo,
10767         Expression::Literalize): Create literal expressions from
10768         FieldInfos which are literals.
10769
10770         (ConvertNumericExplicit, ImplicitNumericConversion): Fix a few
10771         type casts, because they were wrong.  The test suite in tests
10772         caught these ones.
10773
10774         (ImplicitNumericConversion): ushort to ulong requires a widening
10775         cast. 
10776
10777         Int32 constant to long requires widening cast as well.
10778
10779         * literal.cs (LongLiteral::EmitLong): Do not generate i4 constants
10780         for integers because the type on the stack is not i4.
10781
10782 2001-09-30  Miguel de Icaza  <miguel@ximian.com>
10783
10784         * expression.cs (report118): require location argument. 
10785
10786         * parameter.cs: Do not dereference potential null value.
10787
10788         * class.cs: Catch methods that lack the `new' keyword when
10789         overriding a name.  Report warnings when `new' is used without
10790         anything being there to override.
10791
10792         * modifiers.cs: Handle `NEW' as MethodAttributes.NewSlot.
10793
10794         * class.cs: Only add constructor to hashtable if it is non-null
10795         (as now constructors can fail on define).
10796
10797         (TypeManager, Class, Struct): Take location arguments.
10798
10799         Catch field instance initialization in structs as errors.
10800
10801         accepting_filter: a new filter for FindMembers that is static so
10802         that we dont create an instance per invocation.
10803
10804         (Constructor::Define): Catch errors where a struct constructor is
10805         parameterless 
10806
10807         * cs-parser.jay: Pass location information for various new
10808         constructs. 
10809         
10810         * delegate.cs (Delegate): take a location argument.
10811
10812         * driver.cs: Do not call EmitCode if there were problesm in the
10813         Definition of the types, as many Builders wont be there. 
10814
10815         * decl.cs (Decl::Decl): Require a location argument.
10816
10817         * cs-tokenizer.cs: Handle properly hex constants that can not fit
10818         into integers, and find the most appropiate integer for it.
10819
10820         * literal.cs: Implement ULongLiteral.
10821
10822         * rootcontext.cs: Provide better information about the location of
10823         failure when CreateType fails.
10824         
10825 2001-09-29  Miguel de Icaza  <miguel@ximian.com>
10826
10827         * rootcontext.cs (RootContext::PopulateTypes): Populates structs
10828         as well.
10829
10830         * expression.cs (Binary::CheckShiftArguments): Add missing type
10831         computation.
10832         (Binary::ResolveOperator): Add type to the logical and and logical
10833         or, Bitwise And/Or and Exclusive Or code paths, it was missing
10834         before.
10835
10836         (Binary::DoNumericPromotions): In the case where either argument
10837         is ulong (and most signed types combined with ulong cause an
10838         error) perform implicit integer constant conversions as well.
10839
10840 2001-09-28  Miguel de Icaza  <miguel@ximian.com>
10841
10842         * expression.cs (UserImplicitCast): Method should always be
10843         non-null. 
10844         (Invocation::BetterConversion): Simplified test for IntLiteral.
10845
10846         (Expression::ImplicitNumericConversion): Split this routine out.
10847         Put the code that performs implicit constant integer conversions
10848         here. 
10849
10850         (Expression::Resolve): Become a wrapper around DoResolve so we can
10851         check eclass and type being set after resolve.
10852
10853         (Invocation::Badness): Remove this dead function
10854
10855         (Binary::ResolveOperator): Do not compute the expensive argumnets
10856         unless we have a union for it.
10857
10858         (Probe::Emit): Is needs to do an isinst and then
10859         compare against null.
10860
10861         (::CanConvert): Added Location argument.  If the Location argument
10862         is null (Location.Null), then we do not report errors.  This is
10863         used by the `probe' mechanism of the Explicit conversion.  We do
10864         not want to generate an error for something that the user
10865         explicitly requested to be casted.  But the pipeline for an
10866         explicit cast first tests for potential implicit casts.
10867
10868         So for now, if the Location is null, it means `Probe only' to
10869         avoid adding another argument.   Might have to revise this
10870         strategy later.
10871
10872         (ClassCast): New class used to type cast objects into arbitrary
10873         classes (used in Explicit Reference Conversions).
10874
10875         Implement `as' as well.
10876
10877         Reverted all the patches from Ravi below: they were broken:
10878
10879                 * The use of `level' as a mechanism to stop recursive
10880                   invocations is wrong.  That was there just to catch the
10881                   bug with a strack trace but not as a way of addressing
10882                   the problem.
10883
10884                   To fix the problem we have to *understand* what is going
10885                   on and the interactions and come up with a plan, not
10886                   just get things going.
10887
10888                 * The use of the type conversion cache that I proposed
10889                   last night had an open topic: How does this work across
10890                   protection domains.  A user defined conversion might not
10891                   be public in the location where we are applying the
10892                   conversion, a different conversion might be selected
10893                   (ie, private A->B (better) but public B->A (worse),
10894                   inside A, A->B applies, but outside it, B->A will
10895                   apply).
10896
10897                 * On top of that (ie, even if the above is solved),
10898                   conversions in a cache need to be abstract.  Ie, `To
10899                   convert from an Int to a Short use an OpcodeCast', not
10900                   `To convert from an Int to a Short use the OpcodeCast on
10901                   the variable 5' (which is what this patch was doing).
10902         
10903 2001-09-28  Ravi Pratap  <ravi@ximian.com>
10904
10905         * expression.cs (Invocation::ConversionExists): Re-write to use
10906         the conversion cache
10907         
10908         (Expression::ConvertImplicit): Automatic bailing out if level != 0. Also
10909         cache all conversions done, not just user-defined ones.
10910
10911         (Invocation::BetterConversion): The real culprit. Use ConversionExists
10912         to determine if a conversion exists instead of acutually trying to 
10913         perform the conversion. It's faster too.
10914
10915         (Expression::ConvertExplicit): Modify to use ConversionExists to check
10916         and only then attempt the implicit conversion.
10917
10918 2001-09-28  Ravi Pratap  <ravi@ximian.com>
10919
10920         * expression.cs (ConvertImplicit): Use a cache for conversions
10921         already found. Check level of recursion and bail out if necessary.
10922         
10923 2001-09-28  Miguel de Icaza  <miguel@ximian.com>
10924
10925         * typemanager.cs (string_concat_string_string, string_concat_object_object):
10926         Export standard methods that we expect for string operations.
10927         
10928         * statement.cs (Block::UsageWarning): Track usage of variables and
10929         report the errors for not used variables.
10930
10931         * expression.cs (Conditional::Resolve, ::Emit): Implement ?:
10932         operator. 
10933
10934 2001-09-27  Miguel de Icaza  <miguel@ximian.com>
10935
10936         * codegen.cs: remove unnneded code 
10937
10938         * expression.cs: Removed BuiltinTypeAccess class
10939
10940         Fix the order in which implicit conversions are
10941         done.  
10942
10943         The previous fixed dropped support for boxed conversions (adding a
10944         test to the test suite now)
10945
10946         (UserImplicitCast::CanConvert): Remove test for source being null,
10947         that code is broken.  We should not feed a null to begin with, if
10948         we do, then we should track the bug where the problem originates
10949         and not try to cover it up here.
10950
10951         Return a resolved expression of type UserImplicitCast on success
10952         rather than true/false.  Ravi: this is what I was talking about,
10953         the pattern is to use a static method as a "constructor" for
10954         objects. 
10955
10956         Also, do not create arguments until the very last minute,
10957         otherwise we always create the arguments even for lookups that
10958         will never be performed. 
10959
10960         (UserImplicitCast::Resolve): Eliminate, objects of type
10961         UserImplicitCast are born in a fully resolved state. 
10962         
10963         * typemanager.cs (InitCoreTypes): Init also value_type
10964         (System.ValueType). 
10965
10966         * expression.cs (Cast::Resolve): First resolve the child expression.
10967
10968         (LValue): Add new method AddressOf to be used by
10969         the `&' operator.  
10970
10971         Change the argument of Store to take an EmitContext instead of an
10972         ILGenerator, because things like FieldExpr need to be able to call
10973         their children expression to generate the instance code. 
10974
10975         (Expression::Error, Expression::Warning): Sugar functions for
10976         reporting errors.
10977
10978         (Expression::MemberLookup): Accept a TypeContainer instead of a
10979         Report as the first argument.
10980
10981         (Expression::ResolvePrimary): Killed.  I still want to improve
10982         this as currently the code is just not right.
10983
10984         (Expression::ResolveMemberAccess): Simplify, but it is still
10985         wrong. 
10986
10987         (Unary::Resolve): Catch errors in AddressOf operators.
10988
10989         (LocalVariableReference::Emit, ::Store, ::AddressOf): typecast
10990         index to a byte for the short-version, or the compiler will choose
10991         the wrong Emit call, which generates the wrong data.
10992
10993         (ParameterReference::Emit, ::Store): same.
10994
10995         (FieldExpr::AddressOf): Implement.
10996         
10997         * typemanager.cs: TypeManager: made public variable instead of
10998         property.
10999         
11000         * driver.cs: document --fatal.
11001
11002         * report.cs (ErrorMessage, WarningMessage): new names for the old
11003         Error and Warning classes.
11004
11005         * cs-parser.jay (member_access): Turn built-in access to types
11006         into a normal simplename
11007
11008 2001-09-27  Ravi Pratap  <ravi@ximian.com>
11009
11010         * expression.cs (Invocation::BetterConversion): Fix to cope
11011         with q being null, since this was introducing a bug.
11012
11013         * expression.cs (ConvertImplicit): Do built-in conversions first.
11014
11015 2001-09-27  Ravi Pratap  <ravi@ximian.com>
11016
11017         * expression.cs (UserImplicitCast::Resolve): Fix bug.
11018
11019 2001-09-27  Ravi Pratap  <ravi@ximian.com>
11020
11021         * class.cs (TypeContainer::AddConstructor): Fix a stupid bug
11022         I had introduced long ago (what's new ?).
11023
11024         * expression.cs (UserImplicitCast::CanConvert): Static method to do 
11025         the work of all the checking. 
11026         (ConvertImplicit): Call CanConvert and only then create object if necessary.
11027         (UserImplicitCast::CanConvert, ::Resolve): Re-write.
11028
11029         (Unary::Operator): Rename Add and Subtract to Addition and Subtraction because
11030         that is the right way. 
11031
11032         (Invocation::MakeUnionSet): Convenience function to make unions of sets for 
11033         overloading resolution. Use everywhere instead of cutting and pasting code.
11034
11035         (Binary::ResolveOperator): Use MakeUnionSet.
11036
11037         (UserImplicitCast::CanConvert, ::Resolve): Update to take care of the case when 
11038         we have to convert to bool types. Not complete yet.
11039         
11040 2001-09-27  Miguel de Icaza  <miguel@ximian.com>
11041
11042         * typemanager.cs (TypeManager::CSharpName): support ushort.
11043
11044         * expression.cs (Expression::TryImplicitIntConversion): Attempts
11045         to provide an expression that performsn an implicit constant int
11046         conversion (section 6.1.6).
11047         (Expression::ConvertImplicitRequired): Reworked to include
11048         implicit constant expression conversions.
11049
11050         (Expression::ConvertNumericExplicit): Finished.
11051
11052         (Invocation::Emit): If InstanceExpression is null, then it means
11053         that we perform a call on this.
11054         
11055 2001-09-26  Miguel de Icaza  <miguel@ximian.com>
11056
11057         * expression.cs (Unary::Emit): Remove some dead code.
11058         (Probe): Implement Resolve and Emit for `is'.
11059         (Expression::ConvertImplicitRequired): Attempt to do constant
11060         expression conversions here.  Maybe should be moved to
11061         ConvertImplicit, but I am not sure.
11062         (Expression::ImplicitLongConstantConversionPossible,
11063         Expression::ImplicitIntConstantConversionPossible): New functions
11064         that tell whether is it possible to apply an implicit constant
11065         expression conversion.
11066
11067         (ConvertNumericExplicit): Started work on explicit numeric
11068         conversions.
11069
11070         * cs-parser.jay: Update operator constants.
11071
11072         * parameter.cs (Parameters::GetParameterInfo): Hook up VerifyArgs
11073         (Parameters::GetSignature): Hook up VerifyArgs here.
11074         (Parameters::VerifyArgs): Verifies that no two arguments have the
11075         same name. 
11076
11077         * class.cs (Operator): Update the operator names to reflect the
11078         ones that the spec expects (as we are just stringizing the
11079         operator names).
11080         
11081         * expression.cs (Unary::ResolveOperator): Fix bug: Use
11082         MethodInfo's ReturnType instead of LookupMethodByBuilder as the
11083         previous usage did only work for our methods.
11084         (Expression::ConvertImplicit): Handle decimal implicit numeric
11085         conversions as well.
11086         (Expression::InternalTypeConstructor): Used to invoke constructors
11087         on internal types for default promotions.
11088
11089         (Unary::Emit): Implement special handling for the pre/post
11090         increment/decrement for overloaded operators, as they need to have
11091         the same semantics as the other operators.
11092
11093         (Binary::ResolveOperator): ditto.
11094         (Invocation::ConversionExists): ditto.
11095         (UserImplicitCast::Resolve): ditto.
11096         
11097 2001-09-26  Ravi Pratap  <ravi@ximian.com>
11098
11099         * expression.cs (Unary::Emit and Binary::Emit): If we have an overloaded
11100         operator, return after emitting body. Regression tests pass again !
11101
11102         * expression.cs (ConvertImplicit): Take TypeContainer as first argument
11103         (Unary::ForceConversion, Binary::ForceConversion): Ditto.
11104         (Invocation::OverloadResolve): Ditto.
11105         (Invocation::BetterFunction, BetterConversion, ConversionExists): Ditto.
11106
11107         * everywhere : update calls to the above methods accordingly.
11108
11109 2001-09-26  Miguel de Icaza  <miguel@ximian.com>
11110
11111         * assign.cs (Assign): Make it inherit from ExpressionStatement.
11112
11113         * expression.cs (ExpressionStatement): New base class used for
11114         expressions that can appear in statements, so that we can provide
11115         an alternate path to generate expression that do not leave a value
11116         on the stack.
11117
11118         (Expression::Emit, and all the derivatives): We no longer return
11119         whether a value is left on the stack or not.  Every expression
11120         after being emitted leaves a single value on the stack.
11121
11122         * codegen.cs (EmitContext::EmitStatementExpression): Use the
11123         facilties of ExpressionStatement if possible.
11124
11125         * cs-parser.jay: Update statement_expression.
11126
11127 2001-09-25  Miguel de Icaza  <miguel@ximian.com>
11128
11129         * driver.cs: Change the wording of message
11130
11131 2001-09-25  Ravi Pratap  <ravi@ximian.com>
11132
11133         * expression.cs (Binary::ResolveOperator): Had forgottten to set 
11134         the type of the expression to the return type of the method if
11135         we have an overloaded operator match ! The regression tests pass again !
11136         (Unary::ResolveOperator): Ditto.
11137
11138         * expression.cs (Invocation::ConversionExists): Correct the member lookup
11139         to find "op_Implicit", not "implicit" ;-)
11140         (UserImplicitCast): New class to take care of user-defined implicit conversions.
11141         (ConvertImplicit, ForceConversion): Take TypeContainer argument
11142
11143         * everywhere : Correct calls to the above accordingly.
11144
11145         * expression.cs (UserImplicitCast::Resolve, ::Emit): Implement.
11146         (ConvertImplicit): Do user-defined conversion if it exists.
11147
11148 2001-09-24  Miguel de Icaza  <miguel@ximian.com>
11149
11150         * assign.cs: track location.
11151         (Resolve): Use implicit conversions on assignment.
11152
11153         * literal.cs: Oops.  Not good, Emit of short access values should
11154         pass (Bytes) or the wrong argument will be selected.
11155
11156         * expression.cs (Unary::Emit): Emit code for -expr.
11157         
11158         (Unary::ResolveOperator): Handle `Substract' for non-constants
11159         (substract from zero from the non-constants).
11160         Deal with Doubles as well. 
11161         
11162         (Expression::ConvertImplicitRequired): New routine that reports an
11163         error if no implicit conversion exists. 
11164
11165         (Invocation::OverloadResolve): Store the converted implicit
11166         expressions if we make them
11167         
11168 2001-09-24  Ravi Pratap  <ravi@ximian.com>
11169
11170         * class.cs (ConstructorInitializer): Take a Location argument.
11171         (ConstructorBaseInitializer): Same here.
11172         (ConstructorThisInitializer): Same here.
11173
11174         * cs-parser.jay : Update all calls accordingly.
11175
11176         * expression.cs (Unary, Binary, New): Take location argument.
11177         Update accordingly everywhere.
11178
11179         * cs-parser.jay : Update all calls to the above to take a location
11180         argument.
11181
11182         * class.cs : Ditto.
11183
11184 2001-09-24  Ravi Pratap  <ravi@ximian.com>
11185
11186         * expression.cs (Invocation::BetterFunction): Take TypeContainer argument
11187         (Invocation::BetterConversion): Same here
11188         (Invocation::ConversionExists): Ditto.
11189
11190         (Invocation::ConversionExists): Implement.
11191
11192 2001-09-22  Ravi Pratap  <ravi@ximian.com>
11193
11194         * expression.cs (OverloadResolve): Improve some more to catch errors 1502 and 1503
11195         Also take an additional TypeContainer argument.
11196
11197         * All over : Pass in TypeContainer as argument to OverloadResolve.
11198
11199         * typemanager.cs (CSharpName): Update to check for the string type and return
11200         that too.
11201
11202         * expression.cs (Invocation::FullMethodDesc): New static method to return a string fully describing
11203         a given method.
11204         
11205 2001-09-21  Ravi Pratap  <ravi@ximian.com>
11206
11207         * expression.cs (Invocation::OverloadResolve): Re-write to conform more to the spec.
11208         (Invocation::BetterFunction): Implement.
11209         (Invocation::BetterConversion): Implement.
11210         (Invocation::ConversionExists): Skeleton, no implementation yet.
11211
11212         Okay, things work fine !
11213
11214 2001-09-21  Miguel de Icaza  <miguel@ximian.com>
11215
11216         * typemanager.cs: declare and load enum_type, delegate_type and
11217         void_type. 
11218
11219         * expression.cs (Expression::Emit): Now emit returns a value that
11220         tells whether a value is left on the stack or not.  This strategy
11221         might be reveted tomorrow with a mechanism that would address
11222         multiple assignments.
11223         (Expression::report118): Utility routine to report mismatches on
11224         the ExprClass.
11225
11226         (Unary::Report23): Report impossible type/operator combination
11227         utility function.
11228
11229         (Unary::IsIncrementableNumber): Whether the type can be
11230         incremented or decremented with add.
11231         (Unary::ResolveOperator): Also allow enumerations to be bitwise
11232         complemented. 
11233         (Unary::ResolveOperator): Implement ++, !, ~,
11234
11235         (Invocation::Emit): Deal with new Emit convetion.
11236         
11237         * All Expression derivatives: Updated their Emit method to return
11238         whether they leave values on the stack or not.
11239         
11240         * codegen.cs (CodeGen::EmitStatement): Pop values left on the
11241         stack for expressions that are statements. 
11242
11243 2001-09-20  Miguel de Icaza  <miguel@ximian.com>
11244
11245         * expression.cs (LValue): New interface.  Must be implemented by
11246         LValue objects.
11247         (LocalVariableReference, ParameterReference, FieldExpr): Implement
11248         LValue interface.
11249         
11250         * assign.cs (Assign::Emit, Assign::Resolve): Use new LValue
11251         interface for generating code, simplifies the code.
11252
11253 2001-09-20  Ravi Pratap  <ravi@ximian.com>
11254
11255         * expression.cs (everywhere): Comment out return statements in ::Resolve
11256         methods to avoid the warnings.
11257
11258 2001-09-20  Miguel de Icaza  <miguel@ximian.com>
11259
11260         * driver.cs (parse): Report error 2001 if we can not open the
11261         source file.
11262
11263         * expression.cs (SimpleName::ResolveSimpleName): Error if we can
11264         not resolve it.
11265
11266         * cs-parser.jay (QualifierIdentifier): Pass location to SimpleName
11267         object. 
11268
11269         * statement.cs (Block::EmitMeta): Reuse the count across all the variables,
11270         otherwise nested blocks end up with the same index.
11271
11272         * codegen.cs (CodeGen::EmitTopBlock): Pass initial sequence
11273
11274         * expression.cs:  Instead of having FIXMEs in the Resolve
11275         functions, throw exceptions so it is obvious that we are facing a
11276         bug. 
11277
11278         * cs-parser.jay (invocation_expression): Pass Location information.
11279
11280         * codegen.cs (CodeGen::Save, CodeGen::CodeGen, CodeGen::Basename):
11281         Use a basename for those routines because .NET does not like paths
11282         on them. 
11283
11284         * class.cs (TypeContainer::AddMethod): Do not call DefineName if the name was
11285         already defined.
11286
11287 2001-09-19  Miguel de Icaza  <miguel@ximian.com>
11288
11289         * typemanager.cs (TypeManager::CoreLookupType): A function to make sure that we
11290         are loading the correct data types (throws an exception if not).
11291         (TypeManager::InitCoreTypes): Use CoreLookupType
11292
11293         * expression.cs (Unary::ResolveOperator): return the child
11294         expression for expressions which are just +expr.
11295         (Unary::ResolveOperator): Return negative literals for -LITERAL
11296         expressions (otherwise they are Unary {Literal}).
11297         (Invocation::Badness): Take into account `Implicit constant
11298         expression conversions'.
11299
11300         * literal.cs (LongLiteral): Implement long literal class.
11301         (IntLiteral): export the `Value' of the intliteral. 
11302
11303 2001-09-19  Ravi Pratap  <ravi@ximian.com>
11304
11305         * expression.cs (Binary::Emit): Finally get the emission right ! Woo!
11306
11307         * class.cs (Operator::Define): Change the methodname prefix to 'op_' 
11308         instead of 'Operator'
11309
11310         * expression.cs (Binary::ResolveOperator): Update accordingly.
11311         (Unary::Operator): Change names to 'Add' and 'Subtract' instead 'Plus'
11312         and 'Minus'
11313
11314         * cs-parser.jay (unary_expression): Update to use the new names.
11315
11316         * gen-treedump.cs (GetUnary): Same here.
11317
11318         * expression.cs (Unary::Resolve): Implement.
11319         (Binary::ResolveOperator): Re-write bits to quietly continue if no overloaded 
11320         operators are found instead of making noise ;-)
11321         (Unary::ResolveOperator): New method to do precisely the same thing which
11322         Binary::ResolveOperator does for Binary expressions.
11323         (Unary.method, .Arguments): Add.
11324         (Unary::OperName): Implement.   
11325         (Unary::ForceConversion): Copy and Paste !
11326
11327         * class.cs (Operator::Define): Fix a small bug for the case when we have 
11328         a unary operator.
11329
11330         * expression.cs (Unary::Emit): Implement. Need to find the right Opcodes
11331         for the inbuilt operators. Only overloading works for now ;-)
11332
11333 2001-09-18  Miguel de Icaza  <miguel@ximian.com>
11334
11335         * expression.cs (CheckedExpr::Resolve, CheckedExpr::Emit,
11336         UnCheckedExpr::Resolve, UnCheckedExpr::Emit): Implement.
11337
11338         * expression.cs (This::Emit): Implement. 
11339         (This::Resolve): Implement.
11340         (TypeOf:Resolve): Implement.
11341         (Expression::ResolveSimpleName): Add an implicit this to instance
11342         field references. 
11343         (MemberAccess::Resolve): Deal with Parameters and Fields. 
11344         Bind instance variable to Field expressions.
11345         (FieldExpr::Instance): New field used to track the expression that
11346         represents the object instance.
11347         (FieldExpr::Resolve): Track potential errors from MemberLookup not
11348         binding 
11349         (FieldExpr::Emit): Implement.
11350
11351         * codegen.cs (EmitIf, EmitStatement, EmitBlock): Propagate whether
11352         the last instruction contains a return opcode to avoid generating
11353         the last `ret' instruction (this generates correct code, and it is
11354         nice to pass the peverify output).
11355
11356         * class.cs (TypeContainer::EmitFieldInitializers): Implement field
11357         initializer for static and instance variables.
11358         (Constructor::Emit): Allow initializer to be null in the case of
11359         static constructors.  Only emit initializer for instance
11360         constructors. 
11361
11362         (TypeContainer::FindMembers): Return a null array if there are no
11363         matches.
11364
11365         Also fix the code for the MemberTypes.Method branch, as it was not
11366         scanning that for operators (or tried to access null variables before).
11367
11368         * assign.cs (Assign::Emit): Handle instance and static fields. 
11369
11370         * TODO: Updated.
11371
11372         * driver.cs: Stop compilation if there are parse errors.
11373
11374         * cs-parser.jay (constructor_declaration): Provide default base
11375         initializer for non-static constructors.
11376         (constructor_declarator): Do not provide a default base
11377         initializers if none was specified.
11378         Catch the fact that constructors should not have parameters.
11379
11380         * class.cs: Do not emit parent class initializers for static
11381         constructors, that should be flagged as an error.
11382
11383 2001-09-18  Ravi Pratap  <ravi@ximian.com>
11384
11385         * class.cs (RegisterMethodBuilder): Remove : it's unnecessary.
11386         Move back code into TypeContainer::Populate.
11387
11388 2001-09-18  Ravi Pratap  <ravi@ximian.com>
11389
11390         * class.cs (TypeContainer::AddConstructor): Fix the check to
11391         compare against Name, not Basename. 
11392         (Operator::OpType): Change Plus and Minus to Add and Subtract.
11393
11394         * cs-parser.jay : Update accordingly.
11395
11396         * class.cs (TypeContainer::FindMembers): For the case where we are searching
11397         for methods, don't forget to look into the operators too.
11398         (RegisterMethodBuilder): Helper method to take care of this for
11399         methods, constructors and operators.
11400         (Operator::Define): Completely revamp.
11401         (Operator.OperatorMethod, MethodName): New fields.
11402         (TypeContainer::Populate): Move the registering of builders into
11403         RegisterMethodBuilder.
11404         (Operator::Emit): Re-write.
11405
11406         * expression.cs (Binary::Emit): Comment out code path to emit method
11407         invocation stuff for the case when we have a user defined operator. I am
11408         just not able to get it right !
11409         
11410 2001-09-17  Miguel de Icaza  <miguel@ximian.com>
11411
11412         * expression.cs (Expression::OverloadResolve): Drop TypeContainer
11413         argument. 
11414
11415         (Expression::MemberLookup): Provide a version that allows to
11416         specify the MemberTypes and BindingFlags. 
11417
11418         * statement.cs (Block::GetVariableInfo): Forgot to recurse here,
11419         so it was not fetching variable information from outer blocks.
11420
11421         * modifiers.cs: (Modifiers::TypeAttr): Invert condition on
11422         Beforefieldinit as it was buggy.
11423
11424         * rootcontext.cs (::LookupInterfaceOrClass): Removed an Error -200
11425         that Ravi put here.  
11426
11427         * class.cs (Constructor::Emit): Only emit if block is not null.
11428         (TypeContainer::EmitDefaultConstructor): Removed routine, now we
11429         deal with this by semantically definining it as if the user had
11430         done it.
11431
11432         (TypeContainer::FindMembers): Removed ad-hoc hack to deal with
11433         constructors as we now "emit" them at a higher level.
11434
11435         (TypeContainer::DefineDefaultConstructor): Used to define the
11436         default constructors if none was provided.
11437
11438         (ConstructorInitializer): Add methods Resolve and Emit. 
11439         
11440         * expression.cs: Cast to ConstructorInfo instead of MethodInfo
11441
11442 2001-09-17  Ravi Pratap  <ravi@ximian.com>
11443
11444         * class.cs (TypeContainer::EmitDefaultConstructor): Register
11445         the default constructor builder with our hashtable for methodbuilders
11446         to methodcores.
11447
11448         * expression.cs (Invocation::OverloadResolve): Add a check for pd == null
11449         and argument_count is 0 in which case we have a match.
11450         (Binary::ResolveOperator): More null checking and miscellaneous coding
11451         style cleanup.
11452
11453 2001-09-17  Ravi Pratap  <ravi@ximian.com>
11454
11455         * rootcontext.cs (IsNameSpace): Compare against null.
11456
11457         * everywhere : Correct spelling to 'Greater' and to 'Subtract'
11458
11459         * class.cs (Operator::OpType): Change names to match the ones in Binary::Operator
11460         and Unary::Operator.
11461
11462         * cs-parser.jay (operator_declaration, CheckBinaryOperator, CheckUnaryOperator): Update
11463         accordingly.
11464
11465         * expression.cs (Binary::method): New member to hold the MethodBase for the case when
11466         we have overloaded operators.
11467         (Binary::ResolveOperator): Implement the part which does the operator overload
11468         resolution.
11469
11470         * class.cs (Operator::Emit): Implement.
11471         (TypeContainer::Emit): Emit the operators we have too.
11472
11473         * expression.cs (Binary::Emit): Update to emit the appropriate code for
11474         the case when we have a user-defined operator.
11475         
11476 2001-09-17  Miguel de Icaza  <miguel@ximian.com>
11477
11478         * rootcontext.cs: Fix bug: tree.Namespaces might be null.
11479
11480 2001-09-16  Ravi Pratap  <ravi@ximian.com>
11481
11482         * class.cs (EmitStaticFieldInitializers, EmitFieldInitializers): Make public.
11483         (TypeContainer::EmitConstructor): Remove and move code into Contructor::Emit.
11484         (Constructor::Emit): Implement.
11485         (EmitStaticFieldInitializers, EmitFieldInitializers): Ensure we return immediately
11486         if we have no work to do. 
11487         (TypeContainer::Emit): Pass in TypeContainer as argument to the constructor's 
11488         Emit method.
11489
11490         * interface.cs (Interface::InterfaceAttr): Re-write to be more correct and complete.
11491         (Interface::IsTopLevel): Add. Same as TypeContainer::IsTopLevel.
11492
11493         * class.cs (TypeContainer::IsTopLevel): Modify to use parent.Parent instead
11494         of parent.parent.
11495
11496 2001-09-15  Ravi Pratap  <ravi@ximian.com>
11497
11498         * tree.cs (Tree::namespaces): New hashtable to keep track of namespaces
11499         in the source.
11500         (Tree::RecordNamespace): Method to do what the name says ;-)
11501         (Tree::Namespaces): Property to get at the namespaces hashtable.
11502
11503         * cs-parser.jay (namespace_declaration): Call RecordNamespace to 
11504         keep track.
11505
11506         * rootcontext.cs (IsNamespace): Fixed it :-)
11507
11508 2001-09-14  Miguel de Icaza  <miguel@ximian.com>
11509
11510         * class.cs (TypeContainer::FindMembers): Add support for
11511         constructors. 
11512         (MethodCore): New class that encapsulates both the shared aspects
11513         of a Constructor and a Method.  
11514         (Method, Constructor): Factored pieces into MethodCore.
11515
11516         * driver.cs: Added --fatal which makes errors throw exceptions.
11517         Load System assembly as well as part of the standard library.
11518
11519         * report.cs: Allow throwing exceptions on errors for debugging.
11520
11521         * modifiers.cs: Do not use `parent', instead use the real type
11522         container to evaluate permission settings.
11523
11524         * class.cs: Put Ravi's patch back in.  He is right, and we will
11525         have to cope with the
11526
11527 2001-09-14  Ravi Pratap  <ravi@ximian.com>
11528
11529         * modifiers.cs (TypeAttr, MethodAttr, FieldAttr): Map protected internal to
11530         FamORAssem, not FamANDAssem.
11531         
11532 2001-09-14  Miguel de Icaza  <miguel@ximian.com>
11533
11534         * driver.cs: Added --parse option that only parses its input files
11535         and terminates.
11536
11537         * class.cs: Reverted last change from Ravi to IsTopLevel.  That is
11538         incorrect.  IsTopLevel is not used to tell whether an object is
11539         root_types or not (that can be achieved by testing this ==
11540         root_types).  But to see if this is a top-level *class* (not
11541         necessarly our "toplevel" container). 
11542
11543 2001-09-14  Ravi Pratap  <ravi@ximian.com>
11544
11545         * enum.cs (Enum::Define): Modify to call the Lookup method on the
11546         parent instead of a direct call to GetType.
11547
11548 2001-09-14  Ravi Pratap  <ravi@ximian.com>
11549
11550         * class.cs (TypeContainer::TypeAttr): Remove property code and move it into
11551         Modifiers.TypeAttr. This should just be a call to that method.
11552
11553         * modifiers.cs (TypeAttr): Re-write and take an extra argument, the TypeContainer
11554         object so that we can determine if we are top-level or not.
11555
11556         * delegate.cs (Delegate::Define): Update call to TypeAttr method to pass in the 
11557         TypeContainer too.
11558
11559         * enum.cs (Enum::Define): Ditto.
11560
11561         * modifiers.cs (FieldAttr): Re-write.
11562
11563         * class.cs (TypeContainer::IsTopLevel): Change accessibility to public.
11564         (TypeContainer::HaveStaticConstructor): New property to provide access
11565         to precisely that info.
11566
11567         * modifiers.cs (MethodAttr): Re-write.
11568         (EventAttr): Remove altogether as there seems to be no ostensible use for it.
11569
11570         * class.cs (TypeContainer::IsTopLevel): Re-write. root_types doesn't seem to be the parent
11571         of top-level types as claimed.
11572         
11573 2001-09-13  Miguel de Icaza  <miguel@ximian.com>
11574
11575         * expression.cs (MemberLookup): Fruitless attempt to lookup
11576         constructors.  Maybe I need to emit default constructors?  That
11577         might be it (currently .NET emits this for me automatically).
11578         (Invocation::OverloadResolve): Cope with Arguments == null.
11579         (Invocation::EmitArguments): new function, shared by the new
11580         constructor and us.
11581         (Invocation::Emit): Handle static and instance methods.  Emit
11582         proper call instruction for virtual or non-virtual invocations.
11583         (New::Emit): Implement.
11584         (New::Resolve): Implement.
11585         (MemberAccess:Resolve): Implement.
11586         (MethodGroupExpr::InstanceExpression): used conforming to the spec
11587         to track instances.
11588         (FieldExpr::Resolve): Set type.
11589
11590         * support.cs: Handle empty arguments.
11591                 
11592         * cs-parser.jay (CompositeLookup, QualifierIdentifier,
11593         SimpleLookup): Auxiliary routines to help parse a qualifier
11594         identifier.  
11595
11596         Update qualifier_identifier rule.
11597
11598         * codegen.cs: Removed debugging messages.
11599
11600         * class.cs: Make this a global thing, this acts just as a "key" to
11601         objects that we might have around.
11602
11603         (Populate): Only initialize method_builders_to_methods once.
11604
11605         * expression.cs (PropertyExpr): Initialize type from the
11606         PropertyType. 
11607
11608         * codegen.cs (EmitContext::EmitBoolExpression): Use propper
11609         Resolve pattern.  Attempt to implicitly convert value to boolean.
11610         Emit code.
11611
11612         * expression.cs: Set the type for the int32/int32 argument case.
11613         (Binary::ResolveOperator): Set the return type to boolean for
11614         comparission operators
11615
11616         * typemanager.cs: Remove debugging print code.
11617
11618         (Invocation::Resolve): resolve type.
11619
11620         * class.cs: Allocate a MemberInfo of the correct size, as the code
11621         elsewhere depends on the test to reflect the correct contents.
11622
11623         (Method::) Keep track of parameters, due to System.Reflection holes
11624
11625         (TypeContainer::Populate): Keep track of MethodBuilders to Method
11626         mapping here.
11627
11628         (TypeContainer::FindMembers): Use ArrayList and then copy an array
11629         of the exact size and return that.
11630
11631         (Class::LookupMethodByBuilder): New function that maps
11632         MethodBuilders to its methods.  Required to locate the information
11633         on methods because System.Reflection bit us again.
11634
11635         * support.cs: New file, contains an interface ParameterData and
11636         two implementations: ReflectionParameters and InternalParameters
11637         used to access Parameter information.  We will need to grow this
11638         as required.
11639
11640         * expression.cs (Invocation::GetParameterData): implement a cache
11641         and a wrapper around the ParameterData creation for methods. 
11642         (Invocation::OverloadResolve): Use new code.
11643
11644 2001-09-13  Ravi Pratap  <ravi@ximian.com>
11645
11646         * class.cs (TypeContainer::EmitField): Remove and move into 
11647         (Field::Define): here and modify accordingly.
11648         (Field.FieldBuilder): New member.
11649         (TypeContainer::Populate): Update accordingly.
11650         (TypeContainer::FindMembers): Implement.
11651
11652 2001-09-13  Miguel de Icaza  <miguel@ximian.com>
11653
11654         * statement.cs: (VariableInfo::VariableType): New field to be
11655         initialized with the full type once it is resolved. 
11656
11657 2001-09-12  Miguel de Icaza  <miguel@ximian.com>
11658
11659         * parameter.cs (GetParameterInfo): Use a type cache to compute
11660         things only once, and to reuse this information
11661
11662         * expression.cs (LocalVariableReference::Emit): Implement.
11663         (OpcodeCast::Emit): fix.
11664
11665         (ParameterReference::Resolve): Implement.
11666         (ParameterReference::Emit): Implement.
11667
11668         * cs-parser.jay: Fix bug introduced by Ravi, variable initializers
11669         that are expressions need to stay as Expressions.
11670
11671         * typemanager.cs (CSharpName): Returns the C# name of a type if
11672         possible. 
11673
11674         * expression.cs (Expression::ConvertImplicit): New function that
11675         implements implicit type conversions.
11676
11677         (Expression::ImplicitReferenceConversion): Implements implicit
11678         reference conversions.
11679
11680         (EmptyCast): New type for transparent casts.
11681
11682         (OpcodeCast): New type for casts of types that are performed with
11683         a sequence of bytecodes.
11684         
11685         (BoxedCast): New type used for casting value types into reference
11686         types.  Emits a box opcode.
11687
11688         (Binary::DoNumericPromotions): Implements numeric promotions of
11689         and computation of the Binary::Type.
11690
11691         (Binary::EmitBranchable): Optimization.
11692
11693         (Binary::Emit): Implement code emission for expressions.
11694         
11695         * typemanager.cs (TypeManager): Added two new core types: sbyte
11696         and byte.
11697
11698 2001-09-12  Ravi Pratap  <ravi@ximian.com>
11699
11700         * class.cs (TypeContainer::FindMembers): Method which does exactly
11701         what Type.FindMembers does, only we don't have to use reflection. No
11702         implementation yet.
11703
11704         * typemanager.cs (typecontainers): New hashtable to hold the corresponding
11705         typecontainer objects as we need to get at them.
11706         (TypeManager::AddUserType): Overload to take an extra argument, the TypeContainer.
11707
11708         * rootcontext.cs : Correspondingly modify called to AddUserType to pass the
11709         typecontainer object.
11710
11711         * expression.cs (MemberLookup): Modify signature to take a RootContext object instead
11712         of just a Report object.
11713
11714 2001-09-11  Ravi Pratap  <ravi@ximian.com>
11715
11716         * class.cs (Event::Define): Go back to using the prefixes "add_" and
11717         "remove_"
11718         (TypeContainer::Populate): Now define the delegates of the type too.
11719         (TypeContainer.Delegates): Property to access the list of delegates defined
11720         in the type.
11721
11722         * delegates.cs (Delegate::Define): Implement partially.
11723
11724         * modifiers.cs (TypeAttr): Handle more flags.
11725
11726 2001-09-11  Ravi Pratap  <ravi@ximian.com>
11727
11728         * class.cs (Indexer::Define): Fix for loop iteration condition to be just <
11729         and not <=
11730         (Operator::Define): Re-write logic to get types by using the LookupType method
11731         instead of blindly doing a Type.GetType ! How stupid can I get ;-) ?
11732         (Indexer::Define): Ditto.
11733         (Event::Define): Ditto.
11734         (Property::Define): Ditto.
11735         
11736 2001-09-10  Ravi Pratap  <ravi@ximian.com>
11737
11738         * class.cs (TypeContainer::Populate): Now define operators too. 
11739         (TypeContainer.Operators): New property to access the list of operators
11740         in a type.
11741         (Operator.OperatorMethodBuilder): New member to hold the method builder
11742         for the operator we are defining.
11743         (Operator::Define): Implement.
11744
11745 2001-09-10  Ravi Pratap  <ravi@ximian.com>
11746
11747         * class.cs (Event::Define): Make the prefixes of the accessor methods
11748         addOn_ and removeOn_ 
11749
11750         * genericparser.cs (GenericParser::error): Overloaded method to handle the case
11751         of the location being passed in too. Ideally, this should go later since all
11752         error reporting should be done through the Report object.
11753
11754         * class.cs (TypeContainer.Indexers): New property to access the list of indexers.
11755         (Populate): Iterate thru the indexers we have and define them too.
11756         (Indexer.GetMethodBuilder, .SetMethodBuilder): New members to hold the method builders
11757         for the get and set accessors.
11758         (Indexer::Define): Implement.
11759         
11760 2001-09-09  Miguel de Icaza  <miguel@ximian.com>
11761
11762         * expression.cs (Binary::Resolve): Beginning of it.  I scratched
11763         my previous implementation, did not work.
11764
11765         * typemanager.cs: Add a couple of missing types (the longs).
11766
11767         * literal.cs: Use TypeManager.bool_type instead of getting it.
11768
11769         * expression.cs (EventExpr): New kind of expressions.
11770         (Expressio::ExprClassFromMemberInfo): finish
11771
11772 2001-09-08  Miguel de Icaza  <miguel@ximian.com>
11773
11774         * assign.cs: Emit stores to static fields differently.
11775
11776 2001-09-08  Ravi Pratap  <ravi@ximian.com>
11777
11778         * Merge in changes and adjust code to tackle conflicts. Backed out my
11779         code in Assign::Resolve ;-) 
11780
11781 2001-09-08  Ravi Pratap  <ravi@ximian.com>
11782
11783         * cs-parser.jay (CheckAttributeTarget): Modify call to error to use
11784         instead Report.Error and also pass in the location.
11785         (CSharpParser::Lexer): New readonly property to return the reference
11786         to the Tokenizer object.
11787         (declare_local_variables): Use Report.Error with location instead of plain 
11788         old error.
11789         (CheckDef): Ditto.
11790
11791         * class.cs (Operator::CheckUnaryOperator): Move into cs-parser.jay.
11792         (Operator.CheckBinaryOperator): Ditto.
11793
11794         * cs-parser.jay (operator_declarator): Update accordingly.
11795
11796         * cs-parser.jay (CheckUnaryOperator): Modify to use Report.Error
11797         (CheckBinaryOperator): Same here.
11798
11799         * rootcontext.cs (LookupType): Add an extra lookup which simply does a lookup
11800         on the name without any prefixes of namespace names etc. This is because we
11801         already might have something already fully qualified like 
11802         'System.Console.WriteLine'
11803
11804         * assign.cs (Resolve): Begin implementation. Stuck ;-)
11805
11806 2001-09-07  Ravi Pratap  <ravi@ximian.com>
11807
11808         * cs-tokenizer.cs (location): Return a string which also contains
11809         the file name.
11810
11811         * expression.cs (ElementAccess): New class for expressions of the
11812         type 'element access.'
11813         (BaseAccess): New class for expressions of the type 'base access.'
11814         (CheckedExpr, UnCheckedExpr): New classes for Checked and Unchecked expressions
11815         respectively.
11816         
11817         * cs-parser.jay (element_access): Implement action.
11818         (base_access): Implement actions.
11819         (checked_expression, unchecked_expression): Implement.
11820
11821         * cs-parser.jay (local_variable_type): Correct and implement.
11822         (type_suffixes, type_suffix_list, type_suffix): Implement actions.
11823
11824         * cs-tokenizer.cs (real_type_suffix): Comment out the extra getchar.
11825
11826         * cs-parser.jay (rank_specifiers): Remove space while concatenating the type's
11827         name and the specifiers.
11828
11829         * interface.cs (InterfaceAttr): New property to return the corresponding TypeAttributes
11830         
11831         * rootcontext.cs (CreateInterface): Use the InterfaceAttr property instead of 
11832         making them all public ;-)
11833
11834         * cs-parser.jay (error): Remove entirely as we have an implementation in the base
11835         class anyways.
11836         
11837 2001-09-07  Miguel de Icaza  <miguel@ximian.com>
11838
11839         * expression.cs (ExprClassFromMemberInfo): Return FieldExpr and
11840         PropertyExprs.
11841         (FieldExpr, PropertyExprs): New resolved expressions.
11842         (SimpleName::MemberStaticCheck): Perform static checks for access
11843         to non-static fields on static methods. Maybe this should be
11844         generalized for MemberAccesses. 
11845         (SimpleName::ResolveSimpleName): More work on simple name
11846         resolution. 
11847
11848         * cs-parser.jay (primary_expression/qualified_identifier): track
11849         the parameter index.
11850
11851         * codegen.cs (CodeGen::Save): Catch save exception, report error.
11852         (EmitContext::EmitBoolExpression): Chain to expression generation
11853         instead of temporary hack.
11854         (::EmitStatementExpression): Put generic expression code generation.
11855
11856         * assign.cs (Assign::Emit): Implement variable assignments to
11857         local variables, parameters and fields.
11858
11859 2001-09-06  Miguel de Icaza  <miguel@ximian.com>
11860
11861         * statement.cs (Block::GetVariableInfo): New method, returns the
11862         VariableInfo for a variable name in a block.
11863         (Block::GetVariableType): Implement in terms of GetVariableInfo
11864
11865         * literal.cs (IntLiteral::Emit, FloatLiteral::Emit,
11866         DoubleLiteral::Emit, CharLiteral::Emit, BoolLiteral::Emit): Implement
11867
11868 2001-09-06  Ravi Pratap  <ravi@ximian.com>
11869
11870         * cs-parser.jay (operator_declaration): Continue on my quest : update
11871         to take attributes argument.
11872         (event_declaration): Ditto.
11873         (enum_declaration): Ditto.
11874         (indexer_declaration): Ditto.
11875         
11876         * class.cs (Operator::Operator): Update constructor accordingly.
11877         (Event::Event): Ditto.
11878
11879         * delegate.cs (Delegate::Delegate): Same here.
11880
11881         * enum.cs (Enum::Enum): Same here.
11882         
11883 2001-09-05  Ravi Pratap  <ravi@ximian.com>
11884
11885         * cs-parser.jay (CheckAttributeTarget): Update to use the right error number.
11886
11887         * ../tests/cs0658.cs : New file to demonstrate error 0658.
11888
11889         * attribute.cs (Attributes): New class to encapsulate all attributes which were
11890         being passed around as an arraylist.
11891         (Attributes::AddAttribute): Method to add attribute sections.
11892
11893         * cs-parser.jay (opt_attributes): Modify actions to use the new Attributes class.
11894         (struct_declaration): Update accordingly.
11895         (constant_declaration): Update.
11896         (field_declaration): Update.
11897         (method_header): Update.
11898         (fixed_parameter): Update.
11899         (parameter_array): Ditto.
11900         (property_declaration): Ditto.
11901         (destructor_declaration): Ditto.
11902         
11903         * class.cs (Struct::Struct): Update constructors accordingly.
11904         (Class::Class): Ditto.
11905         (Field::Field): Ditto.
11906         (Method::Method): Ditto.
11907         (Property::Property): Ditto.
11908         (TypeContainer::OptAttribute): update property's return type.
11909         
11910         * interface.cs (Interface.opt_attributes): New member.
11911         (Interface::Interface): Update to take the extra Attributes argument.
11912
11913         * parameter.cs (Parameter::Parameter): Ditto.
11914
11915         * constant.cs (Constant::Constant): Ditto.
11916
11917         * interface.cs (InterfaceMemberBase): New OptAttributes field.
11918         (InterfaceMemberBase::InterfaceMemberBase): Update constructor to take 
11919         the attributes as a parameter.
11920         (InterfaceProperty): Update constructor call.
11921         (InterfaceEvent): Ditto.
11922         (InterfaceMethod): Ditto.
11923         (InterfaceIndexer): Ditto.
11924
11925         * cs-parser.jay (interface_indexer_declaration): Update call to constructor to 
11926         pass the attributes too.
11927         (interface_event_declaration): Ditto.
11928         (interface_property_declaration): Ditto.
11929         (interface_method_declaration): Ditto.
11930         (interface_declaration): Ditto.
11931
11932 2001-09-05  Miguel de Icaza  <miguel@ximian.com>
11933
11934         * class.cs (Method::Define): Track the "static Main" definition to
11935         create an entry point. 
11936
11937         * rootcontext.cs (RootContext::EntryPoint): MethodInfo that holds the
11938         EntryPoint if we find it. 
11939
11940         * codegen.cs (EmitContext::EmitInvocation): Emit invocations.
11941         (EmitContext::ig): Make this variable public.
11942
11943         * driver.cs: Make the default output file be the first file name
11944         with the .exe extension.  
11945
11946         Detect empty compilations
11947
11948         Handle various kinds of output targets.  Handle --target and
11949         rename -t to --dumper.
11950
11951         * expression.cs, literal.cs, assign.cs, constant.cs: All `Resolve'
11952         methods inherited from Expression return now an Expression.  This
11953         will is used during the tree rewriting as we resolve them during
11954         semantic analysis.
11955
11956         (Expression::MemberLookup): Implements the MemberLookup (7.3) from
11957         the spec.  Missing entirely is the information about
11958         accessability of elements of it.
11959
11960         (Expression::ExprClassFromMemberInfo): New constructor for
11961         Expressions that creates a fully initialized Expression based on
11962         a MemberInfo that is one of Eventinfo, FieldINfo, PropertyInfo or
11963         a Type.
11964
11965         (Invocation::Resolve): Begin implementing resolution of invocations.
11966         
11967         * literal.cs (StringLiteral):  Implement Emit.
11968
11969 2001-09-05  Ravi Pratap  <ravi@ximian.com>
11970
11971         * cs-parser.jay (error): Add new modifier because we are hiding an inherited
11972         member.
11973         
11974 2001-09-04  Ravi Pratap  <ravi@ximian.com>
11975
11976         * cs-parser.jay (attribute_arguments): Implement actions.
11977         (attribute): Fix bug in production. Implement action.
11978         (attribute_list): Implement.
11979         (attribute_target): Implement.
11980         (attribute_target_specifier, opt_target_specifier): Implement
11981         (CheckAttributeTarget): New method to check if the attribute target
11982         is valid.
11983         (attribute_section): Implement.
11984         (opt_attributes): Implement.
11985
11986         * attribute.cs : New file to handle attributes.
11987         (Attribute): Class to hold attribute info.
11988
11989         * cs-parser.jay (opt_attribute_target_specifier): Remove production
11990         (attribute_section): Modify production to use 2 different rules to 
11991         achieve the same thing. 1 s/r conflict down !
11992         Clean out commented, useless, non-reducing dimension_separator rules.
11993         
11994         * class.cs (TypeContainer.attributes): New member to hold list
11995         of attributes for a type.
11996         (Struct::Struct): Modify to take one more argument, the attribute list.
11997         (Class::Class): Ditto.
11998         (Field::Field): Ditto.
11999         (Method::Method): Ditto.
12000         (Property::Property): Ditto.
12001         
12002         * cs-parser.jay (struct_declaration): Update constructor call to
12003         pass in the attributes too.
12004         (class_declaration): Ditto.
12005         (constant_declaration): Ditto.
12006         (field_declaration): Ditto.
12007         (method_header): Ditto.
12008         (fixed_parameter): Ditto.
12009         (parameter_array): Ditto.
12010         (property_declaration): Ditto.
12011
12012         * constant.cs (Constant::Constant): Update constructor similarly.
12013         Use System.Collections.
12014
12015         * parameter.cs (Parameter::Parameter): Update as above.
12016
12017 2001-09-02  Ravi Pratap  <ravi@ximian.com>
12018
12019         * class.cs (TypeContainer::AddDelegate): New method to add a delegate.
12020         (TypeContainer.delegates): New member to hold list of delegates.
12021
12022         * cs-parser.jay (delegate_declaration): Implement the action correctly 
12023         this time as I seem to be on crack ;-)
12024
12025 2001-09-02  Miguel de Icaza  <miguel@ximian.com>
12026
12027         * rootcontext.cs (RootContext::IsNamespace): new function, used to
12028         tell whether an identifier represents a namespace.
12029
12030         * expression.cs (NamespaceExpr): A namespace expression, used only
12031         temporarly during expression resolution.
12032         (Expression::ResolveSimpleName, ::ResolvePrimary, ::ResolveName):
12033         utility functions to resolve names on expressions.
12034
12035 2001-09-01  Miguel de Icaza  <miguel@ximian.com>
12036
12037         * codegen.cs: Add hook for StatementExpressions. 
12038
12039         * class.cs: Fix inverted test for static flag in methods.
12040
12041 2001-09-02  Ravi Pratap  <ravi@ximian.com>
12042
12043         * class.cs (Operator::CheckUnaryOperator): Correct error number used
12044         to make it coincide with MS' number.
12045         (Operator::CheckBinaryOperator): Ditto.
12046
12047         * ../errors/errors.txt : Remove error numbers added earlier.
12048
12049         * ../errors/cs1019.cs : Test case for error # 1019
12050
12051         * ../errros/cs1020.cs : Test case for error # 1020
12052
12053         * cs-parser.jay : Clean out commented cruft.
12054         (dimension_separators, dimension_separator): Comment out. Ostensibly not
12055         used anywhere - non-reducing rule.
12056         (namespace_declarations): Non-reducing rule - comment out.
12057
12058         * enum.cs (Enum::AddEnum): Rename to AddEnumMember as I was getting confused
12059         with TypeContainer::AddEnum.
12060
12061         * delegate.cs : New file for delegate handling classes.
12062         (Delegate): Class for declaring delegates.
12063
12064         * makefile : Update.
12065
12066         * cs-parser.jay (delegate_declaration): Implement.
12067
12068 2001-09-01  Ravi Pratap  <ravi@che.iitm.ac.in>
12069
12070         * class.cs (Event::Define): Implement.
12071         (Event.EventBuilder): New member.
12072
12073         * class.cs (TypeContainer::Populate): Update to define all enums and events
12074         we have.
12075         (Events): New property for the events arraylist we hold. Shouldn't we move to using
12076         readonly fields for all these cases ?
12077
12078 2001-08-31  Ravi Pratap  <ravi@che.iitm.ac.in>
12079
12080         * class.cs (Property): Revamp to use the convention of making fields readonly.
12081         Accordingly modify code elsewhere.
12082
12083         * class.cs : Apply patch from Mr. Mandar <go_mono@hotmail.com> for implementing
12084         the Define method of the Property class.
12085
12086         * class.cs : Clean up applied patch and update references to variables etc. Fix 
12087         trivial bug.
12088         (TypeContainer::Populate): Update to define all the properties we have. Also
12089         define all enumerations.
12090
12091         * enum.cs (Define): Implement.
12092         
12093 2001-08-31  Ravi Pratap  <ravi@che.iitm.ac.in>
12094
12095         * cs-parser.jay (overloadable_operator): The semantic value is an
12096         enum of the Operator class.
12097         (operator_declarator): Implement actions.
12098         (operator_declaration): Implement.
12099
12100         * class.cs (Operator::CheckUnaryOperator): New static method to help in checking
12101         validity of definitions.
12102         (Operator::CheckBinaryOperator): Static method to check for binary operators
12103         (TypeContainer::AddOperator): New method to add an operator to a type.
12104
12105         * cs-parser.jay (indexer_declaration): Added line to actually call the
12106         AddIndexer method so it gets added ;-)
12107
12108         * ../errors/errors.txt : Update to include new error numbers. Are these numbers 
12109         already taken care of by the MS compiler ?  
12110
12111 2001-08-29  Ravi Pratap  <ravi@che.iitm.ac.in>
12112
12113         * class.cs (Operator): New class for operator declarations.
12114         (Operator::OpType): Enum for the various operators.
12115
12116 2001-08-29  Ravi Pratap  <ravi@che.iitm.ac.in>
12117
12118         * class.cs (TypeContainer::AddIndexer): Remove FIXME comment. We
12119         ostensibly handle this in semantic analysis.
12120
12121         * cs-parser.jay (general_catch_clause): Comment out
12122         (specific_catch_clauses, specific_catch_clause): Ditto.
12123         (opt_general_catch_clause, opt_specific_catch_clauses): Ditto
12124         (catch_args, opt_catch_args): New productions.
12125         (catch_clause): Rewrite to use the new productions above
12126         (catch_clauses): Modify accordingly.
12127         (opt_catch_clauses): New production to use in try_statement
12128         (try_statement): Revamp. Basically, we get rid of one unnecessary rule
12129         and re-write the code in the actions to extract the specific and
12130         general catch clauses by being a little smart ;-)
12131
12132         * ../tests/try.cs : Fix. It's not 'finalize' my friend, it's 'finally' !
12133         Hooray, try and catch statements parse fine !
12134         
12135 2001-08-28  Ravi Pratap  <ravi@che.iitm.ac.in>
12136
12137         * statement.cs (Block::GetVariableType): Fix logic to extract the type
12138         string from the hashtable of variables.
12139
12140         * cs-parser.jay (event_accessor_declarations): Trivial fix. Man, how did
12141         I end up making that mistake ;-)
12142         (catch_clauses): Fixed gross error which made Key and Value of the 
12143         DictionaryEntry the same : $1 !!
12144
12145 2001-08-28  Ravi Pratap  <ravi@che.iitm.ac.in>
12146
12147         * cs-tokenizer.cs (initTokens): Add keywords 'add' and 'remove'
12148
12149         * cs-parser.jay (event_declaration): Correct to remove the semicolon
12150         when the add and remove accessors are specified. 
12151
12152 2001-08-28  Ravi Pratap  <ravi@che.iitm.ac.in>
12153
12154         * cs-parser.jay (IndexerDeclaration): New helper class to hold
12155         information about indexer_declarator.
12156         (indexer_declarator): Implement actions.
12157         (parsing_indexer): New local boolean used to keep track of whether
12158         we are parsing indexers or properties. This is necessary because 
12159         implicit_parameters come into picture even for the get accessor in the 
12160         case of an indexer.
12161         (get_accessor_declaration, set_accessor_declaration): Correspondingly modified.
12162
12163         * class.cs (Indexer): New class for indexer declarations.
12164         (TypeContainer::AddIndexer): New method to add an indexer to a type.
12165         (TypeContainer::indexers): New member to hold list of indexers for the
12166         type.
12167
12168 2001-08-27  Ravi Pratap  <ravi@che.iitm.ac.in>
12169
12170         * cs-parser.jay (add_accessor_declaration): Implement action.
12171         (remove_accessor_declaration): Implement action.
12172         (event_accessors_declaration): Implement
12173         (variable_declarators): swap statements for first rule - trivial.
12174
12175         * class.cs (Event): New class to hold information about event
12176         declarations.
12177         (TypeContainer::AddEvent): New method to add an event to a type
12178         (TypeContainer::events): New member to hold list of events.
12179
12180         * cs-parser.jay (event_declaration): Implement actions.
12181
12182 2001-08-27  Ravi Pratap  <ravi@che.iitm.ac.in>
12183
12184         * cs-parser.jay (dim_separators): Implement. Make it a string
12185         concatenating all the commas together, just as they appear.
12186         (opt_dim_separators): Modify accordingly
12187         (rank_specifiers): Update accordingly. Basically do the same
12188         thing - instead, collect the brackets here.
12189         (opt_rank_sepcifiers): Modify accordingly.
12190         (array_type): Modify to actually return the complete type string
12191         instead of ignoring the rank_specifiers.
12192         (expression_list): Implement to collect the expressions
12193         (variable_initializer): Implement. We make it a list of expressions
12194         essentially so that we can handle the array_initializer case neatly too.
12195         (variable_initializer_list): Implement.
12196         (array_initializer): Make it a list of variable_initializers
12197         (opt_array_initializer): Modify accordingly.
12198
12199         * expression.cs (New::NType): Add enumeration to help us
12200         keep track of whether we have an object/delegate creation
12201         or an array creation.
12202         (New:NewType, New::Rank, New::Indices, New::Initializers): New
12203         members to hold data about array creation.
12204         (New:New): Modify to update NewType
12205         (New:New): New Overloaded contructor for the array creation
12206         case.
12207
12208         * cs-parser.jay (array_creation_expression): Implement to call
12209         the overloaded New constructor.
12210         
12211 2001-08-26  Ravi Pratap  <ravi@che.iitm.ac.in>
12212
12213         * class.cs (TypeContainer::Constructors): Return member
12214         constructors instead of returning null.
12215
12216 2001-08-26  Miguel de Icaza  <miguel@ximian.com>
12217
12218         * typemanager.cs (InitCoreTypes): Initialize the various core
12219         types after we have populated the type manager with the user
12220         defined types (this distinction will be important later while
12221         compiling corlib.dll)
12222
12223         * expression.cs, literal.cs, assign.cs, constant.cs: Started work
12224         on Expression Classification.  Now all expressions have a method
12225         `Resolve' and a method `Emit'.
12226
12227         * codegen.cs, cs-parser.jay: Fixed the bug that stopped code
12228         generation from working.     Also add some temporary debugging
12229         code. 
12230         
12231 2001-08-24  Miguel de Icaza  <miguel@ximian.com>
12232
12233         * codegen.cs: Lots of code generation pieces.  This is only the
12234         beginning, will continue tomorrow with more touches of polish.  We
12235         handle the fundamentals of if, while, do, for, return.  Others are
12236         trickier and I need to start working on invocations soon.
12237         
12238         * gen-treedump.cs: Bug fix, use s.Increment here instead of
12239         s.InitStatement. 
12240
12241         * codegen.cs (EmitContext): New struct, used during code
12242         emission to keep a context.   Most of the code generation will be
12243         here. 
12244
12245         * cs-parser.jay: Add embedded blocks to the list of statements of
12246         this block.  So code generation proceeds in a top down fashion.
12247
12248 2001-08-23  Miguel de Icaza  <miguel@ximian.com>
12249
12250         * statement.cs: Add support for multiple child blocks.
12251
12252 2001-08-22  Miguel de Icaza  <miguel@ximian.com>
12253
12254         * codegen.cs (EmitCode): New function, will emit the code for a
12255         Block of code given a TypeContainer and its ILGenerator. 
12256
12257         * statement.cs (Block): Standard public readonly optimization.
12258         (Block::Block constructors): Link children. 
12259         (Block::Child): Child Linker.
12260         (Block::EmitVariables): Emits IL variable declarations.
12261
12262         * class.cs: Drop support for MethodGroups here, delay until
12263         Semantic Analysis.
12264         (Method::): Applied the same simplification that I did before, and
12265         move from Properties to public readonly fields.
12266         (Method::ParameterTypes): Returns the parameter types for the
12267         function, and implements a cache that will be useful later when I
12268         do error checking and the semantic analysis on the methods is
12269         performed.
12270         (Constructor::GetCallingConvention): Renamed from CallingConvetion
12271         and made a method, optional argument tells whether this is a class
12272         or a structure to apply the `has-this' bit.
12273         (Method::GetCallingConvention): Implement, returns the calling
12274         convention. 
12275         (Method::Define): Defines the type, a second pass is performed
12276         later to populate the methods.
12277
12278         (Constructor::ParameterTypes): implement a cache similar to the
12279         one on Method::ParameterTypes, useful later when we do semantic
12280         analysis. 
12281
12282         (TypeContainer::EmitMethod):  New method.  Emits methods.
12283
12284         * expression.cs: Removed MethodGroup class from here.
12285         
12286         * parameter.cs (Parameters::GetCallingConvention): new method.
12287
12288 2001-08-21  Miguel de Icaza  <miguel@ximian.com>
12289
12290         * class.cs (TypeContainer::Populate): Drop RootContext from the
12291         argument. 
12292
12293         (Constructor::CallingConvention): Returns the calling convention.
12294         (Constructor::ParameterTypes): Returns the constructor parameter
12295         types. 
12296         
12297         (TypeContainer::AddConstructor): Keep track of default constructor
12298         and the default static constructor.
12299
12300         (Constructor::) Another class that starts using `public readonly'
12301         instead of properties. 
12302
12303         (Constructor::IsDefault): Whether this is a default constructor. 
12304
12305         (Field::) use readonly public fields instead of properties also.
12306
12307         (TypeContainer::TypeAttr, TypeContainer::AddConstructor): Keep
12308         track of static constructors;  If none is used, turn on
12309         BeforeFieldInit in the TypeAttributes. 
12310
12311         * cs-parser.jay (opt_argument_list): now the return can be null
12312         for the cases where there are no arguments. 
12313
12314         (constructor_declarator): If there is no implicit `base' or
12315         `this', then invoke the default parent constructor. 
12316         
12317         * modifiers.cs (MethodAttr): New static function maps a set of
12318         modifiers flags into a MethodAttributes enum
12319         (FieldAttr): renamed from `Map'.  So now we have FieldAttr,
12320         MethodAttr, TypeAttr to represent the various mappings where the
12321         modifiers are used.
12322         (FieldAttr): Map also `readonly' to `FieldAttributes.InitOnly'  
12323
12324 2001-08-19  Miguel de Icaza  <miguel@ximian.com>
12325
12326         * parameter.cs (GetParameterInfo): Fix bug where there would be no
12327         method arguments.
12328
12329         * interface.cs (PopulateIndexer): Implemented the code generator
12330         for interface indexers.
12331
12332 2001-08-17  Miguel de Icaza  <miguel@ximian.com>
12333
12334         * interface.cs (InterfaceMemberBase): Now we track the new status
12335         here.  
12336
12337         (PopulateProperty): Implement property population.  Woohoo!  Got
12338         Methods and Properties going today. 
12339
12340         Removed all the properties for interfaces, and replaced them with
12341         `public readonly' fields. 
12342
12343 2001-08-16  Miguel de Icaza  <miguel@ximian.com>
12344
12345         * interface.cs (AddEvent, AddMethod, AddIndexer, AddProperty):
12346         initialize their hashtables/arraylists only when they are needed
12347         instead of doing this always.
12348
12349         * parameter.cs: Handle refs and out parameters.
12350
12351         * cs-parser.jay: Use an ArrayList to construct the arguments
12352         instead of the ParameterCollection, and then cast that to a
12353         Parameter[] array.
12354
12355         * parameter.cs: Drop the use of ParameterCollection and use
12356         instead arrays of Parameters.
12357
12358         (GetParameterInfo): Use the Type, not the Name when resolving
12359         types. 
12360
12361 2001-08-13  Miguel de Icaza  <miguel@ximian.com>
12362
12363         * parameter.cs: Eliminate the properties Name, Type and ModFlags,
12364         and instead use public readonly fields.
12365
12366         * class.cs: Put back walking code for type containers.
12367
12368 2001-08-11  Miguel de Icaza  <miguel@ximian.com>
12369
12370         * class.cs (MakeConstant): Code to define constants.
12371
12372         * rootcontext.cs (LookupType): New function.  Used to locate types 
12373
12374         
12375 2001-08-08  Miguel de Icaza  <miguel@ximian.com>
12376
12377         * rootcontext.cs: OH MY!  My trick works!   It is amazing how nice
12378         this System.Reflection code is.  Kudos to Microsoft
12379         
12380         * typemanager.cs: Implement a type cache and avoid loading all
12381         types at boot time.  Wrap in LookupType the internals.  This made
12382         the compiler so much faster.  Wow.  I rule!
12383         
12384         * driver.cs: Make sure we always load mscorlib first (for
12385         debugging purposes, nothing really important).
12386
12387         * Renamespaced things that were on `CSC' to `CIR'.  Maybe I should
12388         have moved to `CSC' rather than `CIR'.  Oh man!  The confussion!  
12389
12390         * rootcontext.cs: Lookup types on their namespace;  Lookup types
12391         on namespaces that have been imported using the `using' keyword.
12392
12393         * class.cs (TypeContainer::TypeAttr): Virtualize.
12394         (Class::TypeAttr): Return attributes suitable for this bad boy.
12395         (Struct::TypeAttr): ditto.
12396         Handle nested classes.
12397         (TypeContainer::) Remove all the type visiting code, it is now
12398         replaced with the rootcontext.cs code
12399
12400         * rootcontext.cs (GetClassBases): Added support for structs. 
12401
12402 2001-08-06  Miguel de Icaza  <miguel@ximian.com>
12403
12404         * interface.cs, statement.cs, class.cs, parameter.cs,
12405         rootcontext.cs, gen-treedump.cs, enum.cs, cs-parse.jay:
12406         Drop use of TypeRefs, and use strings instead.
12407
12408 2001-08-04  Miguel de Icaza  <miguel@ximian.com>
12409
12410         * rootcontext.cs: 
12411
12412         * class.cs (Struct::Struct): set the SEALED flags after
12413         checking the modifiers.
12414         (TypeContainer::TypeAttr): new property, returns the
12415         TypeAttributes for a class.  
12416
12417         * cs-parser.jay (type_list): Oops, list production was creating a
12418         new list of base types.
12419
12420         * rootcontext.cs (StdLib): New property.
12421         (GetInterfaceTypeByName): returns an interface by type name, and
12422         encapsulates error handling here.
12423         (GetInterfaces): simplified.
12424         (ResolveTree): Encapsulated all the tree resolution here.
12425         (CreateClass, GetClassBases, GetInterfaceOrClass): Create class
12426         types. 
12427         
12428         * driver.cs: Add support for --nostdlib, to avoid loading the
12429         default assemblies.
12430         (Main): Do not put tree resolution here. 
12431
12432         * rootcontext.cs: Beginning of the class resolution.
12433
12434 2001-08-03  Miguel de Icaza  <miguel@ximian.com>
12435
12436         * rootcontext.cs: Provide better error reporting. 
12437
12438         * cs-parser.jay (interface_base): set our $$ to be interfaces.
12439
12440         * rootcontext.cs (CreateInterface): Handle the case where there
12441         are no parent interfaces.
12442         
12443         (CloseTypes): Routine to flush types at the end.
12444         (CreateInterface): Track types.
12445         (GetInterfaces): Returns an array of Types from the list of
12446         defined interfaces.
12447
12448         * typemanager.c (AddUserType): Mechanism to track user types (puts
12449         the type on the global type hash, and allows us to close it at the
12450         end). 
12451         
12452 2001-08-02  Miguel de Icaza  <miguel@ximian.com>
12453
12454         * tree.cs: Removed RecordType, added RecordClass, RecordStruct and
12455         RecordInterface instead.
12456
12457         * cs-parser.jay: Updated to reflect changes above.
12458
12459         * decl.cs (Definition): Keep track of the TypeBuilder type that
12460         represents this type here.  Not sure we will use it in the long
12461         run, but wont hurt for now.
12462
12463         * driver.cs: Smaller changes to accomodate the new code.
12464
12465         Call ResolveInterfaceBases, Call ResolveClassBases, Save assembly
12466         when done. 
12467
12468         * rootcontext.cs (CreateInterface):  New method, used to create
12469         the System.TypeBuilder type for interfaces.
12470         (ResolveInterfaces): new entry point to resolve the interface
12471         hierarchy. 
12472         (CodeGen): Property, used to keep track of the code generator.
12473
12474 2001-07-26  Miguel de Icaza  <miguel@ximian.com>
12475
12476         * cs-parser.jay: Add a second production for delegate_declaration
12477         with `VOID'.
12478
12479         (enum_body): Put an opt_comma here instead of putting it on
12480         enum_body or enum_member_declarations so we can handle trailing
12481         commas on enumeration members.  Gets rid of a shift/reduce.
12482         
12483         (type_list): Need a COMMA in the middle.
12484
12485         (indexer_declaration): Tell tokenizer to recognize get/set
12486
12487         * Remove old targets.
12488
12489         * Re-add the parser target.
12490
12491 2001-07-13  Simon Cozens <simon@simon-cozens.org>
12492
12493         * cs-parser.jay: Add precendence rules for a number of operators
12494         ot reduce the number of shift/reduce conflicts in the grammar.
12495         
12496 2001-07-17  Miguel de Icaza  <miguel@ximian.com>
12497
12498         * tree.cs: moved IGenerator interface and renamed it to ITreeDump
12499         and put it here.
12500
12501         Get rid of old crufty code.
12502
12503         * rootcontext.cs: Use this to keep track of the parsed
12504         representation and the defined types available to the program. 
12505
12506         * gen-treedump.cs: adjust for new convention.
12507
12508         * type.cs: Split out the type manager, and the assembly builder
12509         from here. 
12510
12511         * typemanager.cs: the type manager will live here now.
12512
12513         * cil-codegen.cs: And the code generator here. 
12514
12515 2001-07-14  Sean MacIsaac  <macisaac@ximian.com>
12516
12517         * makefile: Fixed up for easy making.
12518
12519 2001-07-13  Simon Cozens <simon@simon-cozens.org>
12520
12521         * cs-parser.jay (rank_specifier): Remove a conflict by reordering
12522         the 
12523
12524         (unary_expression): Expand pre_increment_expression and
12525         post_decrement_expression to reduce a shift/reduce.
12526
12527 2001-07-11  Simon Cozens
12528
12529         * cs-tokenizer.cs: Hex numbers should begin with a 0.
12530
12531         Improve allow_keyword_as_indent name.
12532
12533 2001-06-19  Miguel de Icaza  <miguel@ximian.com>
12534
12535         * Adjustments for Beta2. 
12536
12537 2001-06-13  Miguel de Icaza  <miguel@ximian.com>
12538
12539         * decl.cs: Added `Define' abstract method.
12540         (InTransit): new property, used to catch recursive definitions. 
12541
12542         * interface.cs: Implement `Define'. 
12543
12544         * modifiers.cs: Map Modifiers.constants to
12545         System.Reflection.TypeAttribute flags.
12546
12547         * class.cs: Keep track of types and user-defined types.
12548         (BuilderInit): New method for creating an assembly
12549         (ResolveType): New function to launch the resolution process, only
12550         used by interfaces for now.
12551
12552         * cs-parser.jay: Keep track of Classes, Structs and Interfaces
12553         that are inserted into the name space. 
12554
12555 2001-06-08  Miguel de Icaza  <miguel@ximian.com>
12556
12557         * ARGH.  I have screwed up my tree so many times due to the use of
12558         rsync rather than using CVS.  Going to fix this at once. 
12559
12560         * driver.cs: Objetify driver.  Load assemblies, use assemblies to
12561         load types.
12562
12563 2001-06-07  Miguel de Icaza  <miguel@ximian.com>
12564
12565         * Experiment successful: Use System.Type rather that our own
12566         version of Type.  
12567
12568 2001-05-25  Miguel de Icaza  <miguel@ximian.com>
12569
12570         * cs-parser.jay: Removed nsAliases from here.
12571
12572         Use new namespaces, handle `using XXX;' 
12573
12574         * namespace.cs: Reimplemented namespace handling, use a recursive
12575         definition of the class.  Now we can keep track of using clauses
12576         and catch invalid using clauses.
12577
12578 2001-05-24  Miguel de Icaza  <miguel@ximian.com>
12579
12580         * gen-treedump.cs: Adapted for all the renaming.
12581
12582         * expression.cs (Expression): this class now has a Type property
12583         which returns an expression Type.
12584
12585         (Probe::, New::, TypeOf::, SizeOf::, Constant::): renamed from
12586         `Type', as this has a different meaning now in the base
12587
12588 2001-05-22  Miguel de Icaza  <miguel@ximian.com>
12589
12590         * interface.cs, class.cs: Removed from all the sources the
12591         references to signature computation, as we can not do method
12592         signature computation during the parsing time, as we are not
12593         trying to solve at that point distinguishing:
12594
12595         class X {
12596                 void a (Blah x) {}
12597                 void a (NS.Blah x) {}
12598         }
12599
12600         Which depending on the context might be valid or not, as we do not
12601         know if Blah is the same thing as NS.Blah at that point.
12602
12603         * Redid everything so the code uses TypeRefs now instead of
12604         Types.  TypeRefs are just temporary type placeholders, that need
12605         to be resolved.  They initially have a pointer to a string and the
12606         current scope in which they are used.  This is used later by the
12607         compiler to resolve the reference to an actual Type. 
12608
12609         * DeclSpace is no longer a CIR.Type, and neither are
12610         TypeContainers (Class and Struct) nor Interfaces nor Enums.  They
12611         are all DeclSpaces, but no Types. 
12612
12613         * type.cs (TypeRefManager): This implements the TypeRef manager,
12614         which keeps track of all the types that need to be resolved after
12615         the parsing has finished. 
12616
12617 2001-05-13  Miguel de Icaza  <miguel@ximian.com>
12618
12619         * ARGH.  We are going to have to store `foreach' as a class rather
12620         than resolving it, as we need to verify error 1579 after name
12621         resolution.   *OR* we could keep a flag that says `This request to
12622         IEnumerator comes from a foreach statement' which we can then use
12623         to generate the error.
12624
12625 2001-05-10  Miguel de Icaza  <miguel@ximian.com>
12626
12627         * class.cs (TypeContainer.AddMethod): we now add methods to the
12628         MethodGroup instead of the method hashtable.  
12629
12630         * expression.cs: Add MethodGroup abstraction, which gets us one
12631         step closer to the specification in the way we handle method
12632         declarations.  
12633
12634         * cs-parser.jay (primary_expression): qualified_identifier now
12635         tried to match up an identifier to a local variable reference or
12636         to a parameter reference.
12637
12638         current_local_parameters is now a parser global variable that
12639         points to the current parameters for the block, used during name
12640         lookup.
12641
12642         (property_declaration): Now creates an implicit `value' argument to
12643         the set accessor.
12644
12645 2001-05-09  Miguel de Icaza  <miguel@ximian.com>
12646
12647         * parameter.cs: Do not use `param' arguments as part of the
12648         signature, per the spec.
12649
12650 2001-05-08  Miguel de Icaza  <miguel@ximian.com>
12651
12652         * decl.cs: Base class for classes, structs and interfaces.  This
12653         is the "Declaration Space" 
12654
12655         * cs-parser.jay: Use CheckDef for checking declaration errors
12656         instead of having one on each function.
12657
12658         * class.cs: Factor out some code for handling error handling in
12659         accordance to the "Declarations" section in the "Basic Concepts"
12660         chapter in the ECMA C# spec.
12661
12662         * interface.cs: Make all interface member classes derive from
12663         InterfaceMemberBase.
12664
12665 2001-05-07  Miguel de Icaza  <miguel@ximian.com>
12666
12667         * Many things: all interfaces are parsed and generated in
12668         gen-treedump.  Support for member variables, constructors,
12669         destructors, properties, constants is there.
12670
12671         Beginning of the IL backend, but very little done, just there for
12672         testing purposes. 
12673
12674 2001-04-29  Miguel de Icaza  <miguel@ximian.com>
12675
12676         * cs-parser.jay: Fix labeled statement.
12677
12678         * cs-tokenizer.cs (escape): Escape " and ' always.
12679         ref_line, ref_name: keep track of the line/filename as instructed
12680         by #line by the compiler.
12681         Parse #line.
12682
12683 2001-04-27  Miguel de Icaza  <miguel@ximian.com>
12684
12685         * System.CodeDOM/CodeBinaryOperatorExpression.cs: Rearrange enum
12686         to match the values in System.CodeDOM.
12687
12688         Divid renamed to Divide.
12689
12690         * System.CodeDOM/CodeForLoopStatement.cs: Always have valid
12691         statements. 
12692         (Statements.set): remove.
12693
12694         * System.CodeDOM/CodeCatchClause.cs: always have a valid
12695         statements. 
12696
12697         * System.CodeDOM/CodeIfStatement.cs: trueStatements and
12698         falseStatements always have valid values. 
12699
12700         * cs-parser.jay: Use System.CodeDOM now.
12701